lkml.org 
[lkml]   [2019]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 4/5] mm: rework non-root kmem_cache lifecycle management
Date
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!

\
 
 \ /
  Last update: 2019-04-18 20:26    [W:0.139 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site