Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2592813rdb; Wed, 21 Feb 2024 12:36:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfZ84DZrjI7AwK7lZCbHhU0mhmUj38Y0vBrIip5Yh4YyBkEPLzGtxLsGti7nXqvN4i3/EbIRE4KfhaGZSOXW2Gj3MUTBDe4Kh3JsbpDQ== X-Google-Smtp-Source: AGHT+IGTs3yJpWgujvNjyV0zVzfjudBQGW6QNLl2n7DR7mw0bJCIJ7Xr6K6mLjvX4FdLB9xuU9E0 X-Received: by 2002:a05:6358:5e8b:b0:17b:56de:d23c with SMTP id z11-20020a0563585e8b00b0017b56ded23cmr4915574rwn.7.1708547787084; Wed, 21 Feb 2024 12:36:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708547787; cv=pass; d=google.com; s=arc-20160816; b=0LEcs4FEg/NNAiyaTbl1acS3KCMSO+NWOuB9kbDiaL9fPVRKn89vCOjxG4nyIar/vD AclDXXP5cKOENwH78HbrJXKqcpmDMzn45hHpfyuWXynHbxUNpE/H3NfJOwXEFKf7II0F 7XsVTmez++g7HzSxbhYnyp66JMwXFyaIKBHVsIV/N830Pu6dbNiMyp6zIn8hidV0OowF 3GmGkXHupXztvMW8Mihe3DF63S06fMB5m2uabCgIemy1CSptmpk4zYnPsATXUfwuSo/T eUD6/DZLTFHH3RgWJxdU2O7q4C/geNBsZ9c0/e4NQV73Uaboz6plCDnmnhhs6DAGeQCv 0Zzg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lntmSJqK9ZKDECqnI0wHh3RMJsbjq2i+h3p29xblcr4=; fh=61fdgf5CUmDJVVs9aq1eApBkhqvys1Eiq9TqLo3hNz8=; b=aLR/2JMUfbJQum8zi62ee64I19+mcB+KkT71CxfkkUmGIrAKoMhWDUaUSwRyK8xFl8 Z07UmmFu3gmY6C4Fo1cmLBTvt/V/pYmGeurNiZrxq6U+uoW9X6pxjUh3mP3qrDXdaybT P9ySeA2PTldVoqI6TmQpzMS+w6bveJgXJFTK3hWSqv73FtlMfolUPvsfyzOYVFsF/y5g HsjQ27B63lXQ05WlbGvQWgl6XQsfCqv4JVrYol98xVtAT12oCFo4eKn3vXViqCu43wnx PQMOKw97iupgSWaxUqogaCBC1HYmusQ6ze9iWjkw2colvDyMzAvvMHdDx9TzqyRm7ZFm 98FA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P8epUoUG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id m25-20020a638c19000000b005d8c57281dfsi8920675pgd.410.2024.02.21.12.36.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 12:36:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P8epUoUG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-75468-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75468-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BDB0C2830BE for ; Wed, 21 Feb 2024 20:36:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D21A3BB2E; Wed, 21 Feb 2024 20:36:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P8epUoUG" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 950001E485 for ; Wed, 21 Feb 2024 20:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708547778; cv=none; b=rmQwqHpljeuIc5/lR0ShXuO/2pMksfM9KCVzttdSJK7onJ5RpSkJ5q9Jis3J13uRnj2L3jWXVFzqU8E8gHslOGnc4T8s0hVgAzb/+vvh7ziuKpPCFa3Mn8VU9foqKduZZZLYqpkpG1YHEx7tDo/cqqk+L5/nBv2NXiiuPTP66B0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708547778; c=relaxed/simple; bh=NzM1hRe8wv7YB8wEXVEeZHO9YYwtH/8T9TsFR/fw1pc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QVRr9nkgNXZPdORhSjQPCIPeR+kSV31KNRft2UVk/eNkkdTUkedYZB4WkSPlLMnHQIzP7Z6963ocdAZdrhIlZD9vbEWsgArzblISuXci74/GDfqA7te9az9hYiWM003YVscU2/EfEAF18BJQGQpnSBdMA6YySfVbHk4NRsV7hbY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P8epUoUG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AED03C433F1; Wed, 21 Feb 2024 20:36:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708547778; bh=NzM1hRe8wv7YB8wEXVEeZHO9YYwtH/8T9TsFR/fw1pc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=P8epUoUGnpHiIhKsWaClqpSTWhBTyfSj0xBYoD3c7ohSqqA/9Gjgx/6cLZELHvmAD gj4IOz7qx2eHbUQuP1o4nnoT+AZnev4OM3sfqyH9Xqz77uVAwoydmw67lUVh3TeYTf bPFbfN/OZWQkTCEDlp4WXILExjHFj2HBpD1n3RuGYA1DvnTaBM09hHqhf09zXdZwXv Z+DS0Cv8+tyl0DxVL4MZ7NO2h5Mh4jASHEyL7olz4qBp1a3BbYk9l6EdJ9sB0RvvyL Jwc4mu84vwvS5Vz5Gfet+XfC1zZJNh0ZZ15LwFTH6UN8hu6fUIjB6HAa1+sebzKqiV /c/biw5Xdli3w== Date: Wed, 21 Feb 2024 21:36:14 +0100 From: Frederic Weisbecker To: Anna-Maria Behnsen Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Christian Loehle Subject: Re: [PATCH v11 03/20] timers: Move marking timer bases idle into tick_nohz_stop_tick() Message-ID: References: <20240221090548.36600-1-anna-maria@linutronix.de> <20240221090548.36600-4-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-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240221090548.36600-4-anna-maria@linutronix.de> Le Wed, Feb 21, 2024 at 10:05:31AM +0100, Anna-Maria Behnsen a ?crit : > The timer base is marked idle when get_next_timer_interrupt() is > executed. But the decision whether the tick will be stopped and whether the > system is able to go idle is done later. When the timer bases is marked > idle and a new first timer is enqueued remote an IPI is raised. Even if it > is not required because the tick is not stopped and the timer base is > evaluated again at the next tick. > > To prevent this, the timer base is marked idle in tick_nohz_stop_tick() and > get_next_timer_interrupt() is streamlined by only looking for the next timer > interrupt. All other work is postponed to timer_base_try_to_set_idle() which is > called by tick_nohz_stop_tick(). timer_base_try_to_set_idle() never resets > timer_base::is_idle state. This is done when the tick is restarted via > tick_nohz_restart_sched_tick(). > > With this, tick_sched::tick_stopped and timer_base::is_idle are always in > sync. So there is no longer the need to execute timer_clear_idle() in > tick_nohz_idle_retain_tick(). This was required before, as > tick_nohz_next_event() set timer_base::is_idle even if the tick would not be > stopped. So timer_clear_idle() is only executed, when timer base is idle. So the > check whether timer base is idle, is now no longer required as well. > > While at it fix some nearby whitespace damage as well. > > Signed-off-by: Anna-Maria Behnsen Reviewed-by: Frederic Weisbecker