From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 7BB7E28314C for ; Tue, 13 Jan 2026 10:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768300597; cv=none; b=ta/CluvWDeb2ZF45SM6l63qfNhRiGX0c451wuNVpf8giY0c7lMtpGqH3A3Ho3aL8V5Yjdt6QKqc4udfWJtVETyzX/ZD31ASprTuVpSt3MO1cZOOrFtYsLP8W9OSI+WBS282KSyatpP/OMlHysyX1j2apTu86WUVlOPxjHdDTwoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768300597; c=relaxed/simple; bh=Qo7r/Cz3soJbSRCKAKyFjaiuxVRybYO2nkdnm6GBWtE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Hl07tIaehnm0owSLMjvCwZoDaLqELdv3Apqhq5LtFqRa0QclqOjZB0Uso/uG7RGulElk98jZ1N2qeI2WSnJPwAEfWB+PCWHjH81I7SniWVKda2+DmdLkCCN1DOiBJS5q26cXqLRQP+X90UL9WfUVbwgcS1IM4hDxQC1ZNZJthwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=rdbQo7eD; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rdbQo7eD" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=SsCGcLU7PrJOUXC7Qco9Ms7dMPkBpc9pJZKg4OTg2lo=; b=rdbQo7eDFw9aBBTVGqJZddLf6I i8Zk85a05Un7PEPbEv0+TYFp3hxg4JGw4EZIm1ETxgC5Q5vsf8ESWwSqZoiUGCzatrkKu9hogx4Rr Odz1ONX0d6hPHA7L95mMzPc637bZplVAIUS5gyAXGJ8k3sh5eT5e0T4frmQ2Fo3DrI/A2mVSQ13+c 6oaSnOqlATyk0Z2yPzcLL+zz2/PM8YbJ7Wn3kK/ZpbjyCTeINQU4rTSwLmj9KI2KOXdBVjIrRFKOl q6syEpPpTDj8OV1MVlPxeuPBqmo6YRvHJAnysbaTzpjuVbEpZYRuC38QKdseDTPywzpOSWQ9Bib5E 8yO/dzsw==; Received: from 2001-1c00-8d85-5700-266e-96ff-fe07-7dcc.cable.dynamic.v6.ziggo.nl ([2001:1c00:8d85:5700:266e:96ff:fe07:7dcc] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vfblC-00000002bAD-2pXf; Tue, 13 Jan 2026 10:36:26 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 396C83005AF; Tue, 13 Jan 2026 11:36:26 +0100 (CET) Date: Tue, 13 Jan 2026 11:36:26 +0100 From: Peter Zijlstra To: Vincent Guittot Cc: Wangyang Guo , K Prateek Nayak , Ingo Molnar , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , linux-kernel@vger.kernel.org, Shrikanth Hegde , Benjamin Lei , Tim Chen , Tianyou Li Subject: Re: [PATCH v2] sched/clock: Avoid false sharing for sched_clock_irqtime Message-ID: <20260113103626.GB830229@noisy.programming.kicks-ass.net> References: <20260113074807.3404180-1-wangyang.guo@intel.com> <20260113100755.GV830755@noisy.programming.kicks-ass.net> 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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 13, 2026 at 11:14:54AM +0100, Vincent Guittot wrote: > On Tue, 13 Jan 2026 at 11:08, Peter Zijlstra wrote: > > > > On Tue, Jan 13, 2026 at 03:48:07PM +0800, Wangyang Guo wrote: > > > Read-mostly sched_clock_irqtime may share the same cacheline with > > > frequently updated nohz struct. Mark it as __read_mostly to avoid > > > false sharing issue. > > > > > > > Is there a reason that thing can't be a static_key or so? > > We tried that but disable_sched_clock_irqtime can be called in atomic > context with mark_tsc_unstable() > https://lore.kernel.org/all/174161357383.14745.8770394914047302959.tip-bot2@tip-bot2/ Right, but if you note, that very same path has clear_sched_clock_stable(), and that is a static_key too. It's just that that punts by pushing it into a workqueue. So why not lift that workqueue and do both keys or something?