From mboxrd@z Thu Jan 1 00:00:00 1970 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 2581630BF4E for ; Wed, 19 Nov 2025 17:14:17 +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=1763572459; cv=none; b=ONfuYSu6a2L+fyFSFhk7f8MFDgQibqRGs0L1eB3GINeFzzjhWFixHBb/juHfNX+8k2VS+40AWQhOWDS7weDBc1EsLDjN/L76PnR3sInzPoPSUGMjm0SnmxxX2xmb8lgrBZWKoY6cbwIfA1PKzn/SEUTg4QDfyBzIVfZDAu9x6GM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763572459; c=relaxed/simple; bh=bhLDUKAbagjA/wTO/poyEPDOBC+FVCc+2mMWWBEk2rM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=etqgXFLgTrc1UZvLh+00GfFU711SPjluFz3vdhy943LQ+jqFOQBdaoaOQvY6/VkKjDof49P6nTTyjSLxdODCHmhXq1W3ehGwgXR3uu+6H7an11lCknHwSprwLpCOXfSgO88m+yK0N2UbEURcCxLLiJLaIpoVq8Se04mxT/BlQqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FNQ2LhAR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FNQ2LhAR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 605FAC113D0; Wed, 19 Nov 2025 17:14:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763572457; bh=bhLDUKAbagjA/wTO/poyEPDOBC+FVCc+2mMWWBEk2rM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FNQ2LhARPipJv9xKSqglN+oND1VYLs2lnD1fVgGiHZdHcsNriBH+HU0sMVlyZdCcL 9ZsaPWiyOexNg6mfe1TLVXBu/RYpqra+/KNDgwsSsrfJW/As0nWQDTveBCGoj53jVQ GidwZswAF752CUMDEJnxVcJt0uq7oVDDhyoqNJYI+NaopTftnC6am1FnoISwEAt/9B saM5CMA1U2TpBHx1WZdB0JqmMkLW1YlDIwYde124PMXXvoLihkhKkk7oRFRT0v12BI 0CvtlKf3RMVC8jaUQ2LHPOxsPF/qDPu0QOu07hEMtynU7lfUm+Naugf+D2n28ckTdi APs6ip2zSDX4g== Date: Wed, 19 Nov 2025 18:14:14 +0100 From: Frederic Weisbecker To: Thomas Gleixner Cc: Gabriele Monaco , linux-kernel@vger.kernel.org, Anna-Maria Behnsen , Waiman Long , "John B. Wyatt IV" , "John B. Wyatt IV" Subject: Re: [PATCH v15 7/7] timers: Exclude isolated cpus from timer migration Message-ID: References: <20251113083324.33490-1-gmonaco@redhat.com> <20251113083324.33490-8-gmonaco@redhat.com> <87pl9eklvc.ffs@tglx> 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: <87pl9eklvc.ffs@tglx> Le Wed, Nov 19, 2025 at 05:50:15PM +0100, Thomas Gleixner a écrit : > On Thu, Nov 13 2025 at 09:33, Gabriele Monaco wrote: > > - cpumask_clear_cpu(cpu, tmigr_available_cpumask); > > By removing this the function name does not make any sense any > more. Splitting the cpumask_clear_set() out, renaming the function > > > scoped_guard(raw_spinlock_irq, &tmc->lock) { > > + if (!tmc->available) > > + return 0; > > and adding this > > > tmc->available = false; > > WRITE_ONCE(tmc->wakeup, KTIME_MAX); > > > > @@ -1453,11 +1485,11 @@ static int tmigr_clear_cpu_available(unsigned int cpu) > > } > > > > if (firstexp != KTIME_MAX) { > > - migrator = cpumask_any(tmigr_available_cpumask); > > + migrator = cpumask_any_but(tmigr_available_cpumask, cpu); > > and this should be done in a preparatory patch along with a > reasonable explanation in the change log. > > > work_on_cpu(migrator, tmigr_trigger_active, NULL); > > } > > > > - return 0; > > + return 1; > > But thinking more about it. What's the actual point of moving this 'clear' > out instead of just moving it further down? > > It does not matter at all whether the isol/unisol muck clears an already > cleared bit or not. But it would keep the function name comprehensible > and avoid all this online/offline wrapper nonsense. That was my suggestion. It's because tmigr_clear_cpu_available() and tmigr_set_cpu_available() can now all be called concurrently through the workqueues and race and mess up the cpumask if they all try to clear/set at the same time... And I couldn't find a saner way to order things... Thanks. -- Frederic Weisbecker SUSE Labs