* [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs
@ 2017-11-28 16:19 ` Shakeel Butt
0 siblings, 0 replies; 12+ messages in thread
From: Shakeel Butt @ 2017-11-28 16:19 UTC (permalink / raw)
To: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen,
Johannes Weiner, Andrew Morton
Cc: linux-mm, linux-kernel, cgroups, Shakeel Butt, stable
The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout()
support THP") changed mem_cgroup_swapout() to support transparent huge
page (THP). However the patch missed one location which should be
changed for correctly handling THPs. The resulting bug will cause the
memory cgroups whose THPs were swapped out to become zombies on
deletion.
Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP")
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Cc: stable@vger.kernel.org
---
mm/memcontrol.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 50e6906314f8..ac2ffd5e02b9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry)
memcg_check_events(memcg, page);
if (!mem_cgroup_is_root(memcg))
- css_put(&memcg->css);
+ css_put_many(&memcg->css, nr_entries);
}
/**
--
2.15.0.417.g466bffb3ac-goog
--
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] 12+ messages in thread* [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-28 16:19 ` Shakeel Butt 0 siblings, 0 replies; 12+ messages in thread From: Shakeel Butt @ 2017-11-28 16:19 UTC (permalink / raw) To: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Johannes Weiner, Andrew Morton Cc: linux-mm, linux-kernel, cgroups, Shakeel Butt, stable The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") changed mem_cgroup_swapout() to support transparent huge page (THP). However the patch missed one location which should be changed for correctly handling THPs. The resulting bug will cause the memory cgroups whose THPs were swapped out to become zombies on deletion. Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") Signed-off-by: Shakeel Butt <shakeelb@google.com> Cc: stable@vger.kernel.org --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 50e6906314f8..ac2ffd5e02b9 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) memcg_check_events(memcg, page); if (!mem_cgroup_is_root(memcg)) - css_put(&memcg->css); + css_put_many(&memcg->css, nr_entries); } /** -- 2.15.0.417.g466bffb3ac-goog ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs 2017-11-28 16:19 ` Shakeel Butt @ 2017-11-28 20:00 ` Michal Hocko -1 siblings, 0 replies; 12+ messages in thread From: Michal Hocko @ 2017-11-28 20:00 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Greg Thelen, Johannes Weiner, Andrew Morton, linux-mm, linux-kernel, cgroups, stable On Tue 28-11-17 08:19:41, Shakeel Butt wrote: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Very well spotted! Have you seen this triggering or you found it by the code inspection? > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") To be honest I am not really happy how the whole THP swapout thing has been rushed in without a proper review. I am partly guildy for not find time for the proper review but this is not something that really had to be merged without a single ack or reviewed-by. > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org Acked-by: Michal Hocko <mhocko@suse.com> Thanks! > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** > -- > 2.15.0.417.g466bffb3ac-goog -- Michal Hocko SUSE Labs ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-28 20:00 ` Michal Hocko 0 siblings, 0 replies; 12+ messages in thread From: Michal Hocko @ 2017-11-28 20:00 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Greg Thelen, Johannes Weiner, Andrew Morton, linux-mm, linux-kernel, cgroups, stable On Tue 28-11-17 08:19:41, Shakeel Butt wrote: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Very well spotted! Have you seen this triggering or you found it by the code inspection? > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") To be honest I am not really happy how the whole THP swapout thing has been rushed in without a proper review. I am partly guildy for not find time for the proper review but this is not something that really had to be merged without a single ack or reviewed-by. > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org Acked-by: Michal Hocko <mhocko@suse.com> Thanks! > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** > -- > 2.15.0.417.g466bffb3ac-goog -- Michal Hocko SUSE Labs -- 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] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs 2017-11-28 20:00 ` Michal Hocko @ 2017-11-28 20:09 ` Shakeel Butt -1 siblings, 0 replies; 12+ messages in thread From: Shakeel Butt @ 2017-11-28 20:09 UTC (permalink / raw) To: Michal Hocko Cc: Huang Ying, Vladimir Davydov, Greg Thelen, Johannes Weiner, Andrew Morton, Linux MM, LKML, Cgroups, stable On Tue, Nov 28, 2017 at 12:00 PM, Michal Hocko <mhocko@kernel.org> wrote: > On Tue 28-11-17 08:19:41, Shakeel Butt wrote: >> The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() >> support THP") changed mem_cgroup_swapout() to support transparent huge >> page (THP). However the patch missed one location which should be >> changed for correctly handling THPs. The resulting bug will cause the >> memory cgroups whose THPs were swapped out to become zombies on >> deletion. > > Very well spotted! Have you seen this triggering or you found it by the > code inspection? > By code inspection. -- 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] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-28 20:09 ` Shakeel Butt 0 siblings, 0 replies; 12+ messages in thread From: Shakeel Butt @ 2017-11-28 20:09 UTC (permalink / raw) To: Michal Hocko Cc: Huang Ying, Vladimir Davydov, Greg Thelen, Johannes Weiner, Andrew Morton, Linux MM, LKML, Cgroups, stable On Tue, Nov 28, 2017 at 12:00 PM, Michal Hocko <mhocko@kernel.org> wrote: > On Tue 28-11-17 08:19:41, Shakeel Butt wrote: >> The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() >> support THP") changed mem_cgroup_swapout() to support transparent huge >> page (THP). However the patch missed one location which should be >> changed for correctly handling THPs. The resulting bug will cause the >> memory cgroups whose THPs were swapped out to become zombies on >> deletion. > > Very well spotted! Have you seen this triggering or you found it by the > code inspection? > By code inspection. ^ permalink raw reply [flat|nested] 12+ messages in thread
[parent not found: <20171128161941.20931-1-shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs 2017-11-28 16:19 ` Shakeel Butt (?) (?) @ 2017-11-29 0:38 ` Huang, Ying -1 siblings, 0 replies; 12+ messages in thread From: Huang, Ying @ 2017-11-29 0:38 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Johannes Weiner, Andrew Morton, linux-mm-Bw31MaZKKs3YtjvyW6yDsg, linux-kernel-u79uwXL29TY76Z2rM5mHXA, cgroups-u79uwXL29TY76Z2rM5mHXA, stable-u79uwXL29TY76Z2rM5mHXA Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> writes: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Good catch! Thanks a lot for fixing! Best Regards, Huang, Ying > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") > Signed-off-by: Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> > Cc: stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-29 0:38 ` Huang, Ying 0 siblings, 0 replies; 12+ messages in thread From: Huang, Ying @ 2017-11-29 0:38 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Johannes Weiner, Andrew Morton, linux-mm, linux-kernel, cgroups, stable Shakeel Butt <shakeelb@google.com> writes: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Good catch! Thanks a lot for fixing! Best Regards, Huang, Ying > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** -- 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] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-29 0:38 ` Huang, Ying 0 siblings, 0 replies; 12+ messages in thread From: Huang, Ying @ 2017-11-29 0:38 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Johannes Weiner, Andrew Morton, linux-mm, linux-kernel, cgroups, stable Shakeel Butt <shakeelb@google.com> writes: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Good catch! Thanks a lot for fixing! Best Regards, Huang, Ying > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-29 0:38 ` Huang, Ying 0 siblings, 0 replies; 12+ messages in thread From: Huang, Ying @ 2017-11-29 0:38 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Johannes Weiner, Andrew Morton, linux-mm, linux-kernel, cgroups, stable Shakeel Butt <shakeelb@google.com> writes: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. Good catch! Thanks a lot for fixing! Best Regards, Huang, Ying > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org > --- > mm/memcontrol.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 50e6906314f8..ac2ffd5e02b9 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -6044,7 +6044,7 @@ void mem_cgroup_swapout(struct page *page, swp_entry_t entry) > memcg_check_events(memcg, page); > > if (!mem_cgroup_is_root(memcg)) > - css_put(&memcg->css); > + css_put_many(&memcg->css, nr_entries); > } > > /** -- 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] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs 2017-11-28 16:19 ` Shakeel Butt @ 2017-11-29 10:17 ` Johannes Weiner -1 siblings, 0 replies; 12+ messages in thread From: Johannes Weiner @ 2017-11-29 10:17 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Andrew Morton, linux-mm, linux-kernel, cgroups, stable On Tue, Nov 28, 2017 at 08:19:41AM -0800, Shakeel Butt wrote: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. > > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org Acked-by: Johannes Weiner <hannes@cmpxchg.org> -- 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] 12+ messages in thread
* Re: [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs @ 2017-11-29 10:17 ` Johannes Weiner 0 siblings, 0 replies; 12+ messages in thread From: Johannes Weiner @ 2017-11-29 10:17 UTC (permalink / raw) To: Shakeel Butt Cc: Huang Ying, Vladimir Davydov, Michal Hocko, Greg Thelen, Andrew Morton, linux-mm, linux-kernel, cgroups, stable On Tue, Nov 28, 2017 at 08:19:41AM -0800, Shakeel Butt wrote: > The commit d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() > support THP") changed mem_cgroup_swapout() to support transparent huge > page (THP). However the patch missed one location which should be > changed for correctly handling THPs. The resulting bug will cause the > memory cgroups whose THPs were swapped out to become zombies on > deletion. > > Fixes: d6810d730022 ("memcg, THP, swap: make mem_cgroup_swapout() support THP") > Signed-off-by: Shakeel Butt <shakeelb@google.com> > Cc: stable@vger.kernel.org Acked-by: Johannes Weiner <hannes@cmpxchg.org> ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2017-11-29 10:17 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-28 16:19 [PATCH] mm, memcg: fix mem_cgroup_swapout() for THPs Shakeel Butt
2017-11-28 16:19 ` Shakeel Butt
2017-11-28 20:00 ` Michal Hocko
2017-11-28 20:00 ` Michal Hocko
2017-11-28 20:09 ` Shakeel Butt
2017-11-28 20:09 ` Shakeel Butt
[not found] ` <20171128161941.20931-1-shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-11-29 0:38 ` Huang, Ying
2017-11-29 0:38 ` Huang, Ying
2017-11-29 0:38 ` Huang, Ying
2017-11-29 0:38 ` Huang, Ying
2017-11-29 10:17 ` Johannes Weiner
2017-11-29 10:17 ` Johannes Weiner
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.