Change in vdsm[master]: Use buffer size in multiplies of the recommended transfer si...

smizrahi at redhat.com smizrahi at redhat.com
Thu Oct 4 11:16:03 UTC 2012


Saggi Mizrahi has uploaded a new change for review.

Change subject: Use buffer size in multiplies of the recommended transfer size
......................................................................

Use buffer size in multiplies of the recommended transfer size

This seems to fix the issue but I'm not sure if it's the best possible
solution. Might help get things rolling until we get this nailed down.

Change-Id: Iadea310039b30073197b7ad90afb930c460bda17
Signed-off-by: Saggi Mizrahi <smizrahi at redhat.com>
---
M vdsm/storage/fileUtils.py
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/8356/1

diff --git a/vdsm/storage/fileUtils.py b/vdsm/storage/fileUtils.py
index 80c45e9..2719d91 100644
--- a/vdsm/storage/fileUtils.py
+++ b/vdsm/storage/fileUtils.py
@@ -31,6 +31,7 @@
 import ctypes
 from contextlib import contextmanager
 import subprocess
+import math
 
 import shutil
 from vdsm import constants
@@ -47,6 +48,7 @@
 CharPointer = ctypes.POINTER(ctypes.c_char)
 
 _PC_REC_XFER_ALIGN = 17
+_PC_REC_MIN_XFER_SIZE = 16
 
 
 class TarCopyFailed(RuntimeError):
@@ -296,6 +298,8 @@
         # Because we usually have fixed sizes for our reads, caching
         # buffers might give a slight performance boost.
         alignment = libc.fpathconf(self.fileno(), _PC_REC_XFER_ALIGN)
+        minXferSize = libc.fpathconf(self.fileno(), _PC_REC_MIN_XFER_SIZE)
+        size = int(math.ceil(size / float(minXferSize))) * minXferSize
         rc = libc.posix_memalign(ppbuff, alignment, size)
         if rc:
             raise OSError(rc, "Could not allocate aligned buffer")


--
To view, visit http://gerrit.ovirt.org/8356
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadea310039b30073197b7ad90afb930c460bda17
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list