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

From
Sergey Senozhatsky <hidden>
Date
2016-02-03 10:40:30
Also in
linux-mm, lkml
Reply to
Sergey Senozhatsky, 2016-02-03
On (02/03/16 18:58), Sergey Senozhatsky wrote:
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().
d'oh... sorry, the commit message is simply insane.


apparently the patch fixes a new code
	mm-workingset-per-cgroup-cache-thrash-detection.patch added to -mm tree
	mm-simplify-lock_page_memcg.patch added to -mm tree


so if there is an option to fold this patch into mm-simplify-lock_page_memcg,
for example, as a -fix, then I wouldn't mind at all.



a better commit message
===8<====8<====

From 1d6315221f2f81c53c99f9980158f8ae49dbd582 Mon Sep 17 00:00:00 2001
From: Sergey Senozhatsky <redacted>
Date: Wed, 3 Feb 2016 18:49:16 +0900
Subject: [PATCH] mm/workingset: do not forget to unlock_page in workingset_activation

Do not return from workingset_activation() with locked rcu and page.

Signed-off-by: Sergey Senozhatsky <redacted>
---
 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

--
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