[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191022214249.GB361040@cmpxchg.org>
Date: Tue, 22 Oct 2019 17:42:49 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Roman Gushchin <guro@...com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kernel Team <Kernel-team@...com>
Subject: Re: [PATCH 5/8] mm: vmscan: replace shrink_node() loop with a retry
jump
On Tue, Oct 22, 2019 at 07:56:33PM +0000, Roman Gushchin wrote:
> On Tue, Oct 22, 2019 at 10:48:00AM -0400, Johannes Weiner wrote:
> > - /* Record the group's reclaim efficiency */
> > - vmpressure(sc->gfp_mask, memcg, false,
> > - sc->nr_scanned - scanned,
> > - sc->nr_reclaimed - reclaimed);
> > -
> > - } while ((memcg = mem_cgroup_iter(root, memcg, NULL)));
> > + reclaimed = sc->nr_reclaimed;
> > + scanned = sc->nr_scanned;
> > + shrink_node_memcg(pgdat, memcg, sc);
> >
> > - if (reclaim_state) {
> > - sc->nr_reclaimed += reclaim_state->reclaimed_slab;
> > - reclaim_state->reclaimed_slab = 0;
> > - }
> > + shrink_slab(sc->gfp_mask, pgdat->node_id, memcg,
> > + sc->priority);
> >
> > - /* Record the subtree's reclaim efficiency */
> > - vmpressure(sc->gfp_mask, sc->target_mem_cgroup, true,
> > - sc->nr_scanned - nr_scanned,
> > - sc->nr_reclaimed - nr_reclaimed);
> > + /* Record the group's reclaim efficiency */
> > + vmpressure(sc->gfp_mask, memcg, false,
> > + sc->nr_scanned - scanned,
> > + sc->nr_reclaimed - reclaimed);
>
> It doesn't look as a trivial change. I'd add some comments to the commit message
> why it's safe to do.
It's an equivalent change - it's just really misleading because the
+++ lines are not the counter-part of the --- lines here!
There are two vmpressure calls in this function: one against the
individual cgroups, and one against the tree. The diff puts them
adjacent here, but the counter-part for the --- lines is here:
> > + /* Record the subtree's reclaim efficiency */
> > + vmpressure(sc->gfp_mask, sc->target_mem_cgroup, true,
> > + sc->nr_scanned - nr_scanned,
> > + sc->nr_reclaimed - nr_reclaimed);
And the counter-part to the +++ lines is further up (beginning of the
quoted diff).
Powered by blists - more mailing lists