linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zhaoyang Huang <huangzhaoyang@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.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: [PATCH] mm: skip current when memcg reclaim
Date: Sat, 16 Oct 2021 10:28:54 +0800	[thread overview]
Message-ID: <CAGWkznGt=9HznGA6R15z=QVZmnk9rGvQ77gN_G9UZk-XqzpF1g@mail.gmail.com> (raw)
In-Reply-To: <20211015130035.aacc18a4d1ee141b306c2272@linux-foundation.org>

On Sat, Oct 16, 2021 at 4:00 AM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Fri, 15 Oct 2021 14:15:29 +0800 Huangzhaoyang <huangzhaoyang@gmail.com> wrote:
>
> > From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
> >
> > Sibling thread of the same process could refault the reclaimed pages
> > in the same time, which would be typical in None global reclaim and
> > introduce thrashing.
>
> "None" -> "node", I assume?
>
> > --- a/mm/vmscan.c
> > +++ b/mm/vmscan.c
> > @@ -2841,6 +2841,11 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
> >                               sc->memcg_low_skipped = 1;
> >                               continue;
> >                       }
> > +                     /*
> > +                      * Don't bother current when its memcg is below low
> > +                      */
>
> The comment explains what the code is doing, but the code itself
> already does this.  Please can we have a comment that explains *why*
> the code is doing this?
We find that the patch help direct reclaiming bail out early and
eliminate page thrashing for some scenarios(etc APP start on android).
The case could be worse if each APP possess a unique memcg(pages on
current's lru are reclaimed more than global reclaim)
>
>
> > +                     if (get_mem_cgroup_from_mm(current->mm) == memcg)
> > +                             continue;
> >                       memcg_memory_event(memcg, MEMCG_LOW);
> >               }
>


  reply	other threads:[~2021-10-16  2:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-15  6:15 [PATCH] mm: skip current when memcg reclaim Huangzhaoyang
2021-10-15 20:00 ` Andrew Morton
2021-10-16  2:28   ` Zhaoyang Huang [this message]
2021-10-16  2:58     ` Andrew Morton
2021-10-16  3:05   ` Matthew Wilcox
2021-10-16  8:17     ` Zhaoyang Huang
2021-10-18  8:23 ` Michal Hocko
2021-10-18  9:25   ` Zhaoyang Huang
2021-10-18 12:41     ` Michal Hocko
2021-10-19  7:11       ` Zhaoyang Huang
2021-10-19  9:09         ` Michal Hocko
2021-10-19 12:17           ` Zhaoyang Huang
2021-10-19 13:23             ` Michal Hocko
2021-10-20  7:33               ` Zhaoyang Huang
2021-10-20  8:55                 ` Michal Hocko
2021-10-20 11:45                   ` Zhaoyang Huang
2021-10-20 15:11                     ` 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='CAGWkznGt=9HznGA6R15z=QVZmnk9rGvQ77gN_G9UZk-XqzpF1g@mail.gmail.com' \
    --to=huangzhaoyang@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --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).