linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Clarification on inode alignment
@ 2017-02-23  6:21 Chandan Rajendra
  2017-02-24  0:08 ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Chandan Rajendra @ 2017-02-23  6:21 UTC (permalink / raw)
  To: dchinner; +Cc: linux-xfs, sandeen@sandeen.net, Darrick J . Wong

Hi Dave,

Last week, during a discussion on #xfs you stated that,

"inode alignment is necessary to avoid needing to do an inobt lookup to find
the location of the inode every time we map an inode to disk".

Also, The following statement appears at
http://xfs.org/index.php/Improving_inode_Caching,

"The main problem we have is that XFS uses inode chunk size and alignment to
optimise inode number to disk location conversion. That is, the conversion
becomes a single set of shifts and masks instead of an AGI btree lookup. This
optimisation substantially reduces the CPU and I/O overhead of inode lookups,
but it does limit our flexibility. If we break the alignment restriction,
every lookup has to go back to a btree search. Hence we really want to avoid
breaking chunk alignment and size rules."

For the 4k block size scenario, I noticed that we have inode alignment of 4
blocks. I did go through macros such as XFS_INO_TO_AGNO(),
XFS_INO_TO_AGBNO() and XFS_INO_TO_OFFSET() which deal with extracting the
components from an inode number.

However I still don't understand how non-aligned inode clusters (64 inodes in
a single cluster) would break the inode number to disk location
arithmetic calculations. Could you please explain it?

-- 
chandan


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

end of thread, other threads:[~2017-02-24 10:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23  6:21 Clarification on inode alignment Chandan Rajendra
2017-02-24  0:08 ` Dave Chinner
2017-02-24 10:24   ` Chandan Rajendra

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).