From: Tejun Heo <tj@kernel.org>
To: "Michal Koutný" <mkoutny@suse.com>
Cc: Nirbhay Sharma <nirbhay.lkd@gmail.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Tiffany Yang <ynaffit@google.com>,
cgroups@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev,
syzbot+27a2519eb4dad86d0156@syzkaller.appspotmail.com,
skhan@linuxfoundation.org, david.hunter.linux@gmail.com,
linux-kernel-mentees@lists.linuxfoundation.org,
Kuniyuki Iwashima <kuniyu@google.com>
Subject: Re: [PATCH] cgroup: Fix seqcount lockdep assertion in cgroup freezer
Date: Fri, 3 Oct 2025 04:27:10 -1000 [thread overview]
Message-ID: <aN_dPpjupRpc9Tj1@slm.duckdns.org> (raw)
In-Reply-To: <nbtofen2pwqmp7r5odbyc4en6vv54rpznyaanxlb6tbx5yyg25@jx2re5hdmt5e>
On Fri, Oct 03, 2025 at 04:00:22PM +0200, Michal Koutný wrote:
> On Fri, Oct 03, 2025 at 05:15:55PM +0530, Nirbhay Sharma <nirbhay.lkd@gmail.com> wrote:
> > The commit afa3701c0e45 ("cgroup: cgroup.stat.local time accounting")
> > introduced a seqcount to track freeze timing but initialized it as a
> > plain seqcount_t using seqcount_init().
> >
> > However, the write-side critical section in cgroup_do_freeze() holds
> > the css_set_lock spinlock while calling write_seqcount_begin(). On
> > PREEMPT_RT kernels, spinlocks do not disable preemption, causing the
> > lockdep assertion for a plain seqcount_t, which checks for preemption
> > being disabled, to fail.
> >
> > This triggers the following warning:
> > WARNING: CPU: 0 PID: 9692 at include/linux/seqlock.h:221
> >
> > Fix this by changing the type to seqcount_spinlock_t and initializing
> > it with seqcount_spinlock_init() to associate css_set_lock with the
> > seqcount. This allows lockdep to correctly validate that the spinlock
> > is held during write operations, resolving the assertion failure on all
> > kernel configurations.
> >
> > Reported-by: syzbot+27a2519eb4dad86d0156@syzkaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=27a2519eb4dad86d0156
> > Fixes: afa3701c0e45 ("cgroup: cgroup.stat.local time accounting")
> > Signed-off-by: Nirbhay Sharma <nirbhay.lkd@gmail.com>
>
> Link: https://lore.kernel.org/r/20251002165510.KtY3IT--@linutronix.de/
>
> Yes, this is what was discussed yesterday. Thanks.
>
> Acked-by: Michal Koutný <mkoutny@suse.com>
Okay, reverting that one and applying this one.
Thanks.
--
tejun
next prev parent reply other threads:[~2025-10-03 14:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-03 11:45 [PATCH] cgroup: Fix seqcount lockdep assertion in cgroup freezer Nirbhay Sharma
2025-10-03 14:00 ` Michal Koutný
2025-10-03 14:27 ` Tejun Heo [this message]
2025-10-03 14:37 ` Tejun Heo
2025-10-04 8:34 ` Tiffany Yang
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=aN_dPpjupRpc9Tj1@slm.duckdns.org \
--to=tj@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=cgroups@vger.kernel.org \
--cc=clrkwllms@kernel.org \
--cc=david.hunter.linux@gmail.com \
--cc=hannes@cmpxchg.org \
--cc=kuniyu@google.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mkoutny@suse.com \
--cc=nirbhay.lkd@gmail.com \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.org \
--cc=syzbot+27a2519eb4dad86d0156@syzkaller.appspotmail.com \
--cc=ynaffit@google.com \
/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