Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1973891rwd; Mon, 15 May 2023 05:49:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ZjFYMGOHyKWGeQGMYZMeP6YefpCcA7yXm1/a78mcVPaVHd/lX/STM41RCDg+jnL5bK+vy X-Received: by 2002:a17:902:c14b:b0:1aa:fdab:24a5 with SMTP id 11-20020a170902c14b00b001aafdab24a5mr14234933plj.10.1684154989240; Mon, 15 May 2023 05:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684154989; cv=none; d=google.com; s=arc-20160816; b=sXmrioZnBYCy60DWuCpASSkjHUjlnD6EfG2mb6kf8OHknYNgXs5CF8F1cpV3iMBu99 GlZ+n87ZPLqU5iaIEYrtjPp+VV4L3a5FwsJDb/O016JOuO77gHs1zOFkV/05VbyLfWD/ MKqmHDzvGdLB9m2xO34R54HvJK7fhSjZdlhpgp0BaHVoUzc48WBuoGfBBil/9ba7TRxB CegNjkxn4q0rdZDVm1aANdDjPZ0yiEF0h9yR6VKHnVvJhrHmyu29KKlKr5Dgh5bkNnCc GWOl++j3ilAuflPRGVYa3jHVoHvYrifbkkX1iw+qN7fvKGnmEN/kqyXc7xfkCguQNRcg S13A== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=vgnJRr+6tGl+ERH0LB9f8Zux5UNbJl7YXqeiYA/30IE=; b=btmpBIhzTuUexP8DO1ssss0xhqenqceIhx1TbDs+WnNyzM+FnlHCEw2k5IOn3OEhz8 CevN/wm9cuT8KaJBnI40xDrJ4jZS/b1ecHk8PSwghUrBhG+QiG8jmyiguI06/8LJ60AG UMs7ZHwcmTyZO3bHovIJA6yn1WJvVYGdnqaIxJ434IUWwjKJfs0kU31nPxox7QuMvDbx dDyB1Y3fw3NB+LraqJnR6yBLQlwfbrF6sSGD4OqQr8uaDWca47SXmyyFbvSuUj1HpfXN T8j8+WQzWaOPB/SW6OjcN4KrPOyWT8BeHll6qo2NdSzOJPT1T0HxxeA4osP30I83dKLZ tG1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oKZwlskC; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z3-20020a170903018300b001ac671a8fd3si17198574plg.110.2023.05.15.05.49.34; Mon, 15 May 2023 05:49:49 -0700 (PDT) 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=@linutronix.de header.s=2020 header.b=oKZwlskC; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242013AbjEOMmr (ORCPT + 99 others); Mon, 15 May 2023 08:42:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241850AbjEOMmX (ORCPT ); Mon, 15 May 2023 08:42:23 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD0BA2D7C for ; Mon, 15 May 2023 05:41:37 -0700 (PDT) Date: Mon, 15 May 2023 14:41:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684154495; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vgnJRr+6tGl+ERH0LB9f8Zux5UNbJl7YXqeiYA/30IE=; b=oKZwlskCvODDO+onukDmXNxXzcEM3URrTRcl2AthHNxatCIY+CoysWqDqANSNkHOp8nks9 /cH1LEWU6sQERzNJhO0nKJuTfM0utzDcxo9DdmC2/Wp2pq3cTgigp75NNQHLXKfQt1vFt7 3uz800KdHxTmfY9QuATeUFW+28DF4gi2LvzDf7NOTX/YvxXlhv7Fe6vH4Iz6n3kS7es/hf lr2h59YrYF4jzheRni8EmX/XO/nHJ4wp2oY+U7AOtXlVlYts5ElLOmb7jLor6mEgs8rUZz WSKhnc3I7pmt+yskDAef27rY7RZjNYnCPyVNMsM+WH+p5PqCR5AIcZxdaFsKDQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684154495; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vgnJRr+6tGl+ERH0LB9f8Zux5UNbJl7YXqeiYA/30IE=; b=B/4eP7Y7N/fOcO94f9BeJYY3w7EBFS6G91vB6zua+Sm0NDchJcXUH0Vvl47vb7DkNpeYuF 1YiqdAkxAN1dptBw== From: Sebastian Siewior To: Anna-Maria Behnsen Cc: Frederic Weisbecker , 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" Subject: Re: [PATCH v6 19/21] timer: Implement the hierarchical pull model Message-ID: <20230515124133.XkKOksjW@linutronix.de> References: <20230510072817.116056-1-anna-maria@linutronix.de> <20230510072817.116056-20-anna-maria@linutronix.de> <20230515101936.3amAvw0T@linutronix.de> <398d7731-f5ca-a34-9e4-77da60c49d21@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <398d7731-f5ca-a34-9e4-77da60c49d21@linutronix.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 2023-05-15 12:50:25 [+0200], Anna-Maria Behnsen wrote: > The part will be replaced by: >=20 > ---8<---- >=20 > local_irq_disable(); > timer_lock_remote_bases(cpu); Do you s/raw_spin_lock_irq/raw_spin_lock/ in timer_lock_remote_bases()? Otherwise you disable interrupts twice. Not wrong but not needed. > raw_spin_lock(&tmc->lock); >=20 > if (!tmc->online || !tmc->idle) { > timer_unlock_remote_bases(cpu); > goto unlock; > } else { > fetch_next_timer_interrupt_remote(jif, now, &tevt, cpu); > } >=20 > timer_unlock_remote_bases(cpu); The locking, unlocking and fetch_next_timer_interrupt_remote() is only used here. So it if it wouldn't be for tmc-> then you could do everything timer.c in once place=E2=80=A6 > -> do the preparation and the walk >=20 > unlock: > raw_spin_unlock_irq(&tmc->lock); >=20 > ---8<---- >=20 > As menitoned in the reply last week to Frederics objections regarding the > locking asymmetry, I would like to keep it to make the locking region of > timer base locks as small as possible and to prevent holding up to five > locks during the walk. This looks okay. I wouldn't suggest to hold the timer_base::lock or tmigr_cpu::lock longer than needed. Both can be acquired independently cross CPU and have explicit locking order. So it is fine. > Thanks, >=20 > Anna-Maria Sebastian