From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, tj@kernel.org, tglx@linutronix.de,
lizefan.x@bytedance.com, hannes@cmpxchg.org,
bigeasy@linutronix.de, akpm@linux-foundation.org
Subject: + cgroup-use-irqsave-in-cgroup_rstat_flush_locked-fix.patch added to -mm tree
Date: Wed, 02 Mar 2022 14:01:49 -0800 [thread overview]
Message-ID: <20220302220149.BC067C004E1@smtp.kernel.org> (raw)
The patch titled
Subject: cgroup: add a comment to cgroup_rstat_flush_locked().
has been added to the -mm tree. Its filename is
cgroup-use-irqsave-in-cgroup_rstat_flush_locked-fix.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/cgroup-use-irqsave-in-cgroup_rstat_flush_locked-fix.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/cgroup-use-irqsave-in-cgroup_rstat_flush_locked-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: cgroup: add a comment to cgroup_rstat_flush_locked().
Add a comment why spin_lock_irq() -> raw_spin_lock_irqsave() is needed.
Link: https://lkml.kernel.org/r/Yh+DOK73hfVV5ThX@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Zefan Li <lizefan.x@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
kernel/cgroup/rstat.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/kernel/cgroup/rstat.c~cgroup-use-irqsave-in-cgroup_rstat_flush_locked-fix
+++ a/kernel/cgroup/rstat.c
@@ -155,6 +155,14 @@ static void cgroup_rstat_flush_locked(st
struct cgroup *pos = NULL;
unsigned long flags;
+ /*
+ * The _irqsave() is needed because cgroup_rstat_lock is
+ * spinlock_t which is a sleeping lock on PREEMPT_RT. Acquiring
+ * this lock with the _irq() suffix only disables interrupts on
+ * a non-PREEMPT_RT kernel. The raw_spinlock_t below disables
+ * interrupts on both configurations. The _irqsave() ensures
+ * that interrupts are always disabled and later restored.
+ */
raw_spin_lock_irqsave(cpu_lock, flags);
while ((pos = cgroup_rstat_cpu_pop_updated(pos, cgrp, cpu))) {
struct cgroup_subsys_state *css;
_
Patches currently in -mm which might be from bigeasy@linutronix.de are
mm-memcg-disable-threshold-event-handlers-on-preempt_rt.patch
mm-memcg-protect-per-cpu-counter-by-disabling-preemption-on-preempt_rt-where-needed.patch
mm-memcg-protect-memcg_stock-with-a-local_lock_t.patch
mm-memcg-disable-migration-instead-of-preemption-in-drain_all_stock.patch
mm-workingset-replace-irq-off-check-with-a-lockdep-assert.patch
cgroup-use-irqsave-in-cgroup_rstat_flush_locked.patch
cgroup-use-irqsave-in-cgroup_rstat_flush_locked-fix.patch
reply other threads:[~2022-03-02 22:01 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=20220302220149.BC067C004E1@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan.x@bytedance.com \
--cc=mm-commits@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
/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.