From patchwork Wed May 24 07:06:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna-Maria Behnsen X-Patchwork-Id: 98343 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2653614vqo; Wed, 24 May 2023 00:16:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Ob1vAcDxRkedc3RrlpZ+THln1uoQ6c/FDitCXa03xewQL1lzulRG3KrlUqfBExQIiuTIi X-Received: by 2002:a17:903:1212:b0:1ae:2013:4bc8 with SMTP id l18-20020a170903121200b001ae20134bc8mr22993344plh.18.1684912590172; Wed, 24 May 2023 00:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684912590; cv=none; d=google.com; s=arc-20160816; b=Z9AvwOoWWc9mhKEXSx/AID6KzihbOyG2zrDeysBbYD6k6nNryb9SDlU66eqiBBcrRl Q1jsbG2lgTPK/eswZOATjlO8UvIyC8GA+3o9tjOUzwO3FfTlICPpezFjdAwoKdEYVUcc fgr5vx+SdhyliTo7OpQdS8WTsrQoQwrEJKB+eqVyP2LC5U/v+gmIMOB2HUUcx1rzZadI qXKlUbZSKXCX+Br/ngs+W36O8289em1yqVNaQXjMNLA3dE4hnqXwa/7QOqnVroWKnYQB zdxIiGat6m5jJ5gZsW1QwM2TrWT2hUKwblR/cWrVnCPz6APPysNtGajvvF3bXRBiupER FukA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=34NWQ1poL6YfGVQCYFvWaIp9I4PRyjufILSdpMSdq8I=; b=DdObUAA0G5k8g0tNh1LReesY9RIB+JIyVJW4LoWI6OOC+saEtZNxYU/4QjZSuXXI66 qCIne1sln56zzrFDMNfab5wmYUq8PpW9oQKg7jcTFhbKaddgGr+VsJ6SyrcnSJ5RoubE 0jcpCEYPi/tvYHPpqgLLmBvB735KQHekaft55XAqjwRg0yE6pKI7q55Hpy28syDMPxV7 Fjrlj5+ax8inK69ThhwjqBNAsmIxmqvAHZOh1O1PHk8Lal85tiJsfyGtYEGFM3tatINs wfapb5ZEo/6JKucuLCbzeQBFEJVQdLjcNs4O1UZlECM9GZdaOusW/BpUCbjl692hsMXY TiUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="b0CxIr/e"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ja13-20020a170902efcd00b001ac6189cac3si517255plb.187.2023.05.24.00.16.12; Wed, 24 May 2023 00:16:30 -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="b0CxIr/e"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S239480AbjEXHHc (ORCPT + 99 others); Wed, 24 May 2023 03:07:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239805AbjEXHHE (ORCPT ); Wed, 24 May 2023 03:07:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17DD1135 for ; Wed, 24 May 2023 00:07:01 -0700 (PDT) From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684912019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=34NWQ1poL6YfGVQCYFvWaIp9I4PRyjufILSdpMSdq8I=; b=b0CxIr/eDi7egiRgaO88B9iIMrYhC2oCP8QM9QFMTljCWr3b/SAu9H/ktLSpYe+gctT2SG Tn4sewlgqeGYOazdRxIvHWh6+8X6eItg0Kf/cI4mvtqAvXkiHZhWvWQEMnBJxzR5vwoil0 +iMklh0Hp5g/cRdda6WkU/9S2HLz29/27jmg4ib+HwyMkVWsFl39rXteCcdwZ5s4aUKSe/ 3DL8raHqRJKNnXH8k8XHaAyzZjU/pDt0UruNUDyDp0aOwV6ihV9SOSIpXX0IPubRu3EWZ7 LVmUYa6nyVWgH3v5FXpr1ql+/wttAl5m2rRcHw35zcT3NB1pgnGp50gGLg8W3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684912019; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=34NWQ1poL6YfGVQCYFvWaIp9I4PRyjufILSdpMSdq8I=; b=VTB7vrBFMd3rbSh0hYDYptblqNxtbsEGLe4RDkTRIKRbkDlN19M19dXy3qcy+OTUInonDE G0iIl+GZOkU7UoDA== To: linux-kernel@vger.kernel.org Cc: 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 , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Anna-Maria Behnsen , Tejun Heo , Lai Jiangshan Subject: [PATCH v7 08/21] workqueue: Use global variant for add_timer() Date: Wed, 24 May 2023 09:06:16 +0200 Message-Id: <20230524070629.6377-9-anna-maria@linutronix.de> In-Reply-To: <20230524070629.6377-1-anna-maria@linutronix.de> References: <20230524070629.6377-1-anna-maria@linutronix.de> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766758903952634609?= X-GMAIL-MSGID: =?utf-8?q?1766758903952634609?= The implementation of the NOHZ pull at expiry model will change the timer bases per CPU. Timers, that have to expire on a specific CPU, require the TIMER_PINNED flag. If the CPU doesn't matter, the TIMER_PINNED flag must be dropped. This is required for call sites which use the timer alternately as pinned and not pinned timer like workqueues do. Therefore use add_timer_global() to make sure TIMER_PINNED flag is dropped. Signed-off-by: Anna-Maria Behnsen Acked-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan Reviewed-by: Frederic Weisbecker --- v6: - New patch: As v6 provides unconditially setting TIMER_PINNED flag in add_timer_on() workqueue requires new add_timer_global() variant. --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 4666a1a92a31..5c529f19e709 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1682,7 +1682,7 @@ static void __queue_delayed_work(int cpu, struct workqueue_struct *wq, if (unlikely(cpu != WORK_CPU_UNBOUND)) add_timer_on(timer, cpu); else - add_timer(timer); + add_timer_global(timer); } /**