]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Optimize inode allocation by remembering last group
authorTao Ma <tao.ma@oracle.com>
Tue, 24 Feb 2009 16:53:23 +0000 (00:53 +0800)
committerMark Fasheh <mfasheh@suse.com>
Fri, 3 Apr 2009 18:39:17 +0000 (11:39 -0700)
commitb5385d4059b5dbad08a5373e0e1fddaca40b0f39
tree9b6fff8512a19792f2e29458292607f4efb413c4
parentb2f9022222dbe37b23229231a40cf450d0594bdf
ocfs2: Optimize inode allocation by remembering last group

In ocfs2, the inode block search looks for the "emptiest" inode
group to allocate from. So if an inode alloc file has many equally
(or almost equally) empty groups, new inodes will tend to get
spread out amongst them, which in turn can put them all over the
disk. This is undesirable because directory operations on conceptually
"nearby" inodes force a large number of seeks.

So we add ip_last_used_group in core directory inodes which records
the last used allocation group. Another field named ip_last_used_slot
is also added in case inode stealing happens. When claiming new inode,
we passed in directory's inode so that the allocation can use this
information.
For more details, please see
http://oss.oracle.com/osswiki/OCFS2/DesignDocs/InodeAllocationStrategy.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/inode.c
fs/ocfs2/inode.h
fs/ocfs2/namei.c
fs/ocfs2/suballoc.c
fs/ocfs2/suballoc.h