Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2240232rdb; Wed, 21 Feb 2024 01:06:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWjGcfxdcXi+13igYH3q+UnC0gHxG5FKRLSo2zMHiaJ7oa+wNXf60KiQeUbkiy/iU2MRco/A0r4uU3LjQxDFxOJKe7Q9eQwx5HqvxQTdg== X-Google-Smtp-Source: AGHT+IFd9tGfmeGAwScxPqIt3Vinu9uUbxrjMWoWLVxpIobfcCZWHRGTsYQOoeU/lIuyuXk83ekI X-Received: by 2002:a05:622a:216:b0:42d:b5e6:a90b with SMTP id b22-20020a05622a021600b0042db5e6a90bmr20051354qtx.14.1708506393947; Wed, 21 Feb 2024 01:06:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708506393; cv=pass; d=google.com; s=arc-20160816; b=QAdp7Xpe2ygwI9ZqNyr/odMcLB0GU8Ue6/9MG4dvcdkwZUihw40kq2l9E/P52XS4m/ LstnLK636OWORLen4VNMpljPWF6krZTUX9FShbNRl5OhqZHhFObIHync5RTeoYSF48fC 6fUEuk5jbWJRImCzLF9mV4MCKot8uqiaRnpqfjciosfqfVU9Q3MC1t7vYCHdIgCGv5/7 ehsS+QCU5fr3Lunz1CRnH0BjBuqQMrmGjnDNg8XI9FlNXcBzDfH6zhorY8Yzn0gFYfgM 0dY/vmsPKGfJxokQ+6EejVOxxQI/XmpwWO/e8ESLQbN66sNvAN2sitxk4/dOR0A+v+KB eyJg== 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=ZnbOpzCKzJr8GVlvDiuyFIftQ7kDyRb60zxIswiDeKE=; fh=N5fTIFf2i7nvF8Om7kdprA8Zy2dleTNav/f0ArIISzo=; b=jf7YG2LvXcjrRGGs19pcU6FcZf6lLpUTzXG4879gT9Y5ajyQQj8KL7IqHj2QQzIViU AsTE2olOUvxRtg5+IHwf1sOZ64tV8hOZbxn2lFVs5dX7XlMXwFyaeIlcIaPsvTd3JoNE EbV2gCC644TtSrUodhz7E9gc65Iu2oHOheYtjB7aLgtKwkD09+rMZzfB/ePSHsMApAgf vbNfJi6z20SEnSRyD0XiJJvoy1NT4ykZlCj6r3nkpOBi4PJfrUF2kHwBkT+bvYNavS1q jN0G3nkktFxc6YxKyWFc9HQ2oUnsTi5EWrAb+TIci2GXRG3upawHCaIKakUmk5UIPK5X JD1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=bW6c6uDK; 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-74347-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74347-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vr28-20020a05620a55bc00b007871fdd2b97si10560978qkn.218.2024.02.21.01.06.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 01:06:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74347-linux.lists.archive=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=bW6c6uDK; 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-74347-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74347-linux.lists.archive=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 B0BCD1C21160 for ; Wed, 21 Feb 2024 09:06:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCB173D39F; Wed, 21 Feb 2024 09:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bW6c6uDK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NS4V0cz9" 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 9A58F3CF7C for ; Wed, 21 Feb 2024 09:06:15 +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=1708506377; cv=none; b=JABC1poGEa3Mj0h6IWjHvYtQUDWUFsmwMTL/QKkQ8Z62gsCycSGQLFkbp4Y+YCG+zw0krU2IdASj8Q4AIxOZ6M3JW/O4LUaeh5miZd4JhcuacrXUOd7l7h8e+J9imP30sFKClF0YBd17c7Bo/lnNfLesgFJx4t0b8yQvW2x/NcA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708506377; c=relaxed/simple; bh=cx7W79/0JOWapdXA61gJNfkyrPTg/Tmal7MREy72obs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hJtnK4S2PnqIMip9I5ZLMDkFjzkV2SRMwJtojivOexWGcvxMAS5VXtnxiunVEJQJ+gLzpn+ApnHvF/0wQ/6TgX8s5ljpdAaBImRBjkxWxRjn4KMc2sWX56N1lLw5sA0gSA2UDKjavxkFmco73QKZM009xJBde7/iEcWbgDPrZVk= 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=bW6c6uDK; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NS4V0cz9; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708506367; 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=ZnbOpzCKzJr8GVlvDiuyFIftQ7kDyRb60zxIswiDeKE=; b=bW6c6uDKTlx+T/vPLW1QjAk5/ewWlAA3hBGqgC9UyIcgRmbVKwt8YMB1ME9UbPI1X+adBZ bpZNeGpLBPsv8hISm32Ex5iKN1Us0mBVRcPt/s0dx9I2FAF2sRKwfWdnHTKadaJu2Sq9MQ NU8svm0LqSj+jtzDp3/Nr5a9zdBYsuQ9JqvFk/98VfqLWmOAelKS1Cylt8SQP01uAHuRhy 6le2M5D/nGeoo9tZltDBWE/OOfxfFEx6DR+/RPUKhgEjiSrGqt7PVbJRyxnd/AYwXTTZYG DmYgq/08QwA3BlV9qooRhwlLTMai0bsDEgRUf8BPorQNXpO8wWzuLkFsgc+7nw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708506367; 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=ZnbOpzCKzJr8GVlvDiuyFIftQ7kDyRb60zxIswiDeKE=; b=NS4V0cz9P1b+jOQ8gLhCmi/ndTdsC5DQxDsMA7Yt/YaXthsygD5Ayo469VqNwBqmfIiZTO j4SdOyTl0bcTMUAQ== 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 , Christian Loehle , Anna-Maria Behnsen Subject: [PATCH v11 02/20] timers: Split out get next timer interrupt Date: Wed, 21 Feb 2024 10:05:30 +0100 Message-Id: <20240221090548.36600-3-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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Split out get_next_timer_interrupt() to be able to extend it and make it reusable for other call sites. No functional change. Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker --- kernel/time/timer.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 5f21db4fa3ca..2aea55d53416 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1911,15 +1911,7 @@ static u64 cmp_next_hrtimer_event(u64 basem, u64 expires) return DIV_ROUND_UP_ULL(nextevt, TICK_NSEC) * TICK_NSEC; } -/** - * get_next_timer_interrupt - return the time (clock mono) of the next timer - * @basej: base time jiffies - * @basem: base time clock monotonic - * - * Returns the tick aligned clock monotonic time of the next pending - * timer or KTIME_MAX if no timer is pending. - */ -u64 get_next_timer_interrupt(unsigned long basej, u64 basem) +static inline u64 __get_next_timer_interrupt(unsigned long basej, u64 basem) { struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]); unsigned long nextevt = basej + NEXT_TIMER_MAX_DELTA; @@ -1978,6 +1970,19 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) return cmp_next_hrtimer_event(basem, expires); } +/** + * get_next_timer_interrupt() - return the time (clock mono) of the next timer + * @basej: base time jiffies + * @basem: base time clock monotonic + * + * Returns the tick aligned clock monotonic time of the next pending + * timer or KTIME_MAX if no timer is pending. + */ +u64 get_next_timer_interrupt(unsigned long basej, u64 basem) +{ + return __get_next_timer_interrupt(basej, basem); +} + /** * timer_clear_idle - Clear the idle state of the timer base * -- 2.39.2