Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp904770rdb; Fri, 1 Dec 2023 01:28:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFy25DDeMmFQ7AlDx3hCoPNFGjBEKDETRalI4S2sryZt3akWoyCVQHQM2j8Sv52zavp45eJ X-Received: by 2002:a05:6a00:88e:b0:6c9:892c:5916 with SMTP id q14-20020a056a00088e00b006c9892c5916mr28490910pfj.9.1701422919844; Fri, 01 Dec 2023 01:28:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422919; cv=none; d=google.com; s=arc-20160816; b=v6DXbDouFSQcre9BlkSOQx5/iuIoGNeTvOfWmZv5jL8KRgia/rAxd6SWQfi+JNDsUv xYiQCrVAsFzXP0NTfM5c4m5ABdErxI2HXeer0JOWNKqT9yTe9bGJkIc/U8lp8mxxp/Lq tWxnpkWKg8uO1Rv7yaWTNmvEaOhDhEabF1887pvJdCtbPrAfs6PSAWiG/dqZEwQm8zCK 11cvDqop+KBNPNsA3dzsDSd0GEXpaSBBOryEQm+oDcdTviPgObmwttQefz4qzg0Vd6a+ tcObVwFHPa7Lq2js/YBzI6S+BRYGJ0XFiUdRmZRKmRNcJEwVcMt/I03Odf0Yrzimp9tX Yvsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=fQra51vM0+AF7Pw741oQBrBk7Zt04iCrGLsTZoJApiI=; fh=6m6KAu2D1n2eK6jNJ9BIoRiulvR238oCr7uvY5/A720=; b=ZxfpBNlXvSvFPpYtlJyjufmM/Rgc1HgVuILwRosMPik0a95Uhy/mg2M+97EVTrjH/j iBR1fsNOuAujwB0okD0KdtOtSDlk1yuNfflhShwBtCO3gDjMDJLI5e0CYHwu3ZfpB0i1 jplkmqRXihnFeaxEOY1+9d8ko9Ug0AXgoQWT9zsNSGralI9vm9drEwf+5tyPOSNwfrjd SQtrclWWouAFdLKn4xoh7tZEzIoMEzQDyWh0pbcHTN9Ebf58BjChry+vLB/yTSyh0dJn BFgxH6T3fi0L9T/dvLUT2UpL9V/AFjQTYYiewueAVZObhNDV2tsObORbPYRfxr6jPHbn ezKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=N8IXtw37; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j11-20020a056a00130b00b006bbfc944748si3009423pfu.315.2023.12.01.01.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:28:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=N8IXtw37; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6DDE581552C6; Fri, 1 Dec 2023 01:28:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378115AbjLAJ2K (ORCPT + 99 others); Fri, 1 Dec 2023 04:28:10 -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: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 01:28:37 -0800 (PST) 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 workqueue_struct *wq, if (unlikely(cpu != WORK_CPU_UNBOUND)) add_timer_on(timer, cpu); else - add_timer(timer); + add_timer_global(timer); } /** -- 2.39.2