RCU Archive mirror
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org,
	Zhengxu Chen <zhxchen17@meta.com>,
	Danielle Costantino <dcostantino@meta.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Feng Tang <feng.tang@intel.com>, Waiman Long <longman@redhat.com>,
	John Stultz <jstultz@google.com>,
	x86@kernel.org
Subject: Re: [PATCH 5/8] tsc: Check for sockets instead of CPUs to make code match comment
Date: Mon, 5 Feb 2024 13:09:00 -0800	[thread overview]
Message-ID: <ZcFObO-fcvq1_xj7@tardis> (raw)
In-Reply-To: <1781cc76-aeee-427b-bc9e-b3d2b8f184f3@paulmck-laptop>

On Mon, Feb 05, 2024 at 12:03:33PM -0800, Paul E. McKenney wrote:
> On Mon, Jan 29, 2024 at 03:56:38PM -0800, Boqun Feng wrote:
> > From: "Paul E. McKenney" <paulmck@kernel.org>
> > 
> > The unsynchronized_tsc() eventually checks num_possible_cpus(), and
> > if the system is non-Intel and the number of possible CPUs is greater
> > than one, assumes that TSCs are unsynchronized.  This despite the
> > comment saying "assume multi socket systems are not synchronized",
> > that is, socket rather than CPU.  This behavior was preserved by
> > commit 8fbbc4b45ce3 ("x86: merge tsc_init and clocksource code") and
> > by the previous relevant commit 7e69f2b1ead2 ("clocksource: Remove the
> > update callback").
> > 
> > The clocksource drivers were added by commit 5d0cf410e94b ("Time: i386
> > Clocksource Drivers") back in 2006, and the comment still said "socket"
> > rather than "CPU".
> > 
> > Therefore, bravely (and perhaps foolishly) make the code match the
> > comment.
> > 
> > Note that it is possible to bypass both code and comment by booting
> > with tsc=reliable, but this also disables the clocksource watchdog,
> > which is undesirable when trust in the TSC is strictly limited.
> > 
> > Reported-by: Zhengxu Chen <zhxchen17@meta.com>
> > Reported-by: Danielle Costantino <dcostantino@meta.com>
> > Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Borislav Petkov <bp@alien8.de>
> > Cc: Dave Hansen <dave.hansen@linux.intel.com>
> > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Feng Tang <feng.tang@intel.com>
> > Cc: Waiman Long <longman@redhat.com>
> > Cc: John Stultz <jstultz@google.com>
> > Cc: <x86@kernel.org>
> 
> Hello, Boqun,
> 
> Please drop this one, as I never got an ack from the maintainers, and
> quite possibly for good reason.  ;-)
> 

Got it I will drop it in the PR, the topic branch has been updated:

	git://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git rcu-misc.2024.02.05a

Regards,
Boqun

> 							Thanx, Paul
> 
> > ---
> >  arch/x86/kernel/tsc.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> > index 15f97c0abc9d..d45084c6a15e 100644
> > --- a/arch/x86/kernel/tsc.c
> > +++ b/arch/x86/kernel/tsc.c
> > @@ -1287,7 +1287,7 @@ int unsynchronized_tsc(void)
> >  	 */
> >  	if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) {
> >  		/* assume multi socket systems are not synchronized: */
> > -		if (num_possible_cpus() > 1)
> > +		if (nr_online_nodes > 1)
> >  			return 1;
> >  	}
> >  
> > -- 
> > 2.43.0
> > 

  reply	other threads:[~2024-02-05 21:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 23:56 [PATCH 0/8] Misc RCU update for v6.9 Boqun Feng
2024-01-29 23:56 ` [PATCH 1/8] rcu: Rename jiffies_till_flush to jiffies_lazy_flush Boqun Feng
2024-01-29 23:56 ` [PATCH 2/8] rcu: Provide a boot time parameter to control lazy RCU Boqun Feng
2024-01-29 23:56 ` [PATCH 3/8] hrtimer: Report offline hrtimer enqueue Boqun Feng
2024-01-29 23:56 ` [PATCH 4/8] srcu: Improve comments about acceleration leak Boqun Feng
2024-01-29 23:56 ` [PATCH 5/8] tsc: Check for sockets instead of CPUs to make code match comment Boqun Feng
2024-02-05 20:03   ` Paul E. McKenney
2024-02-05 21:09     ` Boqun Feng [this message]
2024-01-29 23:56 ` [PATCH 6/8] rcutorture: Suppress rtort_pipe_count warnings until after stalls Boqun Feng
2024-01-29 23:56 ` [PATCH 7/8] clocksource: Skip watchdog check for large watchdog intervals Boqun Feng
2024-01-29 23:56 ` [PATCH 8/8] rcu/sync: remove un-used rcu_sync_enter_start function Boqun Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZcFObO-fcvq1_xj7@tardis \
    --to=boqun.feng@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dcostantino@meta.com \
    --cc=feng.tang@intel.com \
    --cc=hpa@zytor.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zhxchen17@meta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).