[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lr7pg6kxj2rggwaj6pwoca63uvdbqhiphs4hhva4f2pjsfqnwb@7a3ackqh2l66>
Date: Fri, 14 Mar 2025 08:33:13 -0700
From: Shakeel Butt <shakeel.butt@...ux.dev>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, Muchun Song <muchun.song@...ux.dev>,
Vlastimil Babka <vbabka@...e.cz>, linux-mm@...ck.org, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, Meta kernel team <kernel-team@...a.com>
Subject: Re: [RFC PATCH 09/10] memcg: trylock stock for objcg
On Fri, Mar 14, 2025 at 12:47:00PM +0100, Sebastian Andrzej Siewior wrote:
> On 2025-03-13 23:15:10 [-0700], Shakeel Butt wrote:
> > To make objcg stock functions work without disabling irq, we need to
> > convert those function to use localtry_trylock_irqsave() instead of
> > localtry_lock_irqsave(). This patch for now just does the conversion and
> > later patch will eliminate the irq disabling code.
> >
> > Signed-off-by: Shakeel Butt <shakeel.butt@...ux.dev>
> > ---
> > mm/memcontrol.c | 14 +++++++++++---
> > 1 file changed, 11 insertions(+), 3 deletions(-)
> >
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index c803d2f5e322..ba5d004049d3 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -2764,7 +2764,11 @@ static void mod_objcg_state(struct obj_cgroup *objcg, struct pglist_data *pgdat,
> > unsigned long flags;
> > int *bytes;
> >
> > - localtry_lock_irqsave(&memcg_stock.stock_lock, flags);
> > + if (!localtry_trylock_irqsave(&memcg_stock.stock_lock, flags)) {
>
> Don't you need to change the of memcg_stock.stock_lock? Didn't we
> introduce an explicit different type for this trylock feature?
>
Yes, Alexei has already changed the type of this exact lock at [1].
[1] https://lore.kernel.org/r/20250222024427.30294-5-alexei.starovoitov@gmail.com
Powered by blists - more mailing lists