From: Roman Gushchin <guro@fb.com>
To: Christopher Lameter <cl@linux.com>
Cc: Roman Gushchin <guroan@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Kernel Team <Kernel-team@fb.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>, Rik van Riel <riel@surriel.com>,
"david@fromorbit.com" <david@fromorbit.com>,
Pekka Enberg <penberg@kernel.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
"cgroups@vger.kernel.org" <cgroups@vger.kernel.org>
Subject: Re: [PATCH 4/5] mm: rework non-root kmem_cache lifecycle management
Date: Thu, 18 Apr 2019 18:05:15 +0000 [thread overview]
Message-ID: <20190418180510.GB11008@tower.DHCP.thefacebook.com> (raw)
In-Reply-To: <0100016a30abc330-011d895a-b4af-40a9-8937-990297ed4ffd-000000@email.amazonses.com>
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!
next prev parent reply other threads:[~2019-04-18 18:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-17 21:54 [PATCH 0/5] mm: reparent slab memory on cgroup removal Roman Gushchin
2019-04-17 21:54 ` [PATCH 1/5] mm: postpone kmem_cache memcg pointer initialization to memcg_link_cache() Roman Gushchin
2019-04-17 21:54 ` [PATCH 2/5] mm: generalize postponed non-root kmem_cache deactivation Roman Gushchin
2019-04-17 21:54 ` [PATCH 3/5] mm: introduce __memcg_kmem_uncharge_memcg() Roman Gushchin
2019-04-17 21:54 ` [PATCH 4/5] mm: rework non-root kmem_cache lifecycle management Roman Gushchin
2019-04-17 23:41 ` Shakeel Butt
2019-04-18 0:38 ` Roman Gushchin
2019-04-18 1:55 ` Shakeel Butt
2019-04-18 3:07 ` Roman Gushchin
2019-04-18 14:05 ` Shakeel Butt
2019-04-18 18:14 ` Roman Gushchin
2019-04-18 13:34 ` Christopher Lameter
2019-04-18 18:04 ` Roman Gushchin
2019-04-18 13:38 ` Christopher Lameter
2019-04-18 18:05 ` Roman Gushchin [this message]
2019-04-17 21:54 ` [PATCH 5/5] mm: reparent slab memory on cgroup removal Roman Gushchin
2019-04-18 8:15 ` [PATCH 0/5] " Vladimir Davydov
2019-04-18 18:27 ` Roman Gushchin
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=20190418180510.GB11008@tower.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=Kernel-team@fb.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=cl@linux.com \
--cc=david@fromorbit.com \
--cc=guroan@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=penberg@kernel.org \
--cc=riel@surriel.com \
--cc=vdavydov.dev@gmail.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