Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4689800rdb; Tue, 12 Dec 2023 06:52:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6b/jzNLMALAemTJStxMw6XaCuMaIa4oErSdN51sgzP5oTlim7VQQfRR/vFT26KvzxVgX4 X-Received: by 2002:a05:6a00:14d4:b0:6be:4e6e:2a85 with SMTP id w20-20020a056a0014d400b006be4e6e2a85mr7417144pfu.30.1702392754998; Tue, 12 Dec 2023 06:52:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702392754; cv=none; d=google.com; s=arc-20160816; b=HTpxhvRlUNivz60N5J4qRRNWkZnP56tWrivQrbC+l8sUS3nWtiZEFQz33Txdh1zDHX UQSlvAa2HRssCRPNUNbDP0Ycdi1iNCLDmO149WZ2Fi4ZWocGE7P0H5fOaTOAjQS45JKr sa6alPoxFXecSog+1C58vNLN9i3d0V/Huw7I/c/94104pCH1xl3CW6ZcP1W8+gDh39M2 +FI9ZucKCEYJGFNpVqImDfHXfjYLiSM6+glkuDkZctOUnJW0k3HXeQGSVVVcYlg7DB06 Nof3Biw63lFit6LU0ifUjQxZPPIZ5X6nNZh/I8885u607L3XP6KYCsrqd87EILOKJx9k 9TDw== 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=6jl2CgwKBV0Qktq6WkukabpmaDXPHyrDvhtR3X2AQME=; fh=zngDPpHc9IOT4XyfACYkaIQBkMO1o2QUewR15pJChdQ=; b=C/hlc0axhIcL+7j7bYxJo1xzx/q9NXJheo3WwpC07LqR+D5x0jaiIjZyws2p58qpzA QVlXI3Ks77/QuEWEad2NCTVR1HOxp43597ng6479r6zNzMXYN5CEAOZpk0zujv1L5gnR U24tIHNAXguVNidHoA1JqGDdAs/F48YibdtBbw906XWYvskc/fkA64Fb9/5WrOKNso6R RTiRj4RcyV32bPG/sWZ8jOCEZZ/o49O1luW8lCCKIiM+V5SUQQI9pkQNYuRPGO8IhdqT p4aOjtBOeZ7jZ/C8MXCJzVy7N5zMzDH39TJfNu1HPqqkUQg9hB/TdyQU66jRBaV91uC0 4oOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lhwM+Gg1; 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.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id 37-20020a630f65000000b005c690745520si7722844pgp.743.2023.12.12.06.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 06:52:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=lhwM+Gg1; 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.31 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 morse.vger.email (Postfix) with ESMTP id 33A998034AA5; Tue, 12 Dec 2023 06:52:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376939AbjLLOwQ (ORCPT + 99 others); Tue, 12 Dec 2023 09:52:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376901AbjLLOwP (ORCPT ); Tue, 12 Dec 2023 09:52:15 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13F42D5 for ; Tue, 12 Dec 2023 06:52:22 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702392740; 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=6jl2CgwKBV0Qktq6WkukabpmaDXPHyrDvhtR3X2AQME=; b=lhwM+Gg1Nzt7GRTvWQg+PkHUb32pRcGVq5OpIMhm3PRXPHPi44Lsc+8xW4MyOlCNBH8MQ6 6dukKBEc41ZMlUHd3ekc32ccFLqyxb21ydGdizM864V39Uq95+eO0X+GyAjzMwhCqUnFSW OfHAh20FpPfd44Xng1zXxFAIcTabWaJgbtelAzTUZLF8cSw/7t3OImwnoMhLjc3DcWv+3i lTxQBUWYhtyywK/NAy3G9Yi9tOStCbsJGoTR9gPz+JVxZNyX1SKWuKEGCL6dz2JQQnEzvB rX7heWj1vcf9CIHPx95b3h0HeRQu8VqJpW9szSk9JFf6vzpjV3ll6lBneUSCIQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702392740; 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=6jl2CgwKBV0Qktq6WkukabpmaDXPHyrDvhtR3X2AQME=; b=RbhaudChB16gmCKyWqTxvZjfI8vjVZyf/Y9yzGGeMvm9aEGb6Z/wCXHvkTZRWhZJlFEhuO +15dqCRqujqEKNAw== 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: <20231212121404.C2R9VWj1@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> <20231201092654.34614-31-anna-maria@linutronix.de> <20231212121404.C2R9VWj1@linutronix.de> Date: Tue, 12 Dec 2023 15:52:19 +0100 Message-ID: <87y1dzlbh8.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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 06:52:32 -0800 (PST) Sebastian Siewior writes: > On 2023-12-01 10:26:52 [+0100], Anna-Maria Behnsen wrote: [...] >> diff --git a/kernel/time/timer_migration.h b/kernel/time/timer_migration.h >> new file mode 100644 >> index 000000000000..260b87e5708d >> --- /dev/null >> +++ b/kernel/time/timer_migration.h >> @@ -0,0 +1,144 @@ >> +/* SPDX-License-Identifier: GPL-2.0-only */ >> +#ifndef _KERNEL_TIME_MIGRATION_H >> +#define _KERNEL_TIME_MIGRATION_H >> + >> +/* Per group capacity. Must be a power of 2! */ >> +#define TMIGR_CHILDREN_PER_GROUP 8 > > BUILD_BUG_ON_NOT_POWER_OF_2(TMIGR_CHILDREN_PER_GROUP) > > Maybe in the .c file. > in tmigr_init() ? >> +/** >> + * struct tmigr_event - a timer event associated to a CPU >> + * @nextevt: The node to enqueue an event in the parent group queue >> + * @cpu: The CPU to which this event belongs >> + * @ignore: Hint whether the event could be ignored; it is set when >> + * CPU or group is active; >> + */ >> +struct tmigr_event { >> + struct timerqueue_node nextevt; >> + unsigned int cpu; >> + bool ignore; >> +}; >> + >> +/** >> + * struct tmigr_group - timer migration hierarchy group >> + * @lock: Lock protecting the event information and group hierarchy >> + * information during setup >> + * @migr_state: State of the group (see union tmigr_state) > > So the lock does not protect migr_state? Right - this is not required due to the atomic cmpxchg and seqence counter. > Mind moving it a little down the road? Not only would it be more > obvious what is protected by the lock but it would also move > migr_state in another/ later cache line. > Where do you want me to move it? Switch places of lock and migr_state? When I put it to another place, I would generate holes. A general question: Is it required to have a look at the struct with pahole also with LOCKDEP enabled? If yes, lock should stay at the first position. [...] >> + * @cpuevt: CPU event which could be queued into the parent group > > I don't know why but it feels like s/queued/enqueued/g > But it might be a British vs American thing. I think this queued/enqueued is not used consistent all over the place (in my patchset). But I'm also not a native speaker and not sure which is the proper one :). Nevertheless, I'll change it. Thanks, Anna-Maria