On Wed, 3 Jul 2013 14:49:01 +1000 Dave Chinner <da...@fromorbit.com> wrote:
> On Tue, Jul 02, 2013 at 08:28:42PM -0700, Linus Torvalds wrote: > > On Tue, Jul 2, 2013 at 8:07 PM, Dave Chinner <da...@fromorbit.com> wrote: > > >> > > >> Then that test would become > > >> > > >> if (wbc->sync_mode == WB_SYNC_SINGLE) { > > >> > > >> instead, and now "sync_mode" would actually describe what mode of > > >> syncing the caller wants, without that hacky special "we know what the > > >> caller _really_ meant by looking at *which* caller it is". > > > > > > The problem is that all the code that currently looks for > > > WB_SYNC_ALL for it's behavioural cue during writeback now has > > > multiple different modes they have to handle. IOWs, it's not a > > > straight forward conversion process. WB_SYNC_ALL reaches right down > > > into filesystem ->writepages implementations and they all need to be > > > changed if we make up a new sync_mode behaviour. > > > > I have to admit that I absolutely detest our current "sync_mode" to > > begin with, so I'd personally be happy to see some major surgery in > > this area. Forgive me, I was young. > > > WB_SYNC_NONE semantics would presumably be "just > > start writeout" (so it would become WB_SYNC_WRITE), while WB_SYNC_ALL > > would become (WB_SYNC_BEFORE | WB_SYNC_WRITE | WB_SYNC_AFTER), but > > then the "for_sync" case would remove WB_SYNC_AFTER, because it does > > its own waiting after. > > Not exactly. WB_SYNC_NONE currently means "best effort writeback" Yup. WB_SYNC_NONE means "this is for memory cleaning" and WB_SYNC_ALL means "this is for data integrity". They're two quite different concepts whose implementations share a ton of code. That being said, yes, sync_mode is pretty dorky and switching to a set of very carefully defined flags makes sense. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/