From: Waiman Long <llong@redhat.com>
To: "Michal Koutný" <mkoutny@suse.com>,
"Kuniyuki Iwashima" <kuniyu@google.com>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>
Cc: Tejun Heo <tj@kernel.org>, Johannes Weiner <hannes@cmpxchg.org>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Tiffany Yang <ynaffit@google.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>,
cgroups@vger.kernel.org, linux-rt-devel@lists.linux.dev,
syzbot+27a2519eb4dad86d0156@syzkaller.appspotmail.com
Subject: Re: [PATCH] cgroup: Disable preemption for cgrp->freezer.freeze_seq when CONFIG_PREEMPT_RT=y.
Date: Thu, 2 Oct 2025 14:11:10 -0400 [thread overview]
Message-ID: <db316092-85c0-4cb6-9f85-5528a0bb7d65@redhat.com> (raw)
In-Reply-To: <5k5g5hlc4pz4cafreojc5qtmp364ev3zxkmahwk4yx7c25fm67@gdxsaj5mwy2j>
On 10/2/25 4:28 AM, Michal Koutný wrote:
> Hello.
>
> Thanks for looking into this Kuniyuki.
>
> On Thu, Oct 02, 2025 at 05:22:07AM +0000, Kuniyuki Iwashima <kuniyu@google.com> wrote:
>> The writer side is under spin_lock_irq(), but the section is still
>> preemptible with CONFIG_PREEMPT_RT=y.
> I see similar construction in other places, e.g.
> mems_allowed_seq in set_mems_allowed
> period_seqcount in ioc_start_period
> pidmap_lock_seq in alloc_pid/pidfs_add_pid
> (where their outer lock becomes preemptible on PREEMPT_RT.)
>
>> Let's wrap the section with preempt_{disable,enable}_nested().
> Is it better to wrap them all (for CONFIG_PREEMPT_RT=y) or should they
> become seqlock_t on CONFIG_PREEMPT_RT=y?
Changing it to seqlock_t will introduce another lock that need to be
handled. Alternatively, we can use seqcount_spinlock_t for freeze_seq
for the current case and associate css_set_lock with the sequence count
in seqcount_spinlock_init(). That should properly handle the case for
PREEMPT_RT kernel.
Cheers,
Longman
next prev parent reply other threads:[~2025-10-02 18:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 5:22 [PATCH] cgroup: Disable preemption for cgrp->freezer.freeze_seq when CONFIG_PREEMPT_RT=y Kuniyuki Iwashima
2025-10-02 5:49 ` Sebastian Andrzej Siewior
2025-10-02 8:28 ` Michal Koutný
2025-10-02 16:22 ` Kuniyuki Iwashima
2025-10-02 16:55 ` Sebastian Andrzej Siewior
2025-10-02 17:14 ` Kuniyuki Iwashima
2025-10-02 17:17 ` Michal Koutný
2025-10-02 18:11 ` Waiman Long [this message]
2025-10-02 16:45 ` Tejun Heo
2025-10-02 16:55 ` Sebastian Andrzej Siewior
2025-10-02 17:04 ` Tejun Heo
2025-10-02 20:51 ` Sebastian Andrzej Siewior
2025-10-03 14:42 ` Tejun Heo
2025-10-04 8:35 ` 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=db316092-85c0-4cb6-9f85-5528a0bb7d65@redhat.com \
--to=llong@redhat.com \
--cc=bigeasy@linutronix.de \
--cc=cgroups@vger.kernel.org \
--cc=clrkwllms@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@google.com \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mkoutny@suse.com \
--cc=rostedt@goodmis.org \
--cc=syzbot+27a2519eb4dad86d0156@syzkaller.appspotmail.com \
--cc=tj@kernel.org \
--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