Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp625939ybt; Mon, 6 Jul 2020 18:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGpo1DtoEK7GPSPOMghYlrJDsVE99GKFowjyyoAZjcWxRUQy0jbsHDJ0ubjUf2GT/Sn/v/ X-Received: by 2002:a17:906:375a:: with SMTP id e26mr47017739ejc.324.1594085740452; Mon, 06 Jul 2020 18:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594085740; cv=none; d=google.com; s=arc-20160816; b=fS6I2s0v6FyvBf8/nx8HRz6kEh6UOvUtRKwgjGjaGcHq1PL619NmYnFw693IRUjNhX yTg+8QREMMREroYqwKndsWCQTsIdaVkVCUSHD7mtgo20dTUWhAPMriIamFMHeJJhVgPg XxC1rQuh+jyc0mGY3hkCPsXMSneOaULvYynEmijbnFu6d9RZqbRDM928QmnIGFa/lm1K nl08aiftBopec9YDRvaSKVUeNRVDMpNAxQqiujq8LJpwdYI6bjyos2b+RFOnwx6Ab+4t MWaaJnhDiZCcQ1Sh+qoTprkZxshXr8jTyeA54Op6yXEDC9aJ3fAmjXgl6dxnZ3S8RHmN 6IXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qh7Yhdy+3/HZKvIqFUsWke0U3uKl53IfXGwU5QgBfM4=; b=AOxmwksvzhhHVreo8UVAxQsTL6pbcbxYxOwjb3dPy91mrXqA19yR+TwYj2SKLC1Pm2 yfL0poraCSOBnYQF1seM1QB+duL7kW2oyf0mcA4djpe9MS8WOL2ln4Td8aBkOulfWWt5 YviPPVmRg7xZyhFm2Jaxm/Tjkm5/FdQxyQPwvWfLBlxzH8B/dzHHkCNvMn232XhMh/4a F53ceIiZ4iSutBL/x3XWp0irdIbZ9PJIqLwv6RXwqw0BubAZzha8XwMuf+NswXtm+eh0 yh86y+07OXmu59RP2CGru/gJsoBUPUKqaJAGAdupUpD+DlkhxVWG4QcGl/nu4h+4n3CB iJBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jgb3e4vd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si13487851ejx.100.2020.07.06.18.35.17; Mon, 06 Jul 2020 18:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jgb3e4vd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728112AbgGGBd1 (ORCPT + 99 others); Mon, 6 Jul 2020 21:33:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:38710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727987AbgGGBdR (ORCPT ); Mon, 6 Jul 2020 21:33:17 -0400 Received: from lenoir.home (lfbn-ncy-1-317-216.w83-196.abo.wanadoo.fr [83.196.152.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D341A206F6; Tue, 7 Jul 2020 01:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594085594; bh=Fuc0I6pCPkKVyR/yCCQ2R2KYLOEOy3g4y2Qdg5rWwek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jgb3e4vdBBuiFYbimOazTn8c1Eo5QhWDugGXuYelnHyMUiqt9dg7e9DPK05NOXszh WQ6ZjVzKpp1LyBhot6iT91BgHUmCvj7yLtNmbRtI2ekBzwzYPNz5svVBdA7DZ0InZG CQ+eJ3f1ckGVKirbW86Jv1wjdrOMi7ZzGjGNdUXA= From: Frederic Weisbecker To: Thomas Gleixner Cc: LKML , Frederic Weisbecker , Anna-Maria Gleixner , Peter Zijlstra , Juri Lelli Subject: [PATCH 5/9] timer: Reuse next expiry cache after nohz exit Date: Tue, 7 Jul 2020 03:32:49 +0200 Message-Id: <20200707013253.26770-6-frederic@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200707013253.26770-1-frederic@kernel.org> References: <20200707013253.26770-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that we track the next expiry unconditionally when a timer is added, we can reuse that information on a tick firing after exiting nohz. Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Anna-Maria Gleixner Cc: Juri Lelli --- kernel/time/timer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/time/timer.c b/kernel/time/timer.c index 8a4138e47aa4..501d36ef0b75 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1705,13 +1705,11 @@ static int collect_expired_timers(struct timer_base *base, * the next expiring timer. */ if ((long)(now - base->clk) > 2) { - unsigned long next = __next_timer_interrupt(base); - /* * If the next timer is ahead of time forward to current * jiffies, otherwise forward to the next expiry time: */ - if (time_after(next, now)) { + if (time_after(base->next_expiry, now)) { /* * The call site will increment base->clk and then * terminate the expiry loop immediately. @@ -1719,7 +1717,7 @@ static int collect_expired_timers(struct timer_base *base, base->clk = now; return 0; } - base->clk = next; + base->clk = base->next_expiry; } return __collect_expired_timers(base, heads); } -- 2.26.2