Message ID | 20240221090548.36600-7-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-74350-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp918729dyc; Wed, 21 Feb 2024 01:08:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXa+DgQlq0hnTfmgojbtI3qzVQHHYCr7RsVksjlL+aUJQNEKdsQH7rCJvAQNteq9E2k6lUTXaCmnbrkJzzRAtqhg51bCw== X-Google-Smtp-Source: AGHT+IF8AY3BDWxU/9hzJdJxvXdfJTonwxyF+IFE26ASdXv2bD3B4AAwW0CpLjhFFngHYaTrUNBk X-Received: by 2002:ac8:5bc3:0:b0:42e:2866:6874 with SMTP id b3-20020ac85bc3000000b0042e28666874mr4699850qtb.21.1708506503380; Wed, 21 Feb 2024 01:08:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708506503; cv=pass; d=google.com; s=arc-20160816; b=DBLJ4t0vCSzQxVD7iATG66Mk2KfG42OTzekl4K/jB4nY9qdJb4Ol0TATm7ce3F47vu IVVcRDd0IHlOwHlN1Wsbc1v2TY6UQw4dbB0QFPCa20mWoqFfnCxnyfT/g1ha9KWZ08Si jRTBsa2MWwYRxNaT5JbsZITFYyjrCb0KjqXbX4eABf3jfF+vv8YLnYL1qOQzEYOUeRrB ExNAE2TxYWlYVtFJgME9A2Go/mGVkJdqSNO8DZaLjpXd+l4pJCyoQA4N235XYXgqLDa8 prnWbm/CiGtrza1fPd2WOCp9Odxs5xE2WvPuH9Rsagucg1FWxqkTWWJF+Ua+qsua6roW kxQg== ARC-Message-Signature: i=2; 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=AqA3e23FiOrvTnHWocrTEQRtHmd8ahLc00lmTygo058=; fh=jF6pf1T4w8nC/jaLeIBj6pWxFnEKdE6OeoCUkrV7kR8=; b=QgSXww8FXNV1yUV4NVyBnjd5til802MlA0gYKLlUErGcunUL5TDZ7uOvYoilCOkimg Y4qyrW3v+s7fOkxJHFu+gQd8yPeSVjqPwRDvqfpOuGog30+lsFGB95XpQFxJOJIt7Lmp gEGqx8lhOtUXhSZo/7Y7bEhTc1P//j48rOS/QZYef6AOaN27TyQ/1twyp3Epx2a1jFcn diMf9+chGc1+xUbCa9P28VBM+o7+NUwSWDCy/yBNCWoYoSvVYLWPd5JWL2/YMOXD7AMF /MIknjAp2vcWljvZpVapi/8lJ/QbGvLHr0swFZZg7e9Dap2jRHuLN5XiCEs7ZCPTTXIh Cr/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GhQruKgY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74350-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74350-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 4-20020a05620a04c400b00785c0c8579fsi9781991qks.632.2024.02.21.01.08.23 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 01:08:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74350-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GhQruKgY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74350-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74350-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 303AB1C21CB9 for <ouuuleilei@gmail.com>; Wed, 21 Feb 2024 09:08:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 661553F9CA; Wed, 21 Feb 2024 09:06:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GhQruKgY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TizbBauo" 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 D87383D3A1 for <linux-kernel@vger.kernel.org>; Wed, 21 Feb 2024 09:06:17 +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=1708506379; cv=none; b=RE/ixYo7oQAxGCfhFirN9Egq0ylrRrZS8aP2uUQBdUhj4aLBboRP15+IVD4jBnoOvMIxCZymuOZ4SFwgkDl/c6GnuqTh+0dJWspmY9hOQOlHgDjnRoc5Jy5+qnjRoBhhxEeThU6nv1/SRuRBHjcF8HcPS8Rs9VEoCZmLRg/Qz48= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708506379; c=relaxed/simple; bh=6M52TCV6rNFV1WzKYn148scsFyR2YNgc31imWTJffU8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JC1JXQNhxqY821YawZqQOYT7pQmKm8HcLxvLECxzHP73B9MkhMqWUJgdCbY7JjueAImJ+CGVmG2BoA9vwOYRf51Roac0JRtF0NE50ueLHoZEx8GrPHXuYJG+tsd+Zt37wrlOBwb8GKBO9SQnKBFvO/zQ17m9lKyQD2BO64+CuEY= 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=GhQruKgY; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TizbBauo; 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 From: Anna-Maria Behnsen <anna-maria@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708506370; 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=AqA3e23FiOrvTnHWocrTEQRtHmd8ahLc00lmTygo058=; b=GhQruKgYXp9tDYmM14Y9I+xhqF1Q59YA672dmlhTBZp1CJMj7WDPorb8REzcfUCaVe4RIG iffSQqSqPbOLe9b92l+wEuK1oxzdnuHycskTcOuaJKBeDNQAaihXYbZJsH9FF/OpdSxj7y /lrLZ0VAYfujB5Ig174uKx1IIt1GeSPKOzxymvD5k4NzwEFfZv8MoKzsGGsiXYWeImDcwo Wp6RUCyRNcJnGNXnE8t5kTpAUkoSDFqx/RbbfArHfWAFYw5QBHj4fmPgBzoAVm5+qEXmr6 ripng9czy/cvlTIIhAAVhFD/Ait2na426IiQ3hz2tD+2sBkziRIFjBuPWFb1ng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708506370; 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=AqA3e23FiOrvTnHWocrTEQRtHmd8ahLc00lmTygo058=; b=TizbBauoqo7JHxtaY42PsIlf6HZKEpUo+7SAD3XmsMeQj+oP+89cNahyYm38xfijITDRT6 1uAmPXh7bs63fGDw== 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>, Christian Loehle <christian.loehle@arm.com>, Anna-Maria Behnsen <anna-maria@linutronix.de>, Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com> Subject: [PATCH v11 06/20] workqueue: Use global variant for add_timer() Date: Wed, 21 Feb 2024 10:05:34 +0100 Message-Id: <20240221090548.36600-7-anna-maria@linutronix.de> In-Reply-To: <20240221090548.36600-1-anna-maria@linutronix.de> References: <20240221090548.36600-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: 1791498915454560313 X-GMAIL-MSGID: 1791498915454560313 |
Series |
timers: Move from a push remote at enqueue to a pull at expiry model
|
|
Commit Message
Anna-Maria Behnsen
Feb. 21, 2024, 9:05 a.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 7b482a26d741..78eaea2e5d72 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1961,7 +1961,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); } /**