At Mon, 10 May 2010 03:29:22 +0900 (JST), Ryusuke Konishi wrote: > > On Mon, 10 May 2010 01:45:35 +0900, Jiro SEKIBA wrote: > > > As an alternative, I'm thinking to add a new state flag which > > > indicates segments are allocated physically continuously from > > > the super root to which super blocks point. > > > > > > > > > The aim of this flag is allowing nilfs to find out the latest segment > > > with bisection search. > > > > > > Envisioned changes are as follows: > > > > > > * add the new flag (for example, NILFS_INORDER_FS) for sbp->s_state. > > > > > > * set the flag if a new mount options is specified (for example > > > "-o bisect-root"). > > > > > > * Do not update super block when the filesystem is unmounted, and keep > > > the state: s_state.NILFS_INORDER_FS = 1, s_state.NILFS_VALID_FS = 0. > > > > > > * Stop periodic update of super blocks if the flag is set. > > > > > > * If s_state.NILFS_VALID_FS = 0 && s_state.NILFS_INORDER_FS = 1 when > > > the filesystem is mounted, then do bisect search to find out the > > > latest segment. > > > > Here are the question, to do bisect search, you need to know the end of > > the segments to divide physically continuous blocks. Which is the > > end of the block for bisect? Is this going to be the physical partition end? > > The end position is the segment immediately in front of the current > segment since disk space is typically used like a circular buffer. Ah, I got it. The continuous log is the one to make bisect search possible, yet roll forwarding can reach the latest log. I think, roll forwarding may be enough for boot loader, for it still reach correct log. And once correctly mounted, super block will be corrected. Thanks! regards, > > > * If a new segment is allocated discontinuously and a new super root > > > is created, then write out super blocks to catch up the position. > > > > > > * If GC breaks the series of physically continous segments, then > > > update super blocks to catch up the latest super root position. > > > > > > * Add a new option to cleanerd to pass the "-o bisect-root" mode > > > and let it select the rotational GC algorithm (current default). > > > > > > * If the "-o bisect-root" option is not specified, then use a > > > conventional algorithm and drop the NILFS_INORDER_FS flag. > > > > I prefer option name like "-o async_sb" or "-o no_sync_sb" or so. > > Because users would rather curious how to udpate super block than > > how to find the latest log. > > Thanks for the comment. In a narrow sense, "no_sync_sb" is difficult > in this approach, so "few_sync_sb" or "async_sb" sounds better to me. > Anyway, I agree with your point. > > > > This doesn't break forward compatibility, because the "next segment > > > chain" is still maintained and older implementations will ignore the > > > NILFS_INORDER_FS flag. Older implementations and the current grub2 > > > module can find the latest super root though they incur penalty for > > > mount time. > > > > > > Another drawback of this approach is that it depends on garbage > > > collection algorithm, but at least at present, this seems not to > > > matter. > > > > > > How does that sound? > > > > It would be much better than scanning whole segments from > > boot loader point of view. > > Yes, I believe it doesn't complicate boot loader so much. > > Thanks, > Ryusuke Konishi > -- > To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > > > -- Jiro SEKIBA <jir@xxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html