* [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg
@ 2015-09-18 12:48 Vladimir Davydov
2015-09-18 13:30 ` Tejun Heo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Davydov @ 2015-09-18 12:48 UTC (permalink / raw)
To: Andrew Morton
Cc: Michal Hocko, Johannes Weiner, Tejun Heo, linux-mm, linux-kernel
The sane_reclaim() helper is supposed to return false for memcg reclaim
if the legacy hierarchy is used, because the latter lacks dirty
throttling mechanism, and so it did before it was accidentally broken by
commit 33398cf2f360c ("memcg: export struct mem_cgroup"). Fix it.
Fixes: 33398cf2f360c ("memcg: export struct mem_cgroup")
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index db5339dd4a32..dbc3b3ae48de 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -175,7 +175,7 @@ static bool sane_reclaim(struct scan_control *sc)
if (!memcg)
return true;
#ifdef CONFIG_CGROUP_WRITEBACK
- if (memcg->css.cgroup)
+ if (cgroup_on_dfl(memcg->css.cgroup))
return true;
#endif
return false;
--
2.1.4
--
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] 4+ messages in thread
* Re: [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg
2015-09-18 12:48 [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg Vladimir Davydov
@ 2015-09-18 13:30 ` Tejun Heo
2015-09-18 14:08 ` Michal Hocko
2015-09-18 15:59 ` Tejun Heo
2 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2015-09-18 13:30 UTC (permalink / raw)
To: Vladimir Davydov
Cc: Andrew Morton, Michal Hocko, Johannes Weiner, linux-mm, linux-kernel
On Fri, Sep 18, 2015 at 03:48:00PM +0300, Vladimir Davydov wrote:
> The sane_reclaim() helper is supposed to return false for memcg reclaim
> if the legacy hierarchy is used, because the latter lacks dirty
> throttling mechanism, and so it did before it was accidentally broken by
> commit 33398cf2f360c ("memcg: export struct mem_cgroup"). Fix it.
>
> Fixes: 33398cf2f360c ("memcg: export struct mem_cgroup")
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
--
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] 4+ messages in thread
* Re: [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg
2015-09-18 12:48 [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg Vladimir Davydov
2015-09-18 13:30 ` Tejun Heo
@ 2015-09-18 14:08 ` Michal Hocko
2015-09-18 15:59 ` Tejun Heo
2 siblings, 0 replies; 4+ messages in thread
From: Michal Hocko @ 2015-09-18 14:08 UTC (permalink / raw)
To: Vladimir Davydov
Cc: Andrew Morton, Johannes Weiner, Tejun Heo, linux-mm, linux-kernel
On Fri 18-09-15 15:48:00, Vladimir Davydov wrote:
> The sane_reclaim() helper is supposed to return false for memcg reclaim
> if the legacy hierarchy is used, because the latter lacks dirty
> throttling mechanism, and so it did before it was accidentally broken by
> commit 33398cf2f360c ("memcg: export struct mem_cgroup"). Fix it.
>
> Fixes: 33398cf2f360c ("memcg: export struct mem_cgroup")
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Thanks for catching this up!
> ---
> mm/vmscan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index db5339dd4a32..dbc3b3ae48de 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -175,7 +175,7 @@ static bool sane_reclaim(struct scan_control *sc)
> if (!memcg)
> return true;
> #ifdef CONFIG_CGROUP_WRITEBACK
> - if (memcg->css.cgroup)
> + if (cgroup_on_dfl(memcg->css.cgroup))
> return true;
> #endif
> return false;
> --
> 2.1.4
--
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] 4+ messages in thread
* Re: [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg
2015-09-18 12:48 [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg Vladimir Davydov
2015-09-18 13:30 ` Tejun Heo
2015-09-18 14:08 ` Michal Hocko
@ 2015-09-18 15:59 ` Tejun Heo
2 siblings, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2015-09-18 15:59 UTC (permalink / raw)
To: Vladimir Davydov
Cc: Andrew Morton, Michal Hocko, Johannes Weiner, linux-mm, linux-kernel
Hello,
On Fri, Sep 18, 2015 at 03:48:00PM +0300, Vladimir Davydov wrote:
> The sane_reclaim() helper is supposed to return false for memcg reclaim
> if the legacy hierarchy is used, because the latter lacks dirty
> throttling mechanism, and so it did before it was accidentally broken by
> commit 33398cf2f360c ("memcg: export struct mem_cgroup"). Fix it.
>
> Fixes: 33398cf2f360c ("memcg: export struct mem_cgroup")
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
> ---
> mm/vmscan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index db5339dd4a32..dbc3b3ae48de 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -175,7 +175,7 @@ static bool sane_reclaim(struct scan_control *sc)
> if (!memcg)
> return true;
> #ifdef CONFIG_CGROUP_WRITEBACK
> - if (memcg->css.cgroup)
> + if (cgroup_on_dfl(memcg->css.cgroup))
Just a heads-up. I'm applying a patch which replaces cgroup_on_dfl()
with cgroup_subsys_on_dfl() to cgroup/for-4.4, so this patch would
need to be adjusted to do cgroup_subsys_on_dfl(memory_cgrp_subsys)
instead.
Thanks.
--
tejun
--
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] 4+ messages in thread
end of thread, other threads:[~2015-09-18 15:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18 12:48 [PATCH -mm] vmscan: fix sane_reclaim helper for legacy memcg Vladimir Davydov
2015-09-18 13:30 ` Tejun Heo
2015-09-18 14:08 ` Michal Hocko
2015-09-18 15:59 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox