* [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 9:58 ` Sergey Senozhatsky
0 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-03 9:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky
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
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 9:58 ` Sergey Senozhatsky
0 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-03 9:58 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky
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
--
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>
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
2016-02-03 9:58 ` Sergey Senozhatsky
(?)
@ 2016-02-03 10:41 ` Sergey Senozhatsky
-1 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-03 10:41 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky
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 <sergey.senozhatsky@gmail.com>
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 <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
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 10:41 ` Sergey Senozhatsky
0 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-03 10:41 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky
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<====
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 10:41 ` Sergey Senozhatsky
0 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-03 10:41 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky
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 <sergey.senozhatsky@gmail.com>
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 <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
--
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>
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
2016-02-03 10:41 ` Sergey Senozhatsky
@ 2016-02-03 16:24 ` Johannes Weiner
-1 siblings, 0 replies; 16+ messages in thread
From: Johannes Weiner @ 2016-02-03 16:24 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Andrew Morton, Vladimir Davydov, Michal Hocko, cgroups, linux-mm,
linux-kernel, Sergey Senozhatsky
On Wed, Feb 03, 2016 at 07:41:36PM +0900, Sergey Senozhatsky wrote:
> From 1d6315221f2f81c53c99f9980158f8ae49dbd582 Mon Sep 17 00:00:00 2001
> From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 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 <sergey.senozhatsky@gmail.com>
Thanks Sergey. Even though I wrote this function, my brain must have
gone "it can't be locking anything when it returns NULL, right?" It's
a dumb interface. Luckily, that's fixed with follow-up patches in -mm.
As for this one:
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Fixes: mm: workingset: per-cgroup cache thrash detection
Andrew, can you please fold this?
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 16:24 ` Johannes Weiner
0 siblings, 0 replies; 16+ messages in thread
From: Johannes Weiner @ 2016-02-03 16:24 UTC (permalink / raw)
To: Sergey Senozhatsky
Cc: Andrew Morton, Vladimir Davydov, Michal Hocko, cgroups, linux-mm,
linux-kernel, Sergey Senozhatsky
On Wed, Feb 03, 2016 at 07:41:36PM +0900, Sergey Senozhatsky wrote:
> From 1d6315221f2f81c53c99f9980158f8ae49dbd582 Mon Sep 17 00:00:00 2001
> From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 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 <sergey.senozhatsky@gmail.com>
Thanks Sergey. Even though I wrote this function, my brain must have
gone "it can't be locking anything when it returns NULL, right?" It's
a dumb interface. Luckily, that's fixed with follow-up patches in -mm.
As for this one:
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Fixes: mm: workingset: per-cgroup cache thrash detection
Andrew, can you please fold this?
--
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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
2016-02-03 16:24 ` Johannes Weiner
(?)
@ 2016-02-03 21:19 ` Andrew Morton
-1 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2016-02-03 21:19 UTC (permalink / raw)
To: Johannes Weiner
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky
On Wed, 3 Feb 2016 11:24:00 -0500 Johannes Weiner <hannes@cmpxchg.org> wrote:
> On Wed, Feb 03, 2016 at 07:41:36PM +0900, Sergey Senozhatsky wrote:
> > From 1d6315221f2f81c53c99f9980158f8ae49dbd582 Mon Sep 17 00:00:00 2001
> > From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > 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 <sergey.senozhatsky@gmail.com>
>
> Thanks Sergey. Even though I wrote this function, my brain must have
> gone "it can't be locking anything when it returns NULL, right?" It's
> a dumb interface. Luckily, that's fixed with follow-up patches in -mm.
>
> As for this one:
>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Fixes: mm: workingset: per-cgroup cache thrash detection
>
> Andrew, can you please fold this?
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);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 21:19 ` Andrew Morton
0 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2016-02-03 21:19 UTC (permalink / raw)
To: Johannes Weiner
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky
On Wed, 3 Feb 2016 11:24:00 -0500 Johannes Weiner <hannes@cmpxchg.org> wrote:
> On Wed, Feb 03, 2016 at 07:41:36PM +0900, Sergey Senozhatsky wrote:
> > From 1d6315221f2f81c53c99f9980158f8ae49dbd582 Mon Sep 17 00:00:00 2001
> > From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> > 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 <sergey.senozhatsky@gmail.com>
>
> Thanks Sergey. Even though I wrote this function, my brain must have
> gone "it can't be locking anything when it returns NULL, right?" It's
> a dumb interface. Luckily, that's fixed with follow-up patches in -mm.
>
> As for this one:
>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>
> Fixes: mm: workingset: per-cgroup cache thrash detection
>
> Andrew, can you please fold this?
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);
}
--
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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 21:19 ` Andrew Morton
0 siblings, 0 replies; 16+ messages in thread
From: Andrew Morton @ 2016-02-03 21:19 UTC (permalink / raw)
To: Johannes Weiner
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko,
cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sergey Senozhatsky
On Wed, 3 Feb 2016 11:24:00 -0500 Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org> wrote:
> On Wed, Feb 03, 2016 at 07:41:36PM +0900, Sergey Senozhatsky wrote:
> > From 1d6315221f2f81c53c99f9980158f8ae49dbd582 Mon Sep 17 00:00:00 2001
> > From: Sergey Senozhatsky <sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 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 <sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> Thanks Sergey. Even though I wrote this function, my brain must have
> gone "it can't be locking anything when it returns NULL, right?" It's
> a dumb interface. Luckily, that's fixed with follow-up patches in -mm.
>
> As for this one:
>
> Acked-by: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
> Fixes: mm: workingset: per-cgroup cache thrash detection
>
> Andrew, can you please fold this?
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);
}
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
2016-02-03 21:19 ` Andrew Morton
(?)
@ 2016-02-03 22:02 ` Johannes Weiner
-1 siblings, 0 replies; 16+ messages in thread
From: Johannes Weiner @ 2016-02-03 22:02 UTC (permalink / raw)
To: Andrew Morton
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 22:02 ` Johannes Weiner
0 siblings, 0 replies; 16+ messages in thread
From: Johannes Weiner @ 2016-02-03 22:02 UTC (permalink / raw)
To: Andrew Morton
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky
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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-03 22:02 ` Johannes Weiner
0 siblings, 0 replies; 16+ messages in thread
From: Johannes Weiner @ 2016-02-03 22:02 UTC (permalink / raw)
To: Andrew Morton
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko,
cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sergey Senozhatsky
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
2016-02-03 22:02 ` Johannes Weiner
(?)
@ 2016-02-04 0:19 ` Sergey Senozhatsky
-1 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-04 0:19 UTC (permalink / raw)
To: Andrew Morton, Johannes Weiner
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky
On (02/03/16 17:02), Johannes Weiner wrote:
> 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.
Thanks!
-ss
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-04 0:19 ` Sergey Senozhatsky
0 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-04 0:19 UTC (permalink / raw)
To: Andrew Morton, Johannes Weiner
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko, cgroups,
linux-mm, linux-kernel, Sergey Senozhatsky
On (02/03/16 17:02), Johannes Weiner wrote:
> 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.
Thanks!
-ss
--
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>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] mm/workingset: do not forget to unlock page
@ 2016-02-04 0:19 ` Sergey Senozhatsky
0 siblings, 0 replies; 16+ messages in thread
From: Sergey Senozhatsky @ 2016-02-04 0:19 UTC (permalink / raw)
To: Andrew Morton, Johannes Weiner
Cc: Sergey Senozhatsky, Vladimir Davydov, Michal Hocko,
cgroups-u79uwXL29TY76Z2rM5mHXA, linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Sergey Senozhatsky
On (02/03/16 17:02), Johannes Weiner wrote:
> 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.
Thanks!
-ss
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2016-02-04 0:19 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 9:58 [PATCH] mm/workingset: do not forget to unlock page Sergey Senozhatsky
2016-02-03 9:58 ` Sergey Senozhatsky
2016-02-03 10:41 ` Sergey Senozhatsky
2016-02-03 10:41 ` Sergey Senozhatsky
2016-02-03 10:41 ` Sergey Senozhatsky
2016-02-03 16:24 ` Johannes Weiner
2016-02-03 16:24 ` Johannes Weiner
2016-02-03 21:19 ` Andrew Morton
2016-02-03 21:19 ` Andrew Morton
2016-02-03 21:19 ` Andrew Morton
2016-02-03 22:02 ` Johannes Weiner
2016-02-03 22:02 ` Johannes Weiner
2016-02-03 22:02 ` Johannes Weiner
2016-02-04 0:19 ` Sergey Senozhatsky
2016-02-04 0:19 ` Sergey Senozhatsky
2016-02-04 0:19 ` Sergey Senozhatsky
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.