Re: [PATCH -mm 2/2] mm: vmscan: init reclaim_state in do_try_to_free_pages

From: Vladimir Davydov
Date: Tue Jan 13 2015 - 02:56:12 EST


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/