From nobody Mon Dec 29 05:04:22 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3615DC07E97 for ; Fri, 1 Dec 2023 09:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378128AbjLAJ2L (ORCPT ); Fri, 1 Dec 2023 04:28:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378110AbjLAJ1j (ORCPT ); Fri, 1 Dec 2023 04:27:39 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A696199F for ; Fri, 1 Dec 2023 01:27:20 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701422838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fQra51vM0+AF7Pw741oQBrBk7Zt04iCrGLsTZoJApiI=; b=N8IXtw37hnuRY5f/tQtu7mjNOGcU/i3xD1XD3YN/HcZkRvbEDJTCxJEnzHY59YsAQVlW09 M5V5N1Gaw3UDmlFJvd6Z3vXYCUSobPSzHupk7g2MtzfvPcf0yqMH0bkXkUO4BKdnWaaWag PfqxXUIVhTJ5BMnzCgx3VYAMPd+H+/KSwsWZN44BekJmTMFcHV0S4mjzW1xWSg8njws7ZS je0YZRUi4Hb2chqYKXYLxJo1xR7MWsuTgVXgZs6Gmn/tk8VTmsCEyYfpAlpj+s72ofJ+N+ 3u+B/K5EqYxi8Sxy6Nwv8i8Y0C4kuRCAJObBt669iC2PHpvmplNq5EJtRupBAg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701422838; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fQra51vM0+AF7Pw741oQBrBk7Zt04iCrGLsTZoJApiI=; b=R5Qn2IaGcKetkUnTnZUQoeXbKXVdaaPRJW0YVxJFh572/+9QYRhJ06YDFf7IlhLPVjNo0B I8kGucuTQGt9uwCw== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Anna-Maria Behnsen , Tejun Heo , Lai Jiangshan Subject: [PATCH v9 18/32] workqueue: Use global variant for add_timer() Date: Fri, 1 Dec 2023 10:26:40 +0100 Message-Id: <20231201092654.34614-19-anna-maria@linutronix.de> In-Reply-To: <20231201092654.34614-1-anna-maria@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The implementation of the NOHZ pull at expiry model will change the timer bases per CPU. Timers, that have to expire on a specific CPU, require the TIMER_PINNED flag. If the CPU doesn't matter, the TIMER_PINNED flag must be dropped. This is required for call sites which use the timer alternately as pinned and not pinned timer like workqueues do. Therefore use add_timer_global() to make sure TIMER_PINNED flag is dropped. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker Acked-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan --- v6: - New patch: As v6 provides unconditially setting TIMER_PINNED flag in add_timer_on() workqueue requires new add_timer_global() variant. --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6e578f576a6f..3a1360794137 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1958,7 +1958,7 @@ static void __queue_delayed_work(int cpu, struct work= queue_struct *wq, if (unlikely(cpu !=3D WORK_CPU_UNBOUND)) add_timer_on(timer, cpu); else - add_timer(timer); + add_timer_global(timer); } =20 /** --=20 2.39.2