]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/filestore/FileJournal: set block size via config option 7885/head
authorSage Weil <sage@redhat.com>
Fri, 12 Feb 2016 19:53:39 +0000 (14:53 -0500)
committerSage Weil <sage@redhat.com>
Wed, 2 Mar 2016 17:14:24 +0000 (12:14 -0500)
commit279826d308650e6bb65f68fb9f5cf14212bb41f3
tree312c59dbb8284c172df6f2dc28495b57e8a3b324
parent5eb2d6cf1ecb0c2d9b3caee10eff99c24d82b484
os/filestore/FileJournal: set block size via config option

We were setting the block_size as the MIN of the min size (4096) and the
block size reported for the journal file/device.  In reality, file systmes
report all kinds of crazy block sizes.  Usually it's the page size, but
sometimes it is larger (e.g., 128KB for ZFS), and that's not actually what
we want.  Using a size smaller than the file systems block size is not
optimal for performance, but it doesn't affect how the IO happens--as long
as it is larger than the hardware sector size, which is either 512 or
4096 bytes.  And our min was hard-coded at 4096.

So, instead, just set a config option to specify teh block size, and
default that to 4096.

The other uses of this constant we about *alignment* of memory buffers
for the purposes of direct IO.  Rename the constant but do not change
the logic.  That means we continue to use 4k alignment for direct io even
if the device has 512 byte sectors, but that's fine--no reason to use
a smaller alignment.

Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit c8048ce4bedf0d1ba5d448795c46668f2724f29d)
src/common/config_opts.h
src/os/FileJournal.cc