linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] OrangeFS blocksize in superblock and inode
@ 2018-04-25 17:27 martin
  2018-04-26 16:16 ` Walt Ligon
  0 siblings, 1 reply; 3+ messages in thread
From: martin @ 2018-04-25 17:27 UTC (permalink / raw)
  To: linux-fsdevel, devel, hubcap, walt, ligon

OrangeFS sends and receives I/O to a userspace client using shared
memory buffers.  OrangeFS sets blocksize in the superblock based on the
size of these buffers.  This is typically four megabytes.

sb->s_blocksize = orangefs_bufmap_size_query();
sb->s_blocksize_bits = orangefs_bufmap_shift_query();

Then OrangeFS sets blkbits on a regular file inode to PAGE_SHIFT, but
does not.  This dates back to 2003, long before OrangeFS was upstream.

http://dev.orangefs.org/trac/orangefs/changeset/2083

It appears neill was attempting to implement mmap.

/* 
  FIXME: 
  We're faking our inode block size to be PAGE_CACHE_SIZE 
  to play nicely with the page cache. 

  In some reality, inode->i_blksize != PAGE_CACHE_SIZE and 
  inode->i_blkbits != PAGE_CACHE_SHIFT 
*/ 

The comment is wrong anyway, as he sets block size to PAGE_CACHE_SIZE.
This leads me to suspect the whole idea is wrong.

I don't see any reason blkbits must equal PAGE_SHIFT.  Paging-related
code uses PAGE_SIZE and PAGE_SHIFT.  There are some references in fs/*
and mm/*,  but none that appear to affect OrangeFS.

The goal of setting blksize is to cause applications to perform bigger
reads and writes by reporting an increased block size through stat.
Then despite all the hoopla around blksize, it is not used for that
purpose.

stat->blksize = orangefs_inode->blksize;

which is the block size reported by the OrangeFS server (64 kilobytes in
my single-server environment, but it varies based on how parallel the
installation is).  This value may differ per file.

Then stat->blocks is set to inode->i_blocks in generic_fillattr, which
is set to (i_size + (4096 - i_size % 4096))/512.  The 4096 is hardcoded.

One approach is to set i_blksize to the size reported by the server and
set i_blocks to (i_size + (512 - i_size % 512))/512.  I intend to remove
orangefs_inode->blksize.

Then i_blksize may not equal PAGE_SIZE.  I am unsure of the implications
of this.

That leaves the superblock block size.  This ends up being reported as
i_blksize for directories and symlinks.  OrangeFS only reports a block
size on regular files.  Four megabytes seems rather large, but I'm not
sure what else to use.  I could use PAGE_SIZE.

Another approach is to set blksize to the page size.

However, I am informed by the OrangeFS server developers that they
really want this to value to change based on the number of servers the
file will be striped across.

With that in mind, I could set stat->blksize based on the server-reported
value but use PAGE_SIZE for the superblock and non-regular-file objects.

Do I need to keep i_blksize equal to PAGE_SIZE or may it also be set to
the server-reported value?

Do either of these sound more reasonable than the other?  Should I do
something else entirely?

Thanks in advance for any advice anyone may be able to give.

Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-02 18:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-25 17:27 [RFC] OrangeFS blocksize in superblock and inode martin
2018-04-26 16:16 ` Walt Ligon
2018-05-02 18:01   ` [PATCH] revamp OrangeFS block sizes Martin Brandenburg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).