linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: Chris Down <chris@chrisdown.name>, Vlastimil Babka <vbabka@suse.cz>
Cc: <linux-mm@kvack.org>, Andrew Morton <akpm@linux-foundation.org>,
	"Muchun Song" <songmuchun@bytedance.com>,
	Michal Hocko <mhocko@kernel.org>,
	"Matthew Wilcox" <willy@infradead.org>,
	Chunxin Zang <zangchunxin@bytedance.com>
Subject: Re: [PATCH] mm, vmscan: guarantee drop_slab_node() termination
Date: Thu, 19 Aug 2021 10:55:38 +0800	[thread overview]
Message-ID: <c35102da-245c-983a-98eb-65b6e25ad73e@huawei.com> (raw)
In-Reply-To: <YR2ARISBFq8O6tSN@chrisdown.name>


On 2021/8/19 5:48, Chris Down wrote:
> Vlastimil Babka writes:
>> @@ -948,7 +949,7 @@ void drop_slab_node(int nid)
>>         do {
>>             freed += shrink_slab(GFP_KERNEL, nid, memcg, 0);
>>         } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL);
>> -    } while (freed > 10);
>> +    } while ((freed >> shift++) > 0);
>
> I think this is a good idea, thanks for bringing it up :-)
>
> I'm not sure about the bitshift idea, though. It certainly makes sure 
> that even large, continuous periods of reclaim eventually terminates, 
> but I find it hard to reason about -- for example, if there's a lot of 
> parallel activity, that might result in 10 constantly reintroduced 
> pages, or 1000 pages, and it's not immediately obvious that we should 
> treat those differently.
>
> What about using MAX_RECLAIM_RETRIES? There's already precedent for 
> using it in non-OOM scenarios, like mem_cgroup_handle_over_high.

Yes, we meet this issue too, and we add a max loop limit in 
drop_slab_node() in our kernel, which also could be reconfigured by 
sysctl ;)

>
> .
>


  reply	other threads:[~2021-08-19  2:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-18 15:22 Vlastimil Babka
2021-08-18 21:48 ` Chris Down
2021-08-19  2:55   ` Kefeng Wang [this message]
2021-08-19  7:01     ` Vlastimil Babka
2021-08-19  9:38       ` Kefeng Wang
2021-08-19 13:21       ` Chris Down
2021-08-19 14:16         ` Michal Hocko
2021-08-24  9:33           ` Vlastimil Babka
2021-08-24 10:02 ` Matthew Wilcox
2021-08-24 14:04   ` Vlastimil Babka

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=c35102da-245c-983a-98eb-65b6e25ad73e@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chrisdown.name \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=songmuchun@bytedance.com \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    --cc=zangchunxin@bytedance.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