Re: [PATCH] mm/workingset: do not forget to unlock page

From
Johannes Weiner <hannes@cmpxchg.org>
Date
2016-02-03 22:03:48
Also in
cgroups, lkml
Reply to
Andrew Morton, 2016-02-03
On Wed, Feb 03, 2016 at 01:19:39PM -0800, Andrew Morton wrote:
Yup.  I turned it into a fix against
mm-workingset-per-cgroup-cache-thrash-detection.patch, which is where
the bug was added.  And I did the goto thing instead, so the final
result will be

void workingset_activation(struct page *page)
{
	struct lruvec *lruvec;

	lock_page_memcg(page);
	/*
	 * Filter non-memcg pages here, e.g. unmap can call
	 * mark_page_accessed() on VDSO pages.
	 *
	 * XXX: See workingset_refault() - this should return
	 * root_mem_cgroup even for !CONFIG_MEMCG.
	 */
	if (!mem_cgroup_disabled() && !page_memcg(page))
		goto out;
	lruvec = mem_cgroup_zone_lruvec(page_zone(page), page_memcg(page));
	atomic_long_inc(&lruvec->inactive_age);
out:
	unlock_page_memcg(page);
}
LGTM, thank you.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Thread (6 messages) 6 messages, 3 authors, last reply 2016-02-04
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help