Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4575571rdb; Tue, 12 Dec 2023 03:43:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IF438YTCS7SgzPtytJnW0MU7p68Lb+oAg1v2vdvGYz8cxRZJ376uw+B8gxT3ZZ/E3Qcl9zo X-Received: by 2002:a05:6870:724a:b0:1fa:1db4:5923 with SMTP id y10-20020a056870724a00b001fa1db45923mr5830676oaf.43.1702381421093; Tue, 12 Dec 2023 03:43:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702381421; cv=none; d=google.com; s=arc-20160816; b=LnYtesaKa3xtvj9XqhHvWlzY1XvGF6mmVfantSeT78ketOOJP/wMDZYmVBS9TvyVRT ErUZnEU3jv6TpD0yapeh3y7a4lq2GHgZ238D6btXT2dBgkQlxFOjPjlhUbjbGBuZlLRD w2dtkGuvbIMgvaNdFNsaWZhXmp+WO/UeObpCSqlrSbofWya4Xpw20emRoe6jPjuyNbbj 9t829scNCqfSq8x2iA0DURzyiMHFC0GPO4uQ4LIJ7+HBwNfIU+F3pdUL870yBAURU30E P8/m0Ss/tuKw2zyHBpbOP/Tw/w6k3meZuw8XVVCt2fhvsKnRBjon7/pLQX1l8A7bvQeu +omA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=0f0NLMhcX0Ji4stoXsgRQnnGmOpz8MKcblkO1WoOzEo=; fh=zngDPpHc9IOT4XyfACYkaIQBkMO1o2QUewR15pJChdQ=; b=oPJswY57BkL1GYQMhkTos33ir+PV8Dd7TreqhK5eKh/lkpCkiaq+ll5oKpJajf/XKg JpDwqwBnzXLDKKENjhvyuIdBX6nkigDATs7X+uopBP0gl+xW50FF6VlHsCUzRYvWqMmJ rEqGqvri9kPlD5g2uLnbOnRFwYkeE7QjNoWgqov62RyMDWg2/31zvft0u/uCLMKp97hf fWcGwTllT0jSa75+nyPuzcATeSHvURPhRtnHWiw0n6mWKm0Gr8THLe+pJVWtgW1WPoxO XABYfZnfxR1YfKeRbveIHgbzhRAfzV23ooBDoVc7MMlzJv2wl0tOcHJxb04bktWOmnhx I2Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="40MlXI/D"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a8-20020a62d408000000b006ce65842c57si7553198pfh.130.2023.12.12.03.43.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 03:43:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="40MlXI/D"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 6C5D38051AB1; Tue, 12 Dec 2023 03:43:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231984AbjLLLnZ (ORCPT + 99 others); Tue, 12 Dec 2023 06:43:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbjLLLnY (ORCPT ); Tue, 12 Dec 2023 06:43:24 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 956DBC3 for ; Tue, 12 Dec 2023 03:43:30 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702381408; 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=0f0NLMhcX0Ji4stoXsgRQnnGmOpz8MKcblkO1WoOzEo=; b=40MlXI/D3H2TaKzrjasYs/fhgZ3KMPOMwzCR866j9UG2+uVEvSEUFAsPdC14wk+r2277pa r5jMitaudCevQK3D6Xy+V20YtDWw/OlrBEUg0f17ndHwofcmehIFYKZF0wXZOVwVX3DdRs nKYp5Lni1Z1KZFulOeWVYfVAXVOOXPPpyfowDdoPrHzznjLZPR5eQSnKOnP2N+pVSb60pV YuJLNtGqlgKGO5vHvmtfawn7GHZ5SPqOG2gLfK4M4jdhPr8gS/6Qy4oQP9sWyVG83U2Wcw 3F5mHxzQEnVlRIQheqGb9xj9w10+iEhcAqBcD3Qt0ypHsZ95tdhbyZN3vLXdBw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702381408; 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=0f0NLMhcX0Ji4stoXsgRQnnGmOpz8MKcblkO1WoOzEo=; b=MHTCbyyQ20c/BMVu0vQjWEkmMjsM6+FRAGWyiydpbUhQET/ZC60zBu/ss6OolxE+EfP3oF EkoYTCcnNVdMHeBA== To: Sebastian Siewior 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 30/32] timers: Implement the hierarchical pull model In-Reply-To: <87h6knmzco.fsf@somnus> References: <20231201092654.34614-1-anna-maria@linutronix.de> <20231201092654.34614-31-anna-maria@linutronix.de> <20231211180417.XG9G3ryS@linutronix.de> <87h6knmzco.fsf@somnus> Date: Tue, 12 Dec 2023 12:43:27 +0100 Message-ID: <87a5qfmysg.fsf@somnus> MIME-Version: 1.0 Content-Type: text/plain 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 03:43:38 -0800 (PST) Anna-Maria Behnsen writes: > Sebastian Siewior writes: > >> On 2023-12-01 10:26:52 [+0100], Anna-Maria Behnsen wrote: >> >> This whole thing confuses me. >> If the CPU goes offline, it needs to get removed from the migration >> hierarchy and this is it. Everything else is handled by the migrator. If >> the migrator is going offline then it needs wake a random CPU and make >> sure it takes the migrator role. I am confused by the whole ::wakeup and >> ::wakeup_recalc thingy. >> > > wakeup_recalc is required to indicate, that the CPU was chosen as the > new migrator CPU when the last active CPU in timer migration hierarchy > went offline. > > When a CPU goes idle and it is the last active CPU in the timer > migration hierarchy, it has to make sure that it wakes up in time to > handle the first event of the hierarchy. On the normal idle path this is > not a problem as the value of the first event of the hierarchy is > returned. But when an IRQ occurs on this idle CPU, the timers are > revisited again. But then it is also required that the first event of > the timer migration hierarchy is still considered, as the CPU cannot > make sure another CPU will handle it. So the value is stored on idle > path to tmc->wakeup. Otherwise every idle CPU has to walk the hierarchy > again after an IRQ to make sure nothing is lost as the CPU doesn't know > what happend in the meantime. I'm aware, that it is possible that > several CPUs have the same wakeup value when there is no new first event > and if the hierarchy is idle and some CPUs become active and go idle > directly again. But if we want to cover this, we need a single point > with the first event and with the last migrator information and I'm > quite sure that it will not scale. > I forgot to explain one thing: A CPU does remote expiry and it is possible that the CPU is idle in timer migration hierarchy. Therefore the wakeup value is updated at the end of remote handling with the new first event of the timer migration hierarchy unconditionally. Thanks, Anna-Maria