linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Eric Dumazet <edumazet@google.com>
Cc: Ingo Molnar <mingo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	LKML <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH 2/2] x86/percpu: Fix this_cpu_read()
Date: Thu, 11 Oct 2018 17:50:34 +0200	[thread overview]
Message-ID: <20181011155034.GC9867@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CANn89iJsD=rKTjiGF_EEoSh9WmiifOjxu2mcqSv8Sx-NT7zixQ@mail.gmail.com>

On Thu, Oct 11, 2018 at 08:24:49AM -0700, Eric Dumazet wrote:
> On Thu, Oct 11, 2018 at 8:02 AM Eric Dumazet <edumazet@google.com> wrote:
> >
> > On Thu, Oct 11, 2018 at 3:45 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > Eric reported that a sequence count loop using this_cpu_read() got
> > > optimized out. This is wrong, this_cpu_read() must imply READ_ONCE()
> > > because the interface is IRQ-safe, therefore an interrupt can have
> > > changed the per-cpu value.
> > >
> > > Fixes: 59eaef78bfea ("x86/tsc: Remodel cyc2ns to use seqcount_latch()")
> > > Reported-by: Eric Dumazet <edumazet@google.com>
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> >
> >
> > Acked-by: Eric Dumazet <edumazet@google.com>
> 
> Actually the Fixes: tag seems funky.
> 
> Bug was not added by 59eaef78bfea
> 
> Your patch probably needs to be backported to older versions of linux,
> just to be safe, since
> we might have other places where authors relied on this_cpu_read()
> semantic (different than this_cpu_read_stable())

Right; it goes back a long long way... is:

  7c3576d261ce ("[PATCH] i386: Convert PDA into the percpu section")

early enough? That introduces percpu_from_op(), but arguably the
pda_from_op() it replaces was buggy already.

  reply	other threads:[~2018-10-11 15:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 10:38 [PATCH 0/2] x86/tsc: Fix native_sched_clock() Peter Zijlstra
2018-10-11 10:38 ` [PATCH 1/2] x86/tsc: Force inlining of cyc2ns bits Peter Zijlstra
2018-10-14  9:15   ` [tip:x86/urgent] " tip-bot for Peter Zijlstra
2018-10-11 10:38 ` [PATCH 2/2] x86/percpu: Fix this_cpu_read() Peter Zijlstra
2018-10-11 15:02   ` Eric Dumazet
2018-10-11 15:24     ` Eric Dumazet
2018-10-11 15:50       ` Peter Zijlstra [this message]
2018-10-11 16:08         ` Eric Dumazet
2018-10-14  9:16   ` [tip:x86/urgent] " tip-bot for Peter Zijlstra

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=20181011155034.GC9867@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@alien8.de \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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 NNTP newsgroup(s).