Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1084376rdb; Tue, 30 Jan 2024 07:30:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3ZhEXr8qrVSp5yXIAakw7Ro3ZWe+VrKv0WODjyrhKhdkP6GNsqoaYGFwNxSanKfzffcK0 X-Received: by 2002:a17:90a:6d22:b0:295:af17:22d with SMTP id z31-20020a17090a6d2200b00295af17022dmr1574324pjj.0.1706628610299; Tue, 30 Jan 2024 07:30:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706628610; cv=pass; d=google.com; s=arc-20160816; b=yxvkxMHVbFzCnLKlkO0ZoyqPnSVdejvfaGImUprMX+sdm38/SNfaRJb0me2SLjeG/M VP/HXHr2DUyXyDTfUAdIECWtPR5JJ0aplJaF8teAk/mV2nKjXJ8ASoALC7aC8Y09suOD 94xGgcBcTjBj5w5FEeGCCqyQ7MGIbdv+BTnTAIXk05dMoYD0+qlF0tJWcfUhTGWvVs1y JMWsC2f0maOAoBuEYQsRcPXMhhG1DTVWD5P5wci5cU6mgOPPi9umptyialfXWMReVurS Y630iw2v0D4VaUhY7DpFoZVMtWCfzYzYdVTkXBz6I8+sxT1C90/7icQcm7kqAgJP5UfV jhww== 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=0rb+Yc4i/u34PgF4JNVKbmvC96k/jtxrVzVoEsjuCoI=; fh=rlwn4pxNjzZxzAe0OFpEm5XldgGOhioyoE/W5GSrSmE=; b=EIbzLV63PnZ3RccEfeGTpVHnmSB/eU3etchlKOcMqgMqP3+QaJArZxsBmZs6Cmk3Bt lOZplRKyfLvbAAYeB/u5VnEJTe4wndbZ+C79gFvtA4kD/BiFVl3E3oob8vlpRrWs6ZoS p0FFYdjucPJSoPFaLLGHV8oUqNDeuzme256Wi3eGqvgLfdf9XDOx8qSIWV6Gf80qcFLi +v27r4OQUWMBpX42ebpzvHZSzk4soqDOpCa5L62GeQoZGUxmnxy5r3MSAKBKvEbuZADC ad3cc+Bty772ii3MHP4aLjm1+onx7a/bwZcrHBwge8mJ/OcUwG+XjGkoKO6dAquZJm1I J52Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qxur3Siw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44843-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44843-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. [139.178.88.99]) by mx.google.com with ESMTPS id d8-20020a17090a564800b0029048c85e7esi9569363pji.106.2024.01.30.07.30.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:30:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44843-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qxur3Siw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44843-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44843-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 F0D46288CC5 for ; Tue, 30 Jan 2024 15:30:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE270823DD; Tue, 30 Jan 2024 15:30:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qxur3Siw" 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 EA009823A7 for ; Tue, 30 Jan 2024 15:30:02 +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=1706628603; cv=none; b=n9XNvloDQTyOrHrgfvstgrteBLJKOmKQcL+h2E/2lyQ7/kSd7QBkjgQlqRE3zVH40Dfn5pJWJSCzPOdLdE44TTSmHAJnoiADEaZOYIQfDdAlpNtVdFShS3MHgZ5FnSSpGUwfyMwJRKgNNUoiQhUOhriAko+nsXYHBpfkHAjG1/g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706628603; c=relaxed/simple; bh=80jbZzlmEWIV6mLzBxKiN05mY7enQN9I6AWRUplkQ6w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QNki38YbUkeEx02vHX/SVwkKUnw7M9L/nys4p9V5x9wY9RkNJZzMGFHrK51jejvjk68K882JD1xir+HD2RvFop30itkqSmFlxrWBeisUUK6dGjC5CiWg1L4U0d4zhF2NdHw6m5Lco/A6hVBMbv6gSSwYimH+jMpY1vR/vMp9s5E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qxur3Siw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D852AC433C7; Tue, 30 Jan 2024 15:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706628602; bh=80jbZzlmEWIV6mLzBxKiN05mY7enQN9I6AWRUplkQ6w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qxur3Siw7jzRJYmcS60JgXwxJb0Sdpt8yptfeZyt473WUWurFT5547UMYRNrzsSv4 kINJKoosiEtOq4nv+Y5sphQWwQ90lMMMd4DGOXfpwpWA4RS/1kjSZqEMUTDu7I88/z 7EHxZBUtMks6fxeOE82IGq6eDLiZ30mKRYoa0oMsL3fFnrZbH+Xi1l6zxExCYf7E4D 2nbGglx/IO8CHkyuARQrf60Usr3x/P47ixVuln64dq7rBxUVX9qjKvu3tH1cShJBKx gXv5/d6jYohnF48mx2EvpgjgOiVVE3W4OYFoxlVDQVgYTZ8jSvx7SCVbEUh0mqEe4o 97RzP5ah24olw== Date: Tue, 30 Jan 2024 16:29:59 +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 Subject: Re: [PATCH v10 18/20] timers: Implement the hierarchical pull model Message-ID: References: <20240115143743.27827-1-anna-maria@linutronix.de> <20240115143743.27827-19-anna-maria@linutronix.de> <877cjtcuv4.fsf@somnus> 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: <877cjtcuv4.fsf@somnus> Le Sun, Jan 28, 2024 at 04:58:55PM +0100, Anna-Maria Behnsen a ?crit : > Frederic Weisbecker writes: > >> + > >> + if (tmigr_check_lonely(topgroup)) > >> + return READ_ONCE(topgroup->next_expiry); > > When I hand in tevt->global as a parameter, I'll need to compare the > first expiry of the toplevel group and the tevt->global value and return > the earlier expiry. Only a single child is active in top level, so it > might be that this CPU is the last active CPU in hierarchy. > > I didn't check all the way to the top whether all groups are > 'lonely'. So when the top level group has only a single active child, it > is also possible that the child of the top level group has two active > children... Then a return of KTIME_MAX would be also a more precise > forecast. > > This quick check is there to keep the overhead minimal when checking > whether it might be possible to go idle. So I don't know, if we should > add this additional check per level (which is pretty simple when using > group->parent for walking the hierarchy). What do you think? Not sure. Maybe if the tree never exceeds 3 levels (does it?) it's ok to do the walk? Thanks.