From: Thomas Gleixner <tglx@linutronix.de>
To: Chris Mason <clm@meta.com>, Frederic Weisbecker <frederic@kernel.org>
Cc: Chris Mason <clm@meta.com>, LKML <linux-kernel@vger.kernel.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Marco Crivellari <marco.crivellari@suse.com>,
Waiman Long <llong@redhat.com>,
cgroups@vger.kernel.org
Subject: Re: [PATCH 2/3 v3] genirq: Fix interrupt threads affinity vs. cpuset isolated partitions
Date: Fri, 12 Dec 2025 11:26:39 +0900 [thread overview]
Message-ID: <87ikece8ps.ffs@tglx> (raw)
In-Reply-To: <20251212014848.3509622-1-clm@meta.com>
On Thu, Dec 11 2025 at 17:48, Chris Mason wrote:
> On Fri, 21 Nov 2025 15:34:59 +0100 Frederic Weisbecker <frederic@kernel.org> wrote:
> I ran some recent commits through AI patch review and it flagged this one.
> The comments below looks right to me, but I might be missing something:
>
>> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
>> index c1ce30c9c3ab6..61da1c68ff82a 100644
>> --- a/kernel/irq/manage.c
>> +++ b/kernel/irq/manage.c
>> @@ -1408,16 +1408,23 @@ setup_irq_thread(struct irqaction *new, unsigned int irq, bool secondary)
>> * references an already freed task_struct.
>> */
>> new->thread = get_task_struct(t);
>
> [ ... ]
>
>> - set_bit(IRQTF_AFFINITY, &new->thread_flags);
>> + kthread_bind_mask(t, cpu_possible_mask);
>> +
>> + /*
>> + * Ensure the thread adjusts the affinity once it reaches the
>> + * thread function.
>> + */
>> + new->thread_flags = BIT(IRQTF_AFFINITY);
> ^^^
>
> Can this clobber IRQTF_FORCED_THREAD?
>
> In __setup_irq(), irq_setup_forced_threading() is called before
> setup_irq_thread(). When forced threading is enabled,
> irq_setup_forced_threading() sets IRQTF_FORCED_THREAD via set_bit():
>
> set_bit(IRQTF_FORCED_THREAD, &new->thread_flags);
>
> Then setup_irq_thread() overwrites thread_flags with a direct assignment:
>
> new->thread_flags = BIT(IRQTF_AFFINITY);
>
> This clears IRQTF_FORCED_THREAD. Later in irq_thread():
Yep. That's broken. Nice catch.
next prev parent reply other threads:[~2025-12-12 2:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20251121143513eucas1p15c03a2c15aa5a0a15cc46d8f0a4e534e@eucas1p1.samsung.com>
2025-11-21 14:34 ` [PATCH 0/3 v3] genirq: Fix IRQ threads VS cpuset Frederic Weisbecker
2025-11-21 14:34 ` [PATCH 1/3 v3] genirq: Prevent from early irq thread spurious wake-ups Frederic Weisbecker
2025-11-21 19:12 ` Thomas Gleixner
2025-11-21 22:04 ` Frederic Weisbecker
2025-11-21 14:34 ` [PATCH 2/3 v3] genirq: Fix interrupt threads affinity vs. cpuset isolated partitions Frederic Weisbecker
2025-11-21 16:29 ` Waiman Long
2025-12-12 1:48 ` Chris Mason
2025-12-12 2:26 ` Thomas Gleixner [this message]
2025-12-12 4:01 ` [PATCH] genirq: Don't overwrite interrupt thread flags on setup Thomas Gleixner
2025-12-12 11:57 ` Frederic Weisbecker
2025-12-18 10:07 ` [PATCH 2/3 v3] genirq: Fix interrupt threads affinity vs. cpuset isolated partitions Guenter Roeck
2025-11-21 14:35 ` [PATCH 3/3 v3] genirq: Remove cpumask availability check on kthread affinity setting Frederic Weisbecker
2025-11-21 20:05 ` [PATCH 0/3 v3] genirq: Fix IRQ threads VS cpuset Marek Szyprowski
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=87ikece8ps.ffs@tglx \
--to=tglx@linutronix.de \
--cc=cgroups@vger.kernel.org \
--cc=clm@meta.com \
--cc=frederic@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llong@redhat.com \
--cc=m.szyprowski@samsung.com \
--cc=marco.crivellari@suse.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