linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chris Down <chris@chrisdown.name>
To: Zhaoyang Huang <huangzhaoyang@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Zhaoyang Huang <zhaoyang.huang@unisoc.com>,
	"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg
Date: Thu, 28 Oct 2021 03:04:28 +0100	[thread overview]
Message-ID: <YXoFLAGzihy20P+l@chrisdown.name> (raw)
In-Reply-To: <CAGWkznGp8Z9F8wK5UN+1Z-5NwQjZ+okpVfnq9-Gzv38xHPEDrQ@mail.gmail.com>

Zhaoyang Huang writes:
>On Wed, Oct 27, 2021 at 8:31 PM Michal Hocko <mhocko@suse.com> wrote:
>>
>> On Wed 27-10-21 20:05:30, Zhaoyang Huang wrote:
>> > On Wed, Oct 27, 2021 at 7:52 PM Michal Hocko <mhocko@suse.com> wrote:
>> > >
>> > > On Wed 27-10-21 17:19:56, Zhaoyang Huang wrote:
>> > > > On Wed, Oct 27, 2021 at 4:26 PM Michal Hocko <mhocko@suse.com> wrote:
>> > > > >
>> > > > > On Wed 27-10-21 15:46:19, Zhaoyang Huang wrote:
>> > > > > > On Wed, Oct 27, 2021 at 3:20 PM Michal Hocko <mhocko@suse.com> wrote:
>> > > > > > >
>> > > > > > > On Wed 27-10-21 15:01:50, Huangzhaoyang wrote:
>> > > > > > > > From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>> > > > > > > >
>> > > > > > > > For the kswapd only reclaiming, there is no chance to try again on
>> > > > > > > > this group while direct reclaim has. fix it by judging gfp flag.
>> > > > > > >
>> > > > > > > There is no problem description (same as in your last submissions. Have
>> > > > > > > you looked at the patch submission documentation as recommended
>> > > > > > > previously?).
>> > > > > > >
>> > > > > > > Also this patch doesn't make any sense. Both direct reclaim and kswapd
>> > > > > > > use a gfp mask which contains __GFP_DIRECT_RECLAIM (see balance_pgdat
>> > > > > > > for the kswapd part)..
>> > > > > > ok, but how does the reclaiming try with memcg's min protection on the
>> > > > > > alloc without __GFP_DIRECT_RECLAIM?
>> > > > >
>> > > > > I do not follow. There is no need to protect memcg if the allocation
>> > > > > request doesn't have __GFP_DIRECT_RECLAIM because that would fail the
>> > > > > charge if a hard limit is reached, see try_charge_memcg and
>> > > > > gfpflags_allow_blocking check.
>> > > > >
>> > > > > Background reclaim, on the other hand never breaches reclaim protection.
>> > > > >
>> > > > > What is the actual problem you want to solve?
>> > > > Imagine there is an allocation with gfp_mask & ~GFP_DIRECT_RECLAIM and
>> > > > all processes are under cgroups. Kswapd is the only hope here which
>> > > > however has a low efficiency of get_scan_count. I would like to have
>> > > > kswapd work as direct reclaim in 2nd round which will have
>> > > > protection=memory.min.
>> > >
>> > > Do you have an example where this would be a practical problem? Atomic
>> > > allocations should be rather rare.
>> > Please find below for the search result of '~__GFP_DIRECT_RECLAIM'
>> > which shows some drivers and net prefer to behave like that.
>> > Furthermore, the allocations are always together with high order.
>>
>> And what is the _practical_ problem you are seeing or trying to solve?
>We do have out of tree code behave like this and want to make the
>mechanics more robust

It does one no good to use concepts like "robustness" in an unsubstantiated, 
unmeasured, and unquantified way. Either provide the measurements and tell us 
why we should care about those measurements, or there's very little to discuss.

As it is this is a ten-deep thread where Michal has asked several perfectly 
reasonable questions and has received only a flimsy pastiche of discussion as a 
reply. Please provide tangible, hard data with reasons we should care about it.

With that said, there's no way we're going to change core mm behaviour based on 
the whims of poorly behaved out of tree drivers.


      reply	other threads:[~2021-10-28  2:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27  7:01 [RFC PATCH] mm: have kswapd only reclaiming use min protection on memcg Huangzhaoyang
2021-10-27  7:20 ` Michal Hocko
2021-10-27  7:46   ` Zhaoyang Huang
2021-10-27  8:26     ` Michal Hocko
2021-10-27  9:19       ` Zhaoyang Huang
2021-10-27 11:52         ` Michal Hocko
2021-10-27 12:05           ` Zhaoyang Huang
2021-10-27 12:31             ` Michal Hocko
2021-10-28  0:45               ` Zhaoyang Huang
2021-10-28  2:04                 ` Chris Down [this message]

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=YXoFLAGzihy20P+l@chrisdown.name \
    --to=chris@chrisdown.name \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=huangzhaoyang@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=vdavydov.dev@gmail.com \
    --cc=zhaoyang.huang@unisoc.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;
as well as URLs for NNTP newsgroup(s).