On Mon, Jun 02, 2014 at 02:16:57PM -0700, Andrew Morton wrote: > On Mon, 02 Jun 2014 09:12:25 -0700 Dave Hansen <dave.hansen@xxxxxxxxx> wrote: > > > On 06/01/2014 10:24 PM, Naoya Horiguchi wrote: > > > -#define PAGECACHE_TAG_DIRTY 0 > > > -#define PAGECACHE_TAG_WRITEBACK 1 > > > -#define PAGECACHE_TAG_TOWRITE 2 > > > +enum { > > > + PAGECACHE_TAG_DIRTY, > > > + PAGECACHE_TAG_WRITEBACK, > > > + PAGECACHE_TAG_TOWRITE, > > > + __NR_PAGECACHE_TAGS, > > > +}; > > > > Doesn't this end up exposing kernel-internal values out to a userspace > > interface? Wouldn't that lock these values in to the ABI? > > Yes, we should be careful here. We should not do anything which > constrains future kernel code or which causes any form of > compatibility/migration issues. OK. > I wonder if we can do something smart with the interface. For example > when userspace calls sys_fincore() it must explicitly ask for > PAGECACHE_TAG_DIRTY and if some future kernel doesn't implement > PAGECACHE_TAG_DIRTY, it can return -EINVAL. > > Or maybe it can succeed, but tells userspace "you didn't get > PAGECACHE_TAG_DIRTY". > > <thinking out loud> > > So userspace sends a mask of bits which select what fields it wants. > The kernel returns a mask of bits which tell userspace what it actually > received. > > Or something like that - you get the idea ;) Thanks, I'll try this with another flag parameter for this purpose. Naoya Horiguchi -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>