Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp791320rdb; Fri, 2 Feb 2024 04:22:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHI3efbMx7pOFCIZyO7jAB8ENCv9+vKp+DGm/onl0rQoOOI1XAepxnquPd4wsL/ymKB3HNY X-Received: by 2002:a17:902:c94d:b0:1d9:5038:f10f with SMTP id i13-20020a170902c94d00b001d95038f10fmr2911037pla.46.1706876525429; Fri, 02 Feb 2024 04:22:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706876525; cv=pass; d=google.com; s=arc-20160816; b=pRI8WNfz6fPDMeeMjg0WjL30XAY08xJi9d/aCUVO68QqiwZQ1/mSIHaUSD/2PhkAoB SO/USzK3mHPSxb3ZGr71QbCvhgj41FOU8w/Arg+v/+xRZy08nHVQXfI2TIrZjG24qkG+ KCjKJrNUe7tbFftbu91j+cax3CW3rfG2f2BnyxI6CuC4RGqZSflLMYO/wxuYiesxxHeA VFvSOK2lpyYVnTmDtglH0+UpoR74cO3aFTfATcSD+CudQjJhPwb3BK8IrKMO5CTVTa9k +s+t7sM+8b1x9CxUmEDON+fLeBHHDsynb30Dl3XjgECMLZ/0qBb+fg8o/1qttX+KsjWw Hjgw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r1JZNCSSygmr6p+LY19TKBeq44nZPRouGl3HIxw7+ws=; fh=aH+zcuckFYtDE9PQtGnMzhQwICZJuY7yRPfz1Dp0tCA=; b=bAhmSnEJrjm5anw7i88hMfeI6eN1ViuUnz24tplKbTxu4NHSME8ZYQkfPWOIz9+S/V LFPmJh/xqBXMA8gKqvESkMbS/odWnCY1OvWdDwAER66Z2YuotnvG31C27emGYXiicLzN b0nglUxNa7RFN/P42WNMS46oq56tciJkIk9Le0RX1RDqic79QB9wEw4oTqpMRdKMmWwd Lw3yt6JtziZVAEejz9LKVeoRW+cLhOtHs65M6TVlpkZXYLKbqPpXYCJ5irglsYubcOl8 bAK5xb42Ab/0f0+ZKK+gORtdvk/RdrHFtmhD5UuROxEW15exIZJG1y8UVvggsDqKvNeM YxbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ozg1bor9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWFdpj6vqud1kdEKYJsEoQkHYd1BMIaOq03+tYCzfMraxvHdDoFOi2/SDDcE2jBhsXuViHypaycQ8AUgS9bmDlHgyI0nzvTlqSpa1wQxg== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ju24-20020a170903429800b001d8ead4fbfesi1618162plb.191.2024.02.02.04.22.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 04:22:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ozg1bor9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-49807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id F3D36B213B8 for ; Fri, 2 Feb 2024 11:57:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A28B13E220; Fri, 2 Feb 2024 11:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ozg1bor9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 960CF13DBA8 for ; Fri, 2 Feb 2024 11:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706875068; cv=none; b=iFrrYus9Kg0M3k+YnNxENlVRxQPtoUlGSDxvB4xVM9Vc+9EjikTwpMV8bDkVS42yD7JSQ8ENJWJo6ew+OpHtMAm06ak4qj5G8UND9MC/h5syUAmNRLVQtQCxRPbfAzxQsak3nuDv1uUxacmdD10xRvVU9YKKYmDlSlT+SgIqEF0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706875068; c=relaxed/simple; bh=rYvumnDSMWSCXcjlFfDUjse2yjBUSHNWfG3QaEAz+hs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T4siu4J7iHu1PjBfYr+RRFOni2qOh1UifcIolSUkYxiGKWmpCuhLxQYADEYrXeFIJFfZHChLb2PjQfSgQbaKwJ5js46c0MecUfOI64dClIroAddRVCoiZbS4JciMu6sSgI3vewqeDyY3LYVFn6qmpIELPSGlLAsXhBxV6DOcsbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ozg1bor9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70AF1C433F1; Fri, 2 Feb 2024 11:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706875068; bh=rYvumnDSMWSCXcjlFfDUjse2yjBUSHNWfG3QaEAz+hs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ozg1bor9R/Exbfah1bTIQkQBVs3+kTsw76FfouDk7nJlhwfDjBjpMbknwiUo+VYuz d/1/KdHPBLtVGELDJ4/mCeNRdPxUKGHsKkVw4/pQRUAYKzgcqNbh74xE+IJQe+g5/h iZ/KVBTTeYEz0ZPvTcJ06hY5+9kqGWGi2daf/+fenJXftSsEdGU9JoAQBTZne5ppNi fDXBvINtLIn6lDfDTu+Co1xVkkLOXpwJhPlijqDeVFqHhZDOAycDKTyPWgPudnUS9R fvVb7mi764oYDEfwyvM+2sxedW2Qlkwpcy7mK95FT7Y17l/x9lRzvAaWp2kEZL47lu XXnWFECqfHCjQ== Date: Fri, 2 Feb 2024 12:57:44 +0100 From: Frederic Weisbecker To: Anna-Maria Behnsen Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Rik van Riel , Steven Rostedt , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Richard Cochran Subject: Re: [PATCH v10 20/20] timers: Always queue timers on the local CPU Message-ID: References: <20240115143743.27827-1-anna-maria@linutronix.de> <20240115143743.27827-21-anna-maria@linutronix.de> <87plxflx4x.fsf@somnus> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87plxflx4x.fsf@somnus> On Thu, Feb 01, 2024 at 09:58:38PM +0100, Anna-Maria Behnsen wrote: > Frederic Weisbecker writes: > > > Le Mon, Jan 15, 2024 at 03:37:43PM +0100, Anna-Maria Behnsen a ?crit : > >> The timer pull model is in place so we can remove the heuristics which try > >> to guess the best target CPU at enqueue/modification time. > >> > >> All non pinned timers are queued on the local CPU in the separate storage > >> and eventually pulled at expiry time to a remote CPU. > >> > >> Originally-by: Richard Cochran (linutronix GmbH) > >> Signed-off-by: Anna-Maria Behnsen > > > > Reviewed-by: Frederic Weisbecker > > > > Just one detail below: > > > >> @@ -590,10 +590,13 @@ trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) > >> > >> /* > >> * We might have to IPI the remote CPU if the base is idle and the > >> - * timer is not deferrable. If the other CPU is on the way to idle > >> - * then it can't set base->is_idle as we hold the base lock: > >> + * timer is pinned. If it is a non pinned timer, it is only queued > >> + * on the remote CPU, when timer was running during queueing. Then > >> + * everything is handled by remote CPU anyway. If the other CPU is > >> + * on the way to idle then it can't set base->is_idle as we hold > >> + * the base lock: > >> */ > >> - if (base->is_idle) > >> + if (base->is_idle && timer->flags & TIMER_PINNED) > > > > Is the TIMER_PINNED test necessary? If base->is_idle, then the timer > > is now guaranteed to be TIMER_PINNED, right? > > > > Yes, you are right. Should I drop it? To clarify it, I could add a > > WARN_ON_ONCE(!timer->flags & TIMER_PINNED) Yep, that looks good! Thanks. > > instead. > > Thanks, > > Anna-Maria >