On Mon, Jan 12, 2015 at 05:26:34PM -0500, Johannes Weiner wrote: > On Mon, Jan 12, 2015 at 12:30:38PM +0300, Vladimir Davydov wrote: > > All users of do_try_to_free_pages() want to have current->reclaim_state > > set in order to account reclaimed slab pages. So instead of duplicating > > the reclaim_state initialization code in each call site, let's do it > > directly in do_try_to_free_pages(). > > Couldn't this be contained in shrink_slab() directly? I had considered this possibility, but finally rejected it, because - some slab pages can be reclaimed from shrink_lruvec (e.g. buffer_head's); there shouldn't be too many of them though - struct reclaim_state looks to me as a generic placeholder for lots of reclaim-related stuff, though currently it is only used for counting reclaimed slab pages, so IMO it should be initialized before starting reclaim Both arguments are not rock-solid as you can see, so if you think we can neglect them, I'll do. Thanks, Vladimir -- 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>