[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190418180510.GB11008@tower.DHCP.thefacebook.com>
Date: Thu, 18 Apr 2019 18:05:15 +0000
From: Roman Gushchin <guro@...com>
To: Christopher Lameter <cl@...ux.com>
CC: Roman Gushchin <guroan@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Kernel Team <Kernel-team@...com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Rik van Riel <riel@...riel.com>,
"david@...morbit.com" <david@...morbit.com>,
Pekka Enberg <penberg@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
"cgroups@...r.kernel.org" <cgroups@...r.kernel.org>
Subject: Re: [PATCH 4/5] mm: rework non-root kmem_cache lifecycle management
On Thu, Apr 18, 2019 at 01:38:44PM +0000, Christopher Lameter wrote:
> On Wed, 17 Apr 2019, Roman Gushchin wrote:
>
> > static __always_inline int memcg_charge_slab(struct page *page,
> > gfp_t gfp, int order,
> > struct kmem_cache *s)
> > {
> > - if (is_root_cache(s))
> > + int idx = (s->flags & SLAB_RECLAIM_ACCOUNT) ?
> > + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE;
> > + struct mem_cgroup *memcg;
> > + struct lruvec *lruvec;
> > + int ret;
> > +
> > + if (is_root_cache(s)) {
> > + mod_node_page_state(page_pgdat(page), idx, 1 << order);
>
> Hmmm... This is functionality that is not memcg specific being moved into
> a memcg function??? Maybe rename the function to indicate that it is not
> memcg specific and add the proper #ifdefs?
>
> > static __always_inline void memcg_uncharge_slab(struct page *page, int order,
> > struct kmem_cache *s)
> > {
> > - memcg_kmem_uncharge(page, order);
> > + int idx = (s->flags & SLAB_RECLAIM_ACCOUNT) ?
> > + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE;
> > + struct mem_cgroup *memcg;
> > + struct lruvec *lruvec;
> > +
> > + if (is_root_cache(s)) {
> > + mod_node_page_state(page_pgdat(page), idx, -(1 << order));
> > + return;
> > + }
>
> And again.
>
Good point! Will do in v2.
Thanks!
Powered by blists - more mailing lists