From patchwork Wed Dec 20 15:59:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 181715 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2740897dyi; Wed, 20 Dec 2023 08:02:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IE0bNHk8e9GLgL1/l1GVJlGMQT7jGWJ4Qg55tjEIBPE2MlQfc2v0SOVUQ8xaFePGIlCLT/p X-Received: by 2002:a05:620a:146b:b0:781:430:b06c with SMTP id j11-20020a05620a146b00b007810430b06cmr2912421qkl.62.1703088131128; Wed, 20 Dec 2023 08:02:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703088131; cv=none; d=google.com; s=arc-20160816; b=xfVPMeArtL4wzVpLcXIeo7VSTynzCrGVOG+y4fYsAr4aQpazweb1NbucbguKZin6xx qx4Lb3em8V0uYCov5G2Xn9Uhu4pxgIacMeYU6olJy70vm7cJulzPpaxNZVmLw4XjTi6H bVWiC3Ctv7HyqMdzAbVU3Ct/q8uU1SUn3SwDygL27MZKVTLR20BQfRM+62UwjytHC0cs RznZz20xpYyxRcxrsRrv0NgzR+xAgvJllhfYFurg6x6HmGd50bhyWNJL2ZxEqRnptPSM PwdYg8AMSFSau53hYpDsqlAFZ1jOnZwzT4vXGwr8EPa6jNTNoZSe7uEoxqGilsif2Kos kIyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=232aJJhHA3GkLoMcpuCeUflrMMOWDdohu1QKRUm1Q2Q=; fh=IdquJyaazQ3wXWxdOExnpctJRLX4Jw3HEb/tnyKonzY=; b=JmpBq7J7rZzOjSDN3dTJvipiNq3YYuu8JO0mE3eCTJuPbt5lrJNfESJA+30EOAhzJE X8Vn3iTjyUpg9ASQ9Nf8ONLCxpmKgJ7C3rAWV9HyzvRPgyElqBYU2HPhkDDsakjVUOQX 1mBBvjSnOYZ3L6BckP8nc6qHcTjhp4LFKUk8WpIFpMHj1kBQfGTql0ZYDJAWLuaDhXLL WVc1hw44HzxP7eueJ7QSv5yUzXItUNd73xlNVMsLYZKvTAn/AOS12VzhfKWyY6XbcF+z t8bW79cQV/AqYbkFA7y+DpH0f0KtD3IAtGjRsP9BWwXlt++/xBYHbB6VDJ1h3RapxDIw DKWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gCumy64a; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ZigY6SB8; spf=pass (google.com: domain of linux-kernel+bounces-7230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7230-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 q14-20020a05620a0d8e00b007756dfea0ccsi55326qkl.90.2023.12.20.08.02.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 08:02:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7230-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=gCumy64a; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ZigY6SB8; spf=pass (google.com: domain of linux-kernel+bounces-7230-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7230-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 D9C1E1C24B04 for ; Wed, 20 Dec 2023 16:02:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76B554A991; Wed, 20 Dec 2023 15:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gCumy64a"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZigY6SB8" X-Original-To: linux-kernel@vger.kernel.org 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 675A4481AE; Wed, 20 Dec 2023 15:59:11 +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 Date: Wed, 20 Dec 2023 15:59:08 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703087949; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=232aJJhHA3GkLoMcpuCeUflrMMOWDdohu1QKRUm1Q2Q=; b=gCumy64aKzoiwepfogegHuAFT4Om1Xq1uYNygLY1GpZzDeQbLccOkCgR/3uivmrZpw3bEf lhHT4/rgQe9hku120gzt3xnI8FH7Hr1twVgZlWZ01YT/BWUrKAdDsxgbwM61I51h6Up4xW 0bcJz9foyA6wku+89iM/QOggNyAtDHYMg8QpP3nFBHU7r648vh4H6IwGEmsxRFNj026og2 6jW+niRvyNsUm2j/2TPSpVFcyu8G4ufEMCfFFRwxu3KZKBWKFVxLT5dvaQMiOGxng5kcPB fNeb2ozFNMgcOpXXhD0TZFz02a2hiDMNbcg8kG0Oul0lQiVRKaJKXvhD8pa2dw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703087949; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=232aJJhHA3GkLoMcpuCeUflrMMOWDdohu1QKRUm1Q2Q=; b=ZigY6SB8h0ztDUA6FpCo+GMMFDOfcubd/HW1ov5ZeoSDdb5gwJq8Ni3PAx+x4KEx/CxI9N 7Qm+xNX1eGtElKCw== From: "tip-bot2 for Anna-Maria Behnsen" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] timers: Move store of next event into __next_timer_interrupt() Cc: "Anna-Maria Behnsen" , Thomas Gleixner , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231201092654.34614-8-anna-maria@linutronix.de> References: <20231201092654.34614-8-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170308794894.398.9108657349388521150.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784071186656646156 X-GMAIL-MSGID: 1785817340153459804 The following commit has been merged into the timers/core branch of tip: Commit-ID: b5e6f59888c7bde3c05f61b3ce06b78a86713fc0 Gitweb: https://git.kernel.org/tip/b5e6f59888c7bde3c05f61b3ce06b78a86713fc0 Author: Anna-Maria Behnsen AuthorDate: Fri, 01 Dec 2023 10:26:29 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 20 Dec 2023 16:49:38 +01:00 timers: Move store of next event into __next_timer_interrupt() Both call sites of __next_timer_interrupt() store the return value directly in base->next_expiry. Move the store into __next_timer_interrupt() and to make its purpose more clear, rename the function to next_expiry_recalc(). No functional change. Signed-off-by: Anna-Maria Behnsen Signed-off-by: Thomas Gleixner Reviewed-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20231201092654.34614-8-anna-maria@linutronix.de --- kernel/time/timer.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 9188205..490ff8e 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1800,8 +1800,10 @@ static int next_pending_bucket(struct timer_base *base, unsigned offset, /* * Search the first expiring timer in the various clock levels. Caller must * hold base->lock. + * + * Store next expiry time in base->next_expiry. */ -static unsigned long __next_timer_interrupt(struct timer_base *base) +static void next_expiry_recalc(struct timer_base *base) { unsigned long clk, next, adj; unsigned lvl, offset = 0; @@ -1867,10 +1869,9 @@ static unsigned long __next_timer_interrupt(struct timer_base *base) clk += adj; } + base->next_expiry = next; base->next_expiry_recalc = false; base->timers_pending = !(next == base->clk + NEXT_TIMER_MAX_DELTA); - - return next; } #ifdef CONFIG_NO_HZ_COMMON @@ -1930,7 +1931,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) raw_spin_lock(&base->lock); if (base->next_expiry_recalc) - base->next_expiry = __next_timer_interrupt(base); + next_expiry_recalc(base); nextevt = base->next_expiry; /* @@ -2021,7 +2022,7 @@ static inline void __run_timers(struct timer_base *base) WARN_ON_ONCE(!levels && !base->next_expiry_recalc && base->timers_pending); base->clk++; - base->next_expiry = __next_timer_interrupt(base); + next_expiry_recalc(base); while (levels--) expire_timers(base, heads + levels);