Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2878769rdb; Mon, 4 Dec 2023 09:53:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFazpPpzaSwxFPItSCi0umie7mcyZgqCoqIS6rH2vvxvTkaVuqiIn9j9KEhydRX0KUSFeme X-Received: by 2002:a05:6a20:7d9e:b0:18f:97c:8a18 with SMTP id v30-20020a056a207d9e00b0018f097c8a18mr6613681pzj.67.1701712383063; Mon, 04 Dec 2023 09:53:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701712383; cv=none; d=google.com; s=arc-20160816; b=mLUYbNTIuRIkqdyktuGsUg+8+iRh4Op2ldFmOq9/Z2pGhMA3OIPwYgHRIaX576rkZn JuJAleHlsYLWOVQNUCYtaCvzTUNtaTbv45bWc+kdJxKwclwzuWmnVexG6ieKmkEX/Aw9 bGbA9xp/WfHr9MT0IU+5MJivGbac09o+VRGJTpLbAQJ5LnL/4eYojHOqb8E/9H7pcNZB pz4EUkoKDL+bLJne7Z1dEr4LgscWHhMEENGwYyzhsk3AG8WjhjxxXvu4Qqvy18NQkRWu 9Vzd+dVLKNd2cKDF+iyH3Y1hjun19oLtNuHpJ4w6vCZhZKLozguS1XlPKt9AZzvcr3ZB RESA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=glKbnxxwCXhUDZregwQm9CMF28tfdZZf41aiv7xKBeE=; fh=5cMh8CKYPGN1F0fzuaj1xrlN5+dBfa6bPK4XIprQ5s0=; b=KKruDd0BXwqW2gpk1uf7D19pcEHfb3N3KZcjDxcqN8mY+82gnRxISXtTq4HamkxTas edat2LQwJvVZ5S2pWIwzJAnzfgCAc4553RG7LMS+302iJcWuAha6UnAMhJrtPXzmeFJM 5X10erLldwadqQ2AYcc86fuETFRDtteb3Bfuop5c7cIZHnGlQ45dW0N/eSpjz4kV6mUT f03UDb4ykCP1pi1vRjE+iBpxACDM7Tk9qKYEu9VyFOEYNCLp0H8t6Spl0pzTa0/69gwB cbU41h55ToiJNPnA7hTI9CQLMA7qqNpvXHfPiQ9uVqHfGIgZymIiE5YzVLA1HHb0cd2+ mTrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AyKVjv+y; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id dr2-20020a056a004a8200b006cbef05beddsi7963160pfb.11.2023.12.04.09.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 09:53:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=AyKVjv+y; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id A2FEA805A582; Mon, 4 Dec 2023 09:53:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230386AbjLDRwq (ORCPT + 99 others); Mon, 4 Dec 2023 12:52:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjLDRwp (ORCPT ); Mon, 4 Dec 2023 12:52:45 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 047E2119 for ; Mon, 4 Dec 2023 09:52:49 -0800 (PST) Date: Mon, 4 Dec 2023 18:52:46 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701712368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=glKbnxxwCXhUDZregwQm9CMF28tfdZZf41aiv7xKBeE=; b=AyKVjv+ybgBrVJdhxTxe5xeDV+C2F3xLJKAZ0ZOdfd3IFRR7nKSmRvVmZSUFPBa2DGIl3c Xd0forYphoRjecepKA8xxySmYk216dPmwvne/iGmv/PrMDPhkvzSjb2pnaBhKfLPsB9iOE /Y5nmWO/YkEZJu1bp/xQmP+SeN2BzekeV5tlY0NXY/w43FqdMS1x8AZ0PZsayaziEPbBh/ 2Rmi0UbZSCQbk5cj6I8VRFRvn4+O7X5mPqOeY4sAbX3uqQq/HrU0jnZDN7mAL/MDHgf5Cw lKosyHWH3iwGOIqRBYj3+TZ+UaBQqxO2szSQGDbFZNxRLImOFgQ+4+0sDL5Teg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701712368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=glKbnxxwCXhUDZregwQm9CMF28tfdZZf41aiv7xKBeE=; b=XJEZvFr5g0pisYqDApibVBx27ym1jjGIUnglNwZK87lrJh1VRtFSxd3DpQzJS/vku34aIF Ylk9jayTODpUbdBg== From: Sebastian Siewior 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" , Frederic Weisbecker , Rik van Riel , Steven Rostedt , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak Subject: Re: [PATCH v9 16/32] timers: Optimization for timer_base_try_to_set_idle() Message-ID: <20231204175246.J_8wNRQp@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> <20231201092654.34614-17-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231201092654.34614-17-anna-maria@linutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 04 Dec 2023 09:53:01 -0800 (PST) On 2023-12-01 10:26:38 [+0100], Anna-Maria Behnsen wrote: > When tick is stopped also the timer base is_idle flag is set. When > reentering the timer_base_try_to_set_idle() with the tick stopped, there is > no need to check whether the timer base needs to be set idle again. When a > timer was enqueued in the meantime, this is already handled by the > nohz_get_next_event() call which was executed before tick_nohz_stop_tick(). as of #15 tick_stopped is set later in tick_nohz_stop_tick() and both (tick_sched::tick_stopped and timer_base::is_idle) are cleared in tick_nohz_restart_sched_tick(). Then we have tick_nohz_idle_retain_tick() with only one caller and is only clearing timer_base::is_idle. Now, wouldn't it make sense to preload timer_idle based on timer_base::is_idle? I don't know if it there is a different outcome if timer_base::is_idle gets cleared in the idle path vs tick_sched::tick_stopped. I can't find nohz_get_next_event(). > Signed-off-by: Anna-Maria Behnsen Sebastian