Skip to content

Commit

Permalink
os/filestore/FileJournal: set block size via config option ceph#7628
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
wjwithagen committed Apr 15, 2016
1 parent 8468cde commit 2cfeedd
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/os/filestore/FileJournal.cc
Expand Up @@ -48,7 +48,6 @@
const static int64_t ONE_MEG(1 << 20);
const static int CEPH_DIRECTIO_ALIGNMENT(4096);


int FileJournal::_open(bool forwrite, bool create)
{
int flags, ret;
Expand Down

0 comments on commit 2cfeedd

Please sign in to comment.