Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1325108

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

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] mm/workingset: do not forget to unlock page
Date 2016-02-03 11:00 +0100
Message-ID <qY2o9-hJ-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Do not leave page locked (and RCU read side locked) when
return from workingset_activation() due to disabled memcg
or page not being a page_memcg().

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 mm/workingset.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/workingset.c b/mm/workingset.c
index 14522ed..54138a9 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -315,8 +315,10 @@ void workingset_activation(struct page *page)
 	 * XXX: See workingset_refault() - this should return
 	 * root_mem_cgroup even for !CONFIG_MEMCG.
 	 */
-	if (!mem_cgroup_disabled() && !page_memcg(page))
+	if (!mem_cgroup_disabled() && !page_memcg(page)) {
+		unlock_page_memcg(page);
 		return;
+	}
 	lruvec = mem_cgroup_zone_lruvec(page_zone(page), page_memcg(page));
 	atomic_long_inc(&lruvec->inactive_age);
 	unlock_page_memcg(page);
-- 
2.7.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] mm/workingset: do not forget to unlock page Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-03 11:00 +0100
  Re: [PATCH] mm/workingset: do not forget to unlock page Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-03 11:50 +0100
    Re: [PATCH] mm/workingset: do not forget to unlock page Johannes Weiner <hannes@cmpxchg.org> - 2016-02-03 17:30 +0100
      Re: [PATCH] mm/workingset: do not forget to unlock page Andrew Morton <akpm@linux-foundation.org> - 2016-02-03 22:20 +0100
        Re: [PATCH] mm/workingset: do not forget to unlock page Johannes Weiner <hannes@cmpxchg.org> - 2016-02-03 23:10 +0100
          Re: [PATCH] mm/workingset: do not forget to unlock page Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-04 01:20 +0100

csiph-web