linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: shakeel.butt@linux.dev
To: "Johannes Weiner" <hannes@cmpxchg.org>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	"Michal Hocko" <mhocko@kernel.org>,
	"Roman Gushchin" <roman.gushchin@linux.dev>,
	"Muchun Song" <muchun.song@linux.dev>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] memcg: simple cleanup of stats update functions
Date: Sat, 20 Apr 2024 17:25:04 +0000	[thread overview]
Message-ID: <e42db54b94ebf8ca3ee14bb41850184750d2b23c@linux.dev> (raw)
In-Reply-To: <20240420132326.GE1055428@cmpxchg.org>

April 20, 2024 at 6:23 AM, "Johannes Weiner" <hannes@cmpxchg.org> wrote:



> 
> Hi Shakeel,
> 
> On Fri, Apr 19, 2024 at 04:39:49PM -0700, Shakeel Butt wrote:
> 
> > 
> > @@ -2983,10 +2984,6 @@ void mem_cgroup_commit_charge(struct folio *folio, struct mem_cgroup *memcg)
> > 
> >  
> > 
> >  #ifdef CONFIG_MEMCG_KMEM
> > 
> >  
> > 
> >  -/*
> > 
> >  - * mod_objcg_mlstate() may be called with irq enabled, so
> > 
> >  - * mod_memcg_lruvec_state() should be used.
> > 
> >  - */
> > 
> >  static inline void mod_objcg_mlstate(struct obj_cgroup *objcg,
> > 
> >  struct pglist_data *pgdat,
> > 
> >  enum node_stat_item idx, int nr)
> > 
> >  @@ -2994,10 +2991,12 @@ static inline void mod_objcg_mlstate(struct obj_cgroup *objcg,
> > 
> >  struct mem_cgroup *memcg;
> > 
> >  struct lruvec *lruvec;
> > 
> >  
> > 
> >  + lockdep_assert_irqs_disabled();
> > 
> >  +
> > 
> >  rcu_read_lock();
> > 
> >  memcg = obj_cgroup_memcg(objcg);
> > 
> >  lruvec = mem_cgroup_lruvec(memcg, pgdat);
> > 
> >  - mod_memcg_lruvec_state(lruvec, idx, nr);
> > 
> >  + __mod_memcg_lruvec_state(lruvec, idx, nr);
> > 
> >  rcu_read_unlock();
> > 
> >  }
> > 
> 
> Best to rename it to __mod_objcg_mlstate() as well to follow the
> 
> naming pattern for whether caller or callee handles IRQ toggling?

Will do shortly in v2.

> 
> Otherwise, looks great to me!
> 
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Thanks a lot.


      reply	other threads:[~2024-04-20 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 23:39 Shakeel Butt
2024-04-20 13:23 ` Johannes Weiner
2024-04-20 17:25   ` shakeel.butt [this message]

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=e42db54b94ebf8ca3ee14bb41850184750d2b23c@linux.dev \
    --to=shakeel.butt@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    /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