From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8B7221C173 for ; Wed, 19 Aug 2026 14:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787149154; cv=none; b=jMXqT9HKnGkfb4SOLjS0CEqEzvvZ5BlzHGPoYEruWFcjo3RgaKj21wNdzuwb7EoeB0Rei56SGt4yudv9dz6X5O7nGD+NRbhKTMoOadBTNAH+6s3Y9cxvfnQkdk2cE6gnLCloq2m47ad1tBedjngVwFtVchJl8Qf33HSrBCPlMSY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787149154; c=relaxed/simple; bh=6kbfd20kS1CMrD8lrIIzzPp+LZ22FccLjtt0wDok/aA=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=puIJ4b8TVru6jdbM4ihwe9piOLG8B9eHBY3ZnxpjIa3CKjNEzlIVjuxxmZJMh/+bnjxx5Vdv//9OJVidGaf7TJpW97rFRDEomgeaq+34P6BfRBA7L50eyjXOlPum7Cb05b5TD8uJ09wQ/3yQeuw/r+MzJXLixRHEC2Tum+MlwVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=HLbysD4a; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4MyvfMsb; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="HLbysD4a"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4MyvfMsb" Date: Wed, 19 Aug 2026 16:19:09 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1787149150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=ppFy6XY+gxbiHL1IUO2PxBcKhTXu0WA+TEyLPR6Zm/o=; b=HLbysD4aXT6m6LnrhaVRL5xLT4NMoGZJeP6BssI22oMXjiZ5hc02XCZIWTNJ8rvnKOL6ee x98NauDi38SVPkPZsGAxcUw4ZzDTAw9bsxxf+vBajD2Q+JSpCdxKJYI9sZ5JhZk6tMZ+Fe zto9ALS2Ajrt4uFVvcszs+mTrK2eQl7B2f2lmK6up8uJR/4rmbSlSDRYnu0/NKH8DLR06H wy/yjshhJSckvIuZT+fmLn4zDEajcuu9M2y8jdB6rlIzNPE5svGHZgk7griqK86HJTM2Xp miO1DZWEAxxNzoHZIrz+JiK4JhgH84xkJt+YJbc7zaqqdMpLaqIOyOmBSDDMdQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1787149150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=ppFy6XY+gxbiHL1IUO2PxBcKhTXu0WA+TEyLPR6Zm/o=; b=4MyvfMsbRy/H9pEjawlM6JmmqusJKkKajGNq2aRZd8Oyli/9RpPpyxP7J5IXVOyKPjNlho if3DhpTDZg5NevAw== From: Sebastian Andrzej Siewior To: Tejun Heo Cc: Lai Jiangshan , Thomas Gleixner , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: [PATCH] workqueue: Use raise_softirq() in bh_pool_kick_.*() Message-ID: <20260819141909.e2ZfmB3y@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline bh_pool_kick_normal() is used as irq_work callback to schedule softirq on a remote CPU. On PREEMPT_RT the default irq_work item is initialized as IRQ_WORK_LAZY and is invoked in a thread with enabled interrupts (!RT would use softirq but interrupts would remain enabled). This triggers the warning in raise_softirq_irqoff() which expects interrupts to off while the softirq irq mask is modified. The kick function triggers an IPI and the remote CPU wakes of irq_work/ and the callback wakes ksoftirqd/. By initialising the irq_work as IRQ_WORK_INIT_HARD via | *bh_pool_irq_work(pool) = IRQ_WORK_INIT_HARD(irq_work_fns[i]); we get the IPI and either (directly) a wake of ksoftirqd or "injected" the softirq into the current context if it is already in BH-disabled context which is in general undesired. Even if ksoftirqd is woken up, the softirq work could be picked up by random task which decided to do softirqs and then "drains" the pending queue. Scheduling a remote BH-work is undesired because of the possible context stealing. Using raise_softirq() here avoids the warning. As of today I did not see any users. Use raise_softirq() in bh_pool_kick_.*() to avoid a warning in PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior --- kernel/workqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 78068ae8f28a6..0bb978df02005 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -7923,12 +7923,12 @@ static inline void wq_watchdog_init(void) { } static void bh_pool_kick_normal(struct irq_work *irq_work) { - raise_softirq_irqoff(TASKLET_SOFTIRQ); + raise_softirq(TASKLET_SOFTIRQ); } static void bh_pool_kick_highpri(struct irq_work *irq_work) { - raise_softirq_irqoff(HI_SOFTIRQ); + raise_softirq(HI_SOFTIRQ); } static void __init restrict_unbound_cpumask(const char *name, const struct cpumask *mask) -- 2.55.0