Message ID | 20240115143743.27827-8-anna-maria@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-26103-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1743533dyc; Mon, 15 Jan 2024 06:40:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwSHOUAi+cIMejDiQtgWQoGmBtoxdbR2MkFThQec2weKc5ZIW/RZdoV9gKtSv+DV+9p1aO X-Received: by 2002:a05:620a:384:b0:783:4f59:666f with SMTP id q4-20020a05620a038400b007834f59666fmr4171119qkm.14.1705329611318; Mon, 15 Jan 2024 06:40:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705329611; cv=none; d=google.com; s=arc-20160816; b=eurVeXE376JSuyDQ5qtOjNyrOsgMyq2p0rBz42McI5P2YAPeMFl2HQVznkvr43m7Ej lLQpqvoZdfyAZW9a/IZmsegLD/9zjUZFtIs20DEX3tXI/iJRuUa7QGqoxd6LrYYDlNLr TkU5VhouJV6TWmrubGn3NDWCiBN4kQGxFMypW0IUKkUpDanxmRZ6pWAuPvHxAPxEP1NK IVNHGqS6pY1Bz9glpbR4VmBf3Ac/1extK91xtog0AS3UTgMUAxail2nD/NzvqtWwrCHE j+ys79EDtjAdSRyxHZXBShu/J5ZjmX6gMvk3bw5rcfIKBCyFRsvbbAha0CtzreD9TuBc GZOg== 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=ID/05caAQ7viG6IvKvJwH4SWuLM7iMQOtASJkbsjYUE=; fh=PG6uS4TiiUSDyl8D/joYkWbwCgDm4ug0ir2h7tHBJXQ=; b=pQB/FipujNXiN+zRecJCq+z7DncCCVjdoGyLGgvSs2MhetpRpL2lLSp8P1EQewugYA IY0QwQbhO//HPRNTg1cd4NEJ3KuLCgvQEhc9wFDwLruCKmSsW+wpPML/f+2G7vYeWgKq yAB/Nqmo581dAeW52rGcVMXkxdrru4OGyGy15bAoxAascm1/ap5gvRf3jp4cnYAi/n6D s3PFxcqYzCMZon6jkyum1PBuZvvKVN0DxhBu0qe8eput5Aea/q7xGNRDE4GYetYt9aK8 jVxOBuVSC7P5SeWJuWIuGYFB5usg7Dw8296S7RybU8SjA6Ma7B0pAQJh9pBnrcM2+8nQ vxZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Kd6kcmWr; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=NJleEKH8; spf=pass (google.com: domain of linux-kernel+bounces-26103-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26103-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 n22-20020ae9c316000000b007834a7b552fsi5995477qkg.289.2024.01.15.06.40.11 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:40:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26103-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=Kd6kcmWr; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=NJleEKH8; spf=pass (google.com: domain of linux-kernel+bounces-26103-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26103-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 1EB701C21B17 for <ouuuleilei@gmail.com>; Mon, 15 Jan 2024 14:40:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED7FE18AE1; 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="Kd6kcmWr"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NJleEKH8" 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 68F96179AD for <linux-kernel@vger.kernel.org>; Mon, 15 Jan 2024 14:38:08 +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=ID/05caAQ7viG6IvKvJwH4SWuLM7iMQOtASJkbsjYUE=; b=Kd6kcmWrMdGquSj5bS/s2WvOQTwxrPJ29PzQN8y3YkLHLxB8kkZYrV0QHBCCkD3W8/SUJ+ CvCmeqwAR8j5N5psDYLVrIspyBcre5NiN1VDnxxPczpjh274XKrO6Putyl9p8bpYevuSyi MhKXjwjPJmUFV9OfUePjAjZI3eFB/D3ZzeVzlM5uWusnWfYMSzt20rnurcXZiCM5mpf9Ff gHquLdZkSPZL2tTWjih6hj+Uw2d2Nw/Dq20Hzmzq20zei053PApLVeVDdYJFOAcQ4Oi6+M lw2UuXQuWUolN1qXre4fomZA5Mi57m9FRoCFSTOq3i/B/3ybnN7ykOuwcLCYnA== 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=ID/05caAQ7viG6IvKvJwH4SWuLM7iMQOtASJkbsjYUE=; b=NJleEKH8Ghy/Gbl6g2GgfGmK8C28DDGE4e44xPDO+2QBqPAAAdluGRrg4G0VbHCGvYR03Y Y2/ELZ67he0XRhAA== 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> Subject: [PATCH v10 07/20] timers: add_timer_on(): Make sure TIMER_PINNED flag is set Date: Mon, 15 Jan 2024 15:37:30 +0100 Message-Id: <20240115143743.27827-8-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: 1788167702834782174 X-GMAIL-MSGID: 1788167702834782174 |
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
set When adding a timer to the timer wheel using add_timer_on(), it is an implicitly pinned timer. With the timer pull at expiry time model in place, TIMER_PINNED flag is required to make sure timers end up in proper base. Add TIMER_PINNED flag unconditionally when add_timer_on() is executed. Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> --- kernel/time/timer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 3cf016d6fa59..fc4c406c9ec7 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1284,7 +1284,10 @@ EXPORT_SYMBOL(add_timer_global); * @timer: The timer to be started * @cpu: The CPU to start it on * - * Same as add_timer() except that it starts the timer on the given CPU. + * Same as add_timer() except that it starts the timer on the given CPU and + * the TIMER_PINNED flag is set. When timer shouldn't be a pinned timer in + * the next round, add_timer_global() should be used instead as it unsets + * the TIMER_PINNED flag. * * See add_timer() for further details. */ @@ -1298,6 +1301,9 @@ void add_timer_on(struct timer_list *timer, int cpu) if (WARN_ON_ONCE(timer_pending(timer))) return; + /* Make sure timer flags have TIMER_PINNED flag set */ + timer->flags |= TIMER_PINNED; + new_base = get_timer_cpu_base(timer->flags, cpu); /*