public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>
To: Wei Yang <richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org,
	hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org,
	vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [Patch v2 3/3] mm/memcg: add next_mz back to soft limit tree if not reclaimed yet
Date: Tue, 15 Mar 2022 09:54:34 +0100	[thread overview]
Message-ID: <YjBUSqh07BIfxbl5@dhcp22.suse.cz> (raw)
In-Reply-To: <20220314230548.wo4colcwqxhhf3mx@master>

On Mon 14-03-22 23:05:48, Wei Yang wrote:
> On Mon, Mar 14, 2022 at 10:41:13AM +0100, Michal Hocko wrote:
> >On Sat 12-03-22 07:16:23, Wei Yang wrote:
> >> When memory reclaim failed for a maximum number of attempts and we bail
> >> out of the reclaim loop, we forgot to put the target mem_cgroup chosen
> >> for next reclaim back to the soft limit tree. This prevented pages in
> >> the mem_cgroup from being reclaimed in the future even though the
> >> mem_cgroup exceeded its soft limit.
> >> 
> >> Let's say there are two mem_cgroup and both of them exceed the soft
> >> limit, while the first one is more active then the second. Since we add
> >> a mem_cgroup to soft limit tree every 1024 event, the second one just
> >> get a rare chance to be put on soft limit tree even it exceeds the
> >> limit.
> >
> >yes, 1024 could be just 4MB of memory or 2GB if all the charged pages
> >are THPs. So the excess can build up considerably.
> >
> >> As time goes on, the first mem_cgroup was kept close to its soft limit
> >> due to reclaim activities, while the memory usage of the second
> >> mem_cgroup keeps growing over the soft limit for a long time due to its
> >> relatively rare occurrence.
> >> 
> >> This patch adds next_mz back to prevent this sceanrio.
> >> 
> >> Signed-off-by: Wei Yang <richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >
> >Even though your changelog is different the change itself is identical to
> >https://lore.kernel.org/linux-mm/8d35206601ccf0e1fe021d24405b2a0c2f4e052f.1613584277.git.tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org/
> >In those cases I would preserve the the original authorship by
> >From: Tim Chen <tim.c.chen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
> >and add his s-o-b before yours.
> 
> TBH I don't think this is fair.
> 
> I didn't see his original change before I sent this patch. This is a
> coincidence we found the same point for improvement.
> 
> It hurts me if you want to change authorship. Well, if you really thinks this
> is what it should be, please remove my s-o-b.

OK, fair enough.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2022-03-15  8:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-12  7:16 [Patch v2 1/3] mm/memcg: mz already removed from rb_tree in mem_cgroup_largest_soft_limit_node() Wei Yang
     [not found] ` <20220312071623.19050-1-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-03-12  7:16   ` [Patch v2 2/3] mm/memcg: __mem_cgroup_remove_exceeded could handle a !on-tree mz properly Wei Yang
     [not found]     ` <20220312071623.19050-2-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-03-14  9:54       ` Michal Hocko
     [not found]         ` <Yi8Qu/1V4H1M9qZV-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-03-14 22:51           ` Wei Yang
2022-03-15  8:52             ` Michal Hocko
     [not found]               ` <YjBT6emPlZD1lg5z-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-03-15 23:54                 ` Wei Yang
2022-03-12  7:16   ` [Patch v2 3/3] mm/memcg: add next_mz back to soft limit tree if not reclaimed yet Wei Yang
     [not found]     ` <20220312071623.19050-3-richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2022-03-14  9:41       ` Michal Hocko
     [not found]         ` <Yi8NudEX/sZsO2nO-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-03-14 23:05           ` Wei Yang
2022-03-15  8:54             ` Michal Hocko [this message]
2022-03-14  9:51   ` [Patch v2 1/3] mm/memcg: mz already removed from rb_tree in mem_cgroup_largest_soft_limit_node() Michal Hocko
     [not found]     ` <Yi8QN+5oeUWWJQNv-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-03-14 23:21       ` Wei Yang

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=YjBUSqh07BIfxbl5@dhcp22.suse.cz \
    --to=mhocko-ibi9rg/b67k@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=richard.weiyang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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