From: Yafang Shao <laoar.shao@gmail.com>
To: Hillf Danton <hdanton@sina.com>
Cc: Adric Blake <promarbler14@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@suse.com>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
Yang Shi <yang.shi@linux.alibaba.com>,
Mel Gorman <mgorman@techsingularity.net>,
Linux MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: WARNINGs in set_task_reclaim_state with memory cgroup andfullmemory usage
Date: Tue, 27 Aug 2019 19:51:23 +0800 [thread overview]
Message-ID: <CALOAHbAuY9BnpX6x4KSNURbzybjn5UdSNL7-1Li3R0HSQBqiGQ@mail.gmail.com> (raw)
In-Reply-To: <20190824130516.2540-1-hdanton@sina.com>
On Sat, Aug 24, 2019 at 9:05 PM Hillf Danton <hdanton@sina.com> wrote:
>
>
> On Sat, 24 Aug 2019 16:15:38 +0800 Yafang Shao wrote:
> >
> > The memcg soft reclaim is called from kswapd reclam path and direct
> > reclaim path,
> > so why not pass the scan_control from the callsite in these two
> > reclaim paths and use it in memcg soft reclaim ?
> > Seems there's no specially reason that we must introduce a new
> > scan_control here.
> >
> To protect memcg from being over reclaimed?
Not only this, but also makes the reclaim path more clear.
> Victim memcg is selected one after another in a fair way, and punished
> by reclaiming one memcg a round no more than nr_to_reclaim ==
> SWAP_CLUSTER_MAX pages. And so is the flip-flop from global to memcg
> reclaiming. We can see similar protection activities in
> commit a394cb8ee632 ("memcg,vmscan: do not break out targeted reclaim
> without reclaimed pages") and
> commit 2bb0f34fe3c1 ("mm: vmscan: do not iterate all mem cgroups for
> global direct reclaim").
>
> No preference seems in either way except for retaining
> nr_to_reclaim == SWAP_CLUSTER_MAX and target_mem_cgroup == memcg.
Setting target_mem_cgroup here may be a very subtle change for
subsequent processing.
Regarding retraining nr_to_reclaim == SWAP_CLUSTER_MAX, it may not
proper for direct reclaim, that may cause some stall if we iterate all
memcgs here.
> >
> > I have checked the hisotry why this order check is introduced here.
> > The first commit is 4e41695356fb ("memory controller: soft limit
> > reclaim on contention"),
> > but it didn't explained why.
> > At the first glance it is reasonable to remove it, but we should
> > understand why it was introduced at the first place.
>
> Reclaiming order can not make much sense in soft-limit reclaiming
> under the current protection.
>
> Thanks to Adric Blake again.
>
> Hillf
>
next prev parent reply other threads:[~2019-08-27 11:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-24 13:05 Hillf Danton
2019-08-27 11:51 ` Yafang Shao [this message]
2019-08-27 13:29 ` WARNINGs in set_task_reclaim_state with memory cgroupandfullmemory usage Hillf Danton
2019-08-27 13:53 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALOAHbAuY9BnpX6x4KSNURbzybjn5UdSNL7-1Li3R0HSQBqiGQ@mail.gmail.com \
--to=laoar.shao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.m.jordan@oracle.com \
--cc=hannes@cmpxchg.org \
--cc=hdanton@sina.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@suse.com \
--cc=promarbler14@gmail.com \
--cc=yang.shi@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox