On Mon, 22 Nov 2010 18:09:33 -0800 Michel Lespinasse <walken@xxxxxxxxxx> wrote: > On Mon, Nov 22, 2010 at 3:06 PM, Andrew Morton > <akpm@xxxxxxxxxxxxxxxxxxxx> wrote: > > On Fri, 19 Nov 2010 19:23:22 -0800 > > Ying Han <yinghan@xxxxxxxxxx> wrote: > >> Yes, and it would be much easier later to add a small feature (like this > >> one) w/o > >> touching so many files of the shrinkers. I am thinking if we can extend the > >> scan_control > >> from page reclaim and pass it down to the shrinker ? > > > > Yes, that might work. __All callers of shrink_slab() already have a > > scan_control on the stack, so passing all that extra info to the > > shrinkers (along with some extra fields if needed) is pretty cheap, and > > I don't see a great downside to exposing unneeded fields to the > > shrinkers, given they're already on the stack somewhere. > > The only downside I can see is that it makes struct scan_control > public - it'll need to be declared in a public header file so that all > shrinkers can access it. We've done worse things ;) Put it in scan_control.h and it will only be exposed to code which has a legitimate need for it. > Maybe one way to mitigate this would be if we can make the shrinker > api take a *const* struct scan_control pointer as an argument, so that > it'll be clear that we expect the shrinkers to only read the > information in that struct. Well, we might want callees to update fields in there, say "number of bytes I managed to reclaim" or such. We do that with writeback_control.pages_skipped and it is comfortable enough. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>