From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,vbabka@suse.cz,roman.gushchin@linux.dev,muchun.song@linux.dev,mhocko@kernel.org,kuba@kernel.org,hannes@cmpxchg.org,edumazet@google.com,bigeasy@linutronix.de,ast@kernel.org,shakeel.butt@linux.dev,akpm@linux-foundation.org
Subject: [merged mm-stable] memcg-no-irq-disable-for-memcg-stock-lock.patch removed from -mm tree
Date: Mon, 12 May 2025 23:55:57 -0700 [thread overview]
Message-ID: <20250513065557.95212C4CEED@smtp.kernel.org> (raw)
The quilt patch titled
Subject: memcg: no irq disable for memcg stock lock
has been removed from the -mm tree. Its filename was
memcg-no-irq-disable-for-memcg-stock-lock.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Shakeel Butt <shakeel.butt@linux.dev>
Subject: memcg: no irq disable for memcg stock lock
Date: Tue, 6 May 2025 15:55:33 -0700
There is no need to disable irqs to use memcg per-cpu stock, so let's just
not do that. One consequence of this change is if the kernel while in
task context has the memcg stock lock and that cpu got interrupted. The
memcg charges on that cpu in the irq context will take the slow path of
memcg charging. However that should be super rare and should be fine in
general.
Link: https://lkml.kernel.org/r/20250506225533.2580386-5-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Eric Dumaze <edumazet@google.com>
Cc: Jakub Kacinski <kuba@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memcontrol.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
--- a/mm/memcontrol.c~memcg-no-irq-disable-for-memcg-stock-lock
+++ a/mm/memcontrol.c
@@ -1854,12 +1854,11 @@ static bool consume_stock(struct mem_cgr
{
struct memcg_stock_pcp *stock;
uint8_t stock_pages;
- unsigned long flags;
bool ret = false;
int i;
if (nr_pages > MEMCG_CHARGE_BATCH ||
- !local_trylock_irqsave(&memcg_stock.lock, flags))
+ !local_trylock(&memcg_stock.lock))
return ret;
stock = this_cpu_ptr(&memcg_stock);
@@ -1876,7 +1875,7 @@ static bool consume_stock(struct mem_cgr
break;
}
- local_unlock_irqrestore(&memcg_stock.lock, flags);
+ local_unlock(&memcg_stock.lock);
return ret;
}
@@ -1920,18 +1919,17 @@ static void drain_stock_fully(struct mem
static void drain_local_memcg_stock(struct work_struct *dummy)
{
struct memcg_stock_pcp *stock;
- unsigned long flags;
if (WARN_ONCE(!in_task(), "drain in non-task context"))
return;
- local_lock_irqsave(&memcg_stock.lock, flags);
+ local_lock(&memcg_stock.lock);
stock = this_cpu_ptr(&memcg_stock);
drain_stock_fully(stock);
clear_bit(FLUSHING_CACHED_CHARGE, &stock->flags);
- local_unlock_irqrestore(&memcg_stock.lock, flags);
+ local_unlock(&memcg_stock.lock);
}
static void drain_local_obj_stock(struct work_struct *dummy)
@@ -1956,7 +1954,6 @@ static void refill_stock(struct mem_cgro
struct memcg_stock_pcp *stock;
struct mem_cgroup *cached;
uint8_t stock_pages;
- unsigned long flags;
bool success = false;
int empty_slot = -1;
int i;
@@ -1971,7 +1968,7 @@ static void refill_stock(struct mem_cgro
VM_WARN_ON_ONCE(mem_cgroup_is_root(memcg));
if (nr_pages > MEMCG_CHARGE_BATCH ||
- !local_trylock_irqsave(&memcg_stock.lock, flags)) {
+ !local_trylock(&memcg_stock.lock)) {
/*
* In case of larger than batch refill or unlikely failure to
* lock the percpu memcg_stock.lock, uncharge memcg directly.
@@ -2006,7 +2003,7 @@ static void refill_stock(struct mem_cgro
WRITE_ONCE(stock->nr_pages[i], nr_pages);
}
- local_unlock_irqrestore(&memcg_stock.lock, flags);
+ local_unlock(&memcg_stock.lock);
}
static bool is_memcg_drain_needed(struct memcg_stock_pcp *stock,
_
Patches currently in -mm which might be from shakeel.butt@linux.dev are
reply other threads:[~2025-05-13 6:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250513065557.95212C4CEED@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=ast@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=edumazet@google.com \
--cc=hannes@cmpxchg.org \
--cc=kuba@kernel.org \
--cc=mhocko@kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=vbabka@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.