From patchwork Fri Dec 1 09:26:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 172356 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp991978vqy; Fri, 1 Dec 2023 01:28:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHOhbPfyQbT3Y90MKPCarsV2/Xk7nfNx2/bdEv2KV76/F6lm2dj//ZTAMCNALLoGuSoMGk+ X-Received: by 2002:a05:6830:453:b0:6d8:328e:faa2 with SMTP id d19-20020a056830045300b006d8328efaa2mr2678498otc.26.1701422915323; Fri, 01 Dec 2023 01:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701422915; cv=none; d=google.com; s=arc-20160816; b=Jn+MLAI4D61Q4zO52CHW8NgxAlS/Q/2NhEb+Z6hlmVxowUcXzyYVRDS+uBoHswnPxj XV0+z2RzLTwBY+OEmg7BYZs9SuPXyzu8s1812Nloj3o2oKXBXO3KZ7J1w7R7XRV5DGoI HzyFJiBuwZyjqv82tsxjF7aT48sLJ8m1Kpizbq7zeK3+LAYodk+O2b+yEL8HCap1JS3t K+T16fvwptpIt+Cw36IjLFnNDYbgl6n0BBgjUj32pn1aH2QtOHnEHvCfNZUm0EelSwyT vG2gEO3n47z17yFpDPc4K/4/GKvwJ0sNJTYWO76a9jMHB999ex5R+GaVulCxUtQ7IGxu L5cA== 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 header.s=2020e header.b=R5Qn2IaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id f22-20020a63f116000000b00578ea9a0b93si3027008pgi.890.2023.12.01.01.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 01:28:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; 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 header.s=2020e header.b=R5Qn2IaG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 96C61815CDA5; Fri, 1 Dec 2023 01:28:32 -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 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:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784071234714988913 X-GMAIL-MSGID: 1784071234714988913 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); } /**