New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
os/filestore/FileJournal: set block size via config option #7628
Conversation
@liewegas |
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>
30e8c0e
to
c8048ce
Compare
@wjwithagen thanks, fixed the assert placement. |
assert((pos & (CEPH_MINIMUM_BLOCK_SIZE - 1)) == 0); | ||
assert((bl.length() & (CEPH_DIRECTIO_ALIGNMENT - 1)) == 0); | ||
assert((pos & (CEPH_DIRECTIO_ALIGNMENT - 1)) == 0); | ||
assert(0 == "bl should be align"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"aligned", while we're at it, and I think it's clearer to say "bl is not aligned"
Signed-off-by: Sage Weil <sage@redhat.com>
785137e
to
caa73ba
Compare
looks good to me. |
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>
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>
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>
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>
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>
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>
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>
os/filestore/FileJournal: set block size via config option Reviewed-by: Willem Jan Withagen <wjw@digiware.nl>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 option 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