public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH] - revert generic_fillattr stat->blksize to PAGE_CACHE_SIZE
@ 2006-11-06 21:50 Eric Sandeen
  2006-11-06 22:27 ` Dave Kleikamp
  2006-11-06 23:05 ` Christoph Hellwig
  0 siblings, 2 replies; 18+ messages in thread
From: Eric Sandeen @ 2006-11-06 21:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List, linux-fsdevel; +Cc: Theodore Tso

The inode diet patches first did this to generic_fillattr():

-	stat->blksize = inode->i_blksize;
+	stat->blksize = PAGE_CACHE_SIZE;

but by 2.6.19-rc3 this was changed again:

-	stat->blksize = PAGE_CACHE_SIZE;
+	stat->blksize = (1 << inode->i_blkbits);

I can't find for sure why this was done; perhaps because it exposed a bug
in cifs[1]

However, if we are going to pick a default for generic_fillattr, it should probably
be what most filesystems were using before, and let filesystems which need something
else re-set it to according to their needs.  As it stands today, doing readdirs and
the like in block-sized chunks rather than page sized will probably not be the
best thing for performance.

A bit of quick parsing of the original inode diet patch shows that by far most
filesystems were using the page size:

(count) (line which sets i_blksize)
      1 cifs_inode->vfs_inode.i_blksize = CIFS_MAX_MSGSIZE;
      1 i->i_blksize = 512;
      1 inode->i_blksize = attr->va_blocksize;
      1 inode->i_blksize = befs_sb->block_size;
      1 inode->i_blksize = HFSPLUS_SB(inode->i_sb).alloc_blksz;
      1 inode->i_blksize = HFSPLUS_SB(sb).alloc_blksz;
      1 inode->i_blksize = HFS_SB(inode->i_sb)->alloc_blksz;
      1 inode->i_blksize = HFS_SB(sb)->alloc_blksz;
      1 inode->i_blksize = HPAGE_SIZE;
      1 inode->i_blksize = NCP_BLOCK_SIZE;
      1 inode->i_blksize = QNX4_DIR_ENTRY_SIZE;
      1 inode->i_blksize = (u32)osb->s_clustersize;
      1 inode->i_blksize = xfs_preferred_iosize(mp);
      1 ino->i_blksize = i_blksize;
      1 ino->i_blksize = proc_ino->i_blksize;
      1 ip->i_blksize = ip->i_sb->s_blocksize;
      1 ip->i_blksize = PAGE_SIZE;
      2 inode->i_blksize = fattr->du.nfs2.blocksize;
      2 inode->i_blksize = inode->i_sb->s_blocksize;
      2 inode->i_blksize = reiserfs_default_io_size;
      2 inode->i_blksize = sbi->cluster_size;
      2 vi->i_blksize = PAGE_CACHE_SIZE;
      3 inode->i_blksize = sb->s_blocksize;
      3 ret->i_blksize = PAGE_CACHE_SIZE;
      5 inode->i_blksize = 1024;
      7 inode->i_blksize = 0;
     12 inode->i_blksize = PAGE_SIZE;
     22 inode->i_blksize = PAGE_CACHE_SIZE;

so I would propose the following patch to make PAGE_CACHE_SIZE the default (again), 
and let filesystems which need something -else- do that on their own.

[1] http://lists.samba.org/archive/linux-cifs-client/2006-September/001481.html

Thanks,
-Eric

Signed-off-by: Eric Sandeen <sandeen@redhat.com>

--- linux.orig/fs/stat.c	2006-11-05 23:27:04.962482569 -0600
+++ linux/fs/stat.c	2006-11-05 23:27:29.394396050 -0600
@@ -33,7 +33,7 @@
  	stat->ctime = inode->i_ctime;
  	stat->size = i_size_read(inode);
  	stat->blocks = inode->i_blocks;
-	stat->blksize = (1 << inode->i_blkbits);
+	stat->blksize = PAGE_CACHE_SIZE;
  }

  EXPORT_SYMBOL(generic_fillattr);


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Re: [RFC/PATCH] - revert generic_fillattr stat->blksize to PAGE_CACHE_SIZE
@ 2006-12-03 13:21 col-pepper
  2006-12-03 13:48 ` Adrian Bunk
  0 siblings, 1 reply; 18+ messages in thread
From: col-pepper @ 2006-12-03 13:21 UTC (permalink / raw)
  To: linux-kernel

I am using a 2.6.18.2 based kernel and see lots of broken fs due to this  
"diet". eg cloop

I hope some general lessons can be drawn about the necessity and  
desirablility of such changes that (predictably) invoke broadband breakage.

This kind of change and the breakage and dependancy issues they create are  
what makes linux a nightmare to maintain.

While it seems some improvement and clean up may result from this getting  
attention, it appears that the inode structure is back to it's original  
size. Which is quite probably the way it should have stayed all along.

Hopefully this has now stablised.


What kernel release contains code where all this calms down and I dont  
need to search patches and updates for modules in order to get basics to  
work again?

Alternatively can I simply revert the original diet patch on my 2.6.18.2  
to maintain working fs modules?

Thanks for your replys.


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

end of thread, other threads:[~2006-12-03 13:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06 21:50 [RFC/PATCH] - revert generic_fillattr stat->blksize to PAGE_CACHE_SIZE Eric Sandeen
2006-11-06 22:27 ` Dave Kleikamp
2006-11-06 22:37   ` Eric Sandeen
2006-11-07  0:26   ` Steve French
2006-11-07 13:40     ` Dave Kleikamp
2006-11-07 15:34       ` Dave Kleikamp
2006-11-07 15:50         ` Steve French
2006-11-06 23:05 ` Christoph Hellwig
2006-11-06 23:15   ` Eric Sandeen
2006-11-06 23:17     ` Christoph Hellwig
2006-11-06 23:28       ` Eric Sandeen
2006-11-07  0:08     ` Andreas Dilger
2006-11-07  0:13       ` Hua Zhong
2006-11-07  1:39       ` Eric Sandeen
2006-11-07  3:43     ` Theodore Tso
2006-11-07  4:02       ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2006-12-03 13:21 col-pepper
2006-12-03 13:48 ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox