Message ID | 20240115143743.27827-7-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-26101-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1743392dyc; Mon, 15 Jan 2024 06:39:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcfxsdjSkXoVlPMbrs7W46IF2Hh0R7qtghEsgXykw8WUj3U1XEI/ZjBaVAGNdp0hAzuovt X-Received: by 2002:a17:902:c40a:b0:1d4:e0f:e4f3 with SMTP id k10-20020a170902c40a00b001d40e0fe4f3mr3143240plk.101.1705329595888; Mon, 15 Jan 2024 06:39:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705329595; cv=none; d=google.com; s=arc-20160816; b=ohY3uoiK2RRDs+oPtUXhT3zUwWgO1c82O/3xGpcKOvdb0Da3XN9d2O1cXQ7j5WPOrM zqmPRvpDg6FaguIGfqPWZ9Nu/nDu1uSkr9LSyovl3cVH2sFzO19hkf7Hi6ZeB67OAGmD fY1p2BxwCLEDxAEV5Cr3kDn0NOWhPGM5cVv08AEa9z4Ev/NvPwI1yYQ2dAtN6jA/4A2l WfSAnvVyUaHZ85p8620yLuO1ZDEx3rbVbgYNeFct4h6E2WLXfU3SMwVWkSm70o/TFsBT 6ObQLE/RFncgLpH8DtBO/I+vyhUEPovVjNlXWNOPv0mbmdlPqeKp1EDxV+pLSnWU47lk vLbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=3N/e3ayce4s+S+psHat1NbmR2VoGUdUGd0vnbZups1E=; fh=6m6KAu2D1n2eK6jNJ9BIoRiulvR238oCr7uvY5/A720=; b=g4vHlwrLlM+VNzUCoqgqKGr6FYUENM4QAnQtApIt1YkuB8ZQC0y1k/vvy7Mvf71Hzu GLD0CcXnvDheu158P2SU3nUCDKUeHbl1nzlrmuzFr7H3UloSV11iqIX9c8LvFi+Fa8F/ lRdHmAs1Ryrc8DuyQp1ISh1kWrjmb/R1OzlKND3w1q1E/aWNDEdBA/L8TM65lDMj2hQb HKC2HdWIvZFZooS5VbIu2BrUDeGYQOfTXmsZ2NNU/SNF4MaTrYX6RLdqhSRENpBZwhWE SACdVj+XVlzisCpCfi3dyiFI8xPrv+RPqL6cBIZhY1L7lpgXqIMPPuxBNHdid2mDg4Q6 jI/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RyWK6cnq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=nI9H8aRP; spf=pass (google.com: domain of linux-kernel+bounces-26101-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26101-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id iy7-20020a170903130700b001cfe02fa89esi8981930plb.117.2024.01.15.06.39.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:39:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26101-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RyWK6cnq; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=nI9H8aRP; spf=pass (google.com: domain of linux-kernel+bounces-26101-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26101-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A810A28284A for <ouuuleilei@gmail.com>; Mon, 15 Jan 2024 14:39:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F3651862B; Mon, 15 Jan 2024 14:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RyWK6cnq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nI9H8aRP" 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 08E211799A for <linux-kernel@vger.kernel.org>; Mon, 15 Jan 2024 14:38:07 +0000 (UTC) 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 From: Anna-Maria Behnsen <anna-maria@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1705329486; 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=3N/e3ayce4s+S+psHat1NbmR2VoGUdUGd0vnbZups1E=; b=RyWK6cnqw0ZSnAWy/fuDH3dP0nS91x8d3ZEE8sFVaN+Vwyu+FNf6Eo8e15EGEiU0TVhbBP CEiUEWxOavweTRQ5m0Az1upcpffWC2rkjj1sjatSDdEBJ3v2H/uwX97TZ+kDziSmES9dPj oQ0z9ycusV9RXflK9FcIJEv3PAO1wO405l7j3tR3MOq6Q1A8GZfSywxZJ54WOnXBdaxU5U jifuboiqZw+UW2BdbBgpEV2Wa2WrBuq57KGcfP53oo5YC9B0bViLiLuuhE3rFoDv/Ln+gW t7odEXusxS4BmTv+2pDa7dzXH8jx7ahZCyNgV5jvZgJmFqO1ROABdBOk49NG+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1705329486; 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=3N/e3ayce4s+S+psHat1NbmR2VoGUdUGd0vnbZups1E=; b=nI9H8aRP8bIz2zRhY61S/vNnS4ySyBwwN2VLZ3UTM6sC9x7IvA1EKT80kGdS6DDSY3JvvZ JIxNDTZi3oKmaoAQ== To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra <peterz@infradead.org>, John Stultz <jstultz@google.com>, Thomas Gleixner <tglx@linutronix.de>, Eric Dumazet <edumazet@google.com>, "Rafael J . Wysocki" <rafael.j.wysocki@intel.com>, Arjan van de Ven <arjan@infradead.org>, "Paul E . McKenney" <paulmck@kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Rik van Riel <riel@surriel.com>, Steven Rostedt <rostedt@goodmis.org>, Sebastian Siewior <bigeasy@linutronix.de>, Giovanni Gherdovich <ggherdovich@suse.cz>, Lukasz Luba <lukasz.luba@arm.com>, "Gautham R . Shenoy" <gautham.shenoy@amd.com>, Srinivas Pandruvada <srinivas.pandruvada@intel.com>, K Prateek Nayak <kprateek.nayak@amd.com>, Anna-Maria Behnsen <anna-maria@linutronix.de>, Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com> Subject: [PATCH v10 06/20] workqueue: Use global variant for add_timer() Date: Mon, 15 Jan 2024 15:37:29 +0100 Message-Id: <20240115143743.27827-7-anna-maria@linutronix.de> In-Reply-To: <20240115143743.27827-1-anna-maria@linutronix.de> References: <20240115143743.27827-1-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788167686314042851 X-GMAIL-MSGID: 1788167686314042851 |
Series |
timers: Move from a push remote at enqueue to a pull at expiry model
|
|
Commit Message
Anna-Maria Behnsen
Jan. 15, 2024, 2:37 p.m. UTC
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 <anna-maria@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> Acked-by: Tejun Heo <tj@kernel.org> Cc: Tejun Heo <tj@kernel.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> --- 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 2989b57e154a..31a6b0831318 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1955,7 +1955,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); } /**