Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp885126rdb; Wed, 6 Dec 2023 02:48:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGaALO1hb3CwQwXA/QStDjIjok5knQMufIA3V64x4gbH/NERFAlirBv8OxCTUZDaXXQ4mre X-Received: by 2002:a05:6a00:3390:b0:690:1857:3349 with SMTP id cm16-20020a056a00339000b0069018573349mr709931pfb.25.1701859686639; Wed, 06 Dec 2023 02:48:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701859686; cv=none; d=google.com; s=arc-20160816; b=QMvHrI5Cmbbr3YyNASVsE4tFJS7anrQYKMgSOYQfcRlp2RPrXs7SctwULbGtXPizQt MoSqzjrutuLq15qFU/HJgub3cRn87OOhcFdHe24dWK2Jd0F+P5GmsCTETyXQm9zLlZsr UIbUTOzKv9QgCo6bWGU/eV2UQX5ocjLksoRlfiGvyeawpp+9m+wDgIwYMsBWTbXH/0AT IimQUwybH0ovMS5BLn0v36foyPQqohdYkUT+vFASpnLfYt/PN3QT7Dfq/+WxBkSuayur 8mMDMuaFEAjV3KO6gz6vIJEJuidApHGDw0LgYJJz+LEK1hjzc5ukYu5vOXS0feEUFuNh WdoA== 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=9aRQq+zieE0m16GYSiYxRfSkKp588OkR4iM+AM0LTZ0=; fh=zngDPpHc9IOT4XyfACYkaIQBkMO1o2QUewR15pJChdQ=; b=QLMGZdQmaEtbPqn86vU+n9+1qG/ozabKoEhUeCLA7BM4X5jRHfB6yRkx0lIbA7JmJ+ 5Dx06PdceQ1IhZixdXin2+jmoFBuU6OeOiyEziZUuMuo3v59xJqE5UsV8CCAn3PJmI+8 k0mU16jWpOPgoiFX45Szb4T0NJ9Zp99EB5HYIfA/xEhdhL0NWPuwebElSXeC4i0nWS+f Peg/64jgybO96w4AHaee0Xi6PvlOZRJ5Xeg6RANbJHeTfdSomL6m40ZM5rvzRx4BFUEV /wbyDjB02qPcFvnuSC65OSYb4ryRoo33lUhMuU2ZvaH4HfXtlIy7homG+YvanPk04iq7 BA4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=daGyl5Vy; dkim=neutral (no key) header.i=@linutronix.de header.b=9+gfpkTJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d4-20020a056a0010c400b006cdeb7e9f6dsi10967888pfu.234.2023.12.06.02.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 02:48:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=daGyl5Vy; dkim=neutral (no key) header.i=@linutronix.de header.b=9+gfpkTJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id CC70180BB532; Wed, 6 Dec 2023 02:48:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377818AbjLFKrm (ORCPT + 99 others); Wed, 6 Dec 2023 05:47:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377809AbjLFKrE (ORCPT ); Wed, 6 Dec 2023 05:47:04 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 168C01BD for ; Wed, 6 Dec 2023 02:46:38 -0800 (PST) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1701859596; 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=9aRQq+zieE0m16GYSiYxRfSkKp588OkR4iM+AM0LTZ0=; b=daGyl5VypH7joHf/rofXPAZeTeKFcgMRnHGDjGBXsqwZT3NxInsXjZb/F/wIk/s90YYw4/ j/IgYuAh3ctW/N6MiBQNf2ldPLz5STmtCJSrBDoBtUzZMrWWCC66CI1q54IZkyNGBb5q0K 4HAt0kni+m7RkaQwFXE1wI5dGSTEhICj+uIO9QsBE4kP6nD4YivWiL58FmzJ4mvWIarmNJ PIniTd0SiTFLSl8+l5fjKeYKsyRUO+Olt6Tu3M0QAtCYrsX8LlDcdqPc3/gifDf9XbFthS /lEvZwpKALrimrKdYvbS0Xj1kPXx850Bfj2S2jgBPosfx9vXnMiwKeG19kLVPg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1701859596; 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=9aRQq+zieE0m16GYSiYxRfSkKp588OkR4iM+AM0LTZ0=; b=9+gfpkTJI4BGoTGc+DOYLrCMyDLyckc0OSfLz2vGRprRatpqAjJM390rXTRDJ5/QYZWlub 64Vtn+3fuKkKD6BA== 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 19/32] timers: add_timer_on(): Make sure TIMER_PINNED flag is set In-Reply-To: <20231206102629.auU8wCDH@linutronix.de> References: <20231201092654.34614-1-anna-maria@linutronix.de> <20231201092654.34614-20-anna-maria@linutronix.de> <20231205182924.SFCmSKXe@linutronix.de> <87o7f3ejq2.fsf@somnus> <20231206102629.auU8wCDH@linutronix.de> Date: Wed, 06 Dec 2023 11:46:35 +0100 Message-ID: <8734wffw1g.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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 06 Dec 2023 02:48:04 -0800 (PST) Sebastian Siewior writes: > On 2023-12-06 10:57:57 [+0100], Anna-Maria Behnsen wrote: >> Sebastian Siewior writes: >> >> > On 2023-12-01 10:26:41 [+0100], Anna-Maria Behnsen wrote: >> >> When adding a timer to the timer wheel using add_timer_on(), it is an >> >> implicitly pinned timer. With the timer pull at expiry time model in place, >> >> TIMER_PINNED flag is required to make sure timers end up in proper base. >> >> >> >> Add TIMER_PINNED flag unconditionally when add_timer_on() is executed. >> > >> > This is odd. I have some vague memory that this was already the case. >> > Otherwise all add_timer_on() users without TIMER_PINNED may get it wrong >> > due to optimisation. >> >> Which optimisation are you talking about? Are you talking about the >> heuristic for finding the best CPU in get_target_base()? This heuristic >> is not used for add_timer_on(). > > Yes, true. And nobody probably mixes add_timer_on() and mod_timer(). Workqueue mixes add_timer_on() and add_timer(). But therefore the add_timer_global() function is introduced in patch 17 which drops the TIMER_PINNED flag. In patch 18 the add_timer() in workqueue code is replaced by the new function. Thanks, Anna-Maria