Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2523793rwb; Mon, 7 Nov 2022 14:29:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM5gJRMasEiOGhTmhQyHVdaBtHyCuYMFUd9g0hCtZCRMDlW1J5dnjMRhSoeugRdY85RW2eaw X-Received: by 2002:a17:907:d04:b0:76e:e208:27ba with SMTP id gn4-20020a1709070d0400b0076ee20827bamr50978939ejc.652.1667860168961; Mon, 07 Nov 2022 14:29:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667860168; cv=none; d=google.com; s=arc-20160816; b=pTQz8m5voApYxF1MvPfK+O0Zb09FYnIN9I1q4rIxaJ4nE1yqVQVA3nCXWgsGKUjMta M8n2TJ04YvJl46ZBH7acOG9eF+iG0LM3+uB/MPcMJtxAGPOw/gTKeA7PEpJqkck3ku32 nkV7xU7nYGs2mFE3qBM+qNjvCSa2NWhiZAt/kpD6qaG+Mz7/zTMRxu79TB/eec2E7Imf rWksem4oG6NgzC6oTztsffvvAxo2z5PxkvDHoFyC2Y0HeKrneddA7k764az1H3UMQ+XE LEQHZRUuEwLUcbAoJYGFZj5Lnlbov14W7s74mOjsxSX4DIHYgUeEsnPuaOSNc1JhS5+i qDlg== 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:date:dkim-signature; bh=AQ9cb4Y55/qquGd+Rr+DGSZhXh5/hb0HsW2HwDAKZFA=; b=lt0vnFjnam4UB5EikKG0ubrBZw7l2nAUcCpmB0U995LxS8UOg83bwKWgwTYHEa9thP gtYcgOZ5Y7JlllkjCguAmV79fVG+cRQSh5QPOPMzmUwaC6izGlIVmJ7FDWfE6za/bDJx wCqVwohvfxtzbPZ3/yK+vXg+LRGgKqlEW8OBPRV6Q9l7oa704wi1TNlLBZZexQ7UTIQQ yCHMAaz3gUKX0MoYv4XtmY+X339wbpTSZF40klfWofVWuB7EqouUT5oig871QkxEfst/ xCy9/kXg4E4IyDM8xjjGhtkwbwBkwOuUrh5Wk/OgcSgaOkmTSB4+CTgH7ydVpcXMYp+4 HlDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V73OYOL3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y3-20020a056402440300b0046627848e1fsi10443298eda.630.2022.11.07.14.29.07; Mon, 07 Nov 2022 14:29:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V73OYOL3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232018AbiKGWHe (ORCPT + 92 others); Mon, 7 Nov 2022 17:07:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231965AbiKGWHc (ORCPT ); Mon, 7 Nov 2022 17:07:32 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9462E1005B for ; Mon, 7 Nov 2022 14:07:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 31BFB612ED for ; Mon, 7 Nov 2022 22:07:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1559AC433D6; Mon, 7 Nov 2022 22:07:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667858850; bh=PvXRjaQGHtWIn4xfTEp+b3M0cMG924oUav4IfnO8WNw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V73OYOL3KAmCMoCN68zRllLyuD1x4y322Wc18vI/ycUEI4Vpnn3Eg1W17zUzNuJQV OtLNnxaE4/Rip/U/5gRS6m8HHANTKhxwoosiaU5EytMjvv10MGXlLFSGb1PEqZ345X 6bocjMbdAeq+nB1yxCrZZpUiZaw8Ng+spdthWWoKg1BquNxS9/D8hbu3VSQQ8L8iFf 4xoEhVb+DIdpnk3sVaqxNaMwFs58hJqPtngAdq3BhwJ9fLsA/kQBsk9yFc5sXyeEAE Ra9u4br2RZrb92AMKfAh84c105Ww4eUdAkzDSShPGf2bMgdHE0CQCXeqvKLxEezS7e YqWoe68R9V2gg== Date: Mon, 7 Nov 2022 23:07:27 +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" , Frederic Weisbecker , Rik van Riel Subject: Re: [PATCH v4 14/16] timer: Implement the hierarchical pull model Message-ID: <20221107220727.GA10939@lothringen> References: <20221104145737.71236-1-anna-maria@linutronix.de> <20221104145737.71236-15-anna-maria@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221104145737.71236-15-anna-maria@linutronix.de> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 04, 2022 at 03:57:35PM +0100, Anna-Maria Behnsen wrote: > @@ -1859,6 +1863,36 @@ void forward_and_idle_timer_bases(unsigned long basej, u64 basem, > */ > is_idle = time_after(nextevt, basej + 1); > > + if (is_idle) { > + u64 next_tmigr; > + > + next_tmigr = tmigr_cpu_deactivate(tevt->global); > + > + tevt->global = KTIME_MAX; > + > + /* > + * If CPU is the last going idle in timer migration > + * hierarchy, make sure CPU will wake up in time to handle > + * remote timers. next_tmigr == KTIME_MAX if other CPUs are > + * still active. > + */ > + if (next_tmigr < tevt->local) { > + u64 tmp; > + > + /* If we missed a tick already, force 0 delta */ > + if (next_tmigr < basem) > + next_tmigr = basem; > + > + tmp = div_u64(next_tmigr - basem, TICK_NSEC); > + > + nextevt = basej + (unsigned long)tmp; > + tevt->local = next_tmigr; > + is_idle = time_after(nextevt, basej + 1); > + } else { > + nextevt = nextevt_local; That else part look unecessary. > + } > + } > + > /* We need to mark both bases in sync */ > base_local->is_idle = base_global->is_idle = is_idle; Do we still need to maintain base_global->is_idle ? (I'm going to do daily reviews on this patch because it's quite dense :) Thanks.