[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250410220618.405d00875ca61043c4ffa6e1@linux-foundation.org>
Date: Thu, 10 Apr 2025 22:06:18 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Shakeel Butt <shakeel.butt@...ux.dev>
Cc: Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...nel.org>,
Roman Gushchin <roman.gushchin@...ux.dev>, Muchun Song
<muchun.song@...ux.dev>, Yosry Ahmed <yosry.ahmed@...ux.dev>, Waiman Long
<llong@...hat.com>, 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: [PATCH] memcg: decouple memcg_hotplug_cpu_dead from stock_lock
On Thu, 10 Apr 2025 14:06:23 -0700 Shakeel Butt <shakeel.butt@...ux.dev> wrote:
> The function memcg_hotplug_cpu_dead works on the stock of a remote dead
> CPU and drain_obj_stock works on the given stock instead of local stock,
> so there is no need to take local stock_lock anymore.
>
> @@ -1964,10 +1964,10 @@ static int memcg_hotplug_cpu_dead(unsigned int cpu)
>
> stock = &per_cpu(memcg_stock, cpu);
>
> - /* drain_obj_stock requires stock_lock */
> - local_lock_irqsave(&memcg_stock.stock_lock, flags);
> - drain_obj_stock(stock);
> - local_unlock_irqrestore(&memcg_stock.stock_lock, flags);
> + local_irq_save(flag);
> + /* stock of a remote dead cpu, no need for stock_lock. */
> + __drain_obj_stock(stock);
> + local_irq_restore(flag);
>
s/flag/flags/
Obviously what-i-got isn't what-you-tested. Please check what happened
here,
Powered by blists - more mailing lists