Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2240600rdb; Wed, 21 Feb 2024 01:07:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWOQwq2CQFE5iUlEjt9Z1qV/3nxuZMsxcoHTVCJmG93RGx9mNNXye8tHo1h9BjDkKtcvI5RtSfGIfCvmCSzb5ASfd1mX7K52EmsJ2In8Q== X-Google-Smtp-Source: AGHT+IG90zVrE7EvvZgdXVj5DQg8FZJOwbAj+xafxJzzr+aSE/3DjtdTx/paLHZ9vherrwjz3qld X-Received: by 2002:a05:6a20:c68e:b0:1a0:81ec:27b9 with SMTP id gq14-20020a056a20c68e00b001a081ec27b9mr16701554pzb.28.1708506446048; Wed, 21 Feb 2024 01:07:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708506445; cv=pass; d=google.com; s=arc-20160816; b=a2j2GoxlYRoEIYkJc8HZA6xHqZkSaQ6/XEMvKcyWfcl3cULktTTCacRZqTvuXXuK/g HOAUKs9+rXRQP4hscrVXew3yC8Riq6FaVhSy3ZTxSPm4u1HBUj6Pa5VCescukcStLjsc 3yRGevQGgScf1b69tDrv6aaIMdky67irqLN9s6cYkdag+0pU517rmSt5C3DYBnfy0YK+ t3Vv59dM9CzaPrxjQWzj/bqEjVfbsK2AFJOfE8vzmmdeeaCa+kJPlMSpIjEjfgo5Nfnv Lymjsur8ydAfRyxgnGwfR9eakwcDsfEKjt/CvuYMzC1HADDm7aUps8lHV94WjN3VsyDW Yy8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:dkim-signature:dkim-signature:from; bh=AqA3e23FiOrvTnHWocrTEQRtHmd8ahLc00lmTygo058=; fh=jF6pf1T4w8nC/jaLeIBj6pWxFnEKdE6OeoCUkrV7kR8=; b=QgSXww8FXNV1yUV4NVyBnjd5til802MlA0gYKLlUErGcunUL5TDZ7uOvYoilCOkimg Y4qyrW3v+s7fOkxJHFu+gQd8yPeSVjqPwRDvqfpOuGog30+lsFGB95XpQFxJOJIt7Lmp gEGqx8lhOtUXhSZo/7Y7bEhTc1P//j48rOS/QZYef6AOaN27TyQ/1twyp3Epx2a1jFcn diMf9+chGc1+xUbCa9P28VBM+o7+NUwSWDCy/yBNCWoYoSvVYLWPd5JWL2/YMOXD7AMF /MIknjAp2vcWljvZpVapi/8lJ/QbGvLHr0swFZZg7e9Dap2jRHuLN5XiCEs7ZCPTTXIh Cr/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GhQruKgY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l1-20020a17090a850100b00298d21fd928si1086725pjn.173.2024.02.21.01.07.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 01:07:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=GhQruKgY; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-74350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 75366285015 for ; Wed, 21 Feb 2024 09:07:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E46F93DBBF; Wed, 21 Feb 2024 09:06:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="GhQruKgY"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TizbBauo" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D87383D3A1 for ; Wed, 21 Feb 2024 09:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708506379; cv=none; b=RE/ixYo7oQAxGCfhFirN9Egq0ylrRrZS8aP2uUQBdUhj4aLBboRP15+IVD4jBnoOvMIxCZymuOZ4SFwgkDl/c6GnuqTh+0dJWspmY9hOQOlHgDjnRoc5Jy5+qnjRoBhhxEeThU6nv1/SRuRBHjcF8HcPS8Rs9VEoCZmLRg/Qz48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708506379; c=relaxed/simple; bh=6M52TCV6rNFV1WzKYn148scsFyR2YNgc31imWTJffU8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JC1JXQNhxqY821YawZqQOYT7pQmKm8HcLxvLECxzHP73B9MkhMqWUJgdCbY7JjueAImJ+CGVmG2BoA9vwOYRf51Roac0JRtF0NE50ueLHoZEx8GrPHXuYJG+tsd+Zt37wrlOBwb8GKBO9SQnKBFvO/zQ17m9lKyQD2BO64+CuEY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=GhQruKgY; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TizbBauo; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Anna-Maria Behnsen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708506370; 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=AqA3e23FiOrvTnHWocrTEQRtHmd8ahLc00lmTygo058=; b=GhQruKgYXp9tDYmM14Y9I+xhqF1Q59YA672dmlhTBZp1CJMj7WDPorb8REzcfUCaVe4RIG iffSQqSqPbOLe9b92l+wEuK1oxzdnuHycskTcOuaJKBeDNQAaihXYbZJsH9FF/OpdSxj7y /lrLZ0VAYfujB5Ig174uKx1IIt1GeSPKOzxymvD5k4NzwEFfZv8MoKzsGGsiXYWeImDcwo Wp6RUCyRNcJnGNXnE8t5kTpAUkoSDFqx/RbbfArHfWAFYw5QBHj4fmPgBzoAVm5+qEXmr6 ripng9czy/cvlTIIhAAVhFD/Ait2na426IiQ3hz2tD+2sBkziRIFjBuPWFb1ng== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708506370; 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=AqA3e23FiOrvTnHWocrTEQRtHmd8ahLc00lmTygo058=; b=TizbBauoqo7JHxtaY42PsIlf6HZKEpUo+7SAD3XmsMeQj+oP+89cNahyYm38xfijITDRT6 1uAmPXh7bs63fGDw== 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" , Srinivas Pandruvada , K Prateek Nayak , Christian Loehle , Anna-Maria Behnsen , Tejun Heo , Lai Jiangshan Subject: [PATCH v11 06/20] workqueue: Use global variant for add_timer() Date: Wed, 21 Feb 2024 10:05:34 +0100 Message-Id: <20240221090548.36600-7-anna-maria@linutronix.de> In-Reply-To: <20240221090548.36600-1-anna-maria@linutronix.de> References: <20240221090548.36600-1-anna-maria@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Frederic Weisbecker Acked-by: Tejun Heo Cc: Tejun Heo Cc: Lai Jiangshan --- 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 7b482a26d741..78eaea2e5d72 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1961,7 +1961,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); } /** -- 2.39.2