linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: Peter Zijlstra <peterz@infradead.org>
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 08:24:49 -0700	[thread overview]
Message-ID: <CANn89iJsD=rKTjiGF_EEoSh9WmiifOjxu2mcqSv8Sx-NT7zixQ@mail.gmail.com> (raw)
In-Reply-To: <CANn89iKxTMRr_XSC4xHD-etoU9kF6nN7yzQP4AEfYeNKjQLTPQ@mail.gmail.com>

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())

  reply	other threads:[~2018-10-11 15:25 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 [this message]
2018-10-11 15:50       ` Peter Zijlstra
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='CANn89iJsD=rKTjiGF_EEoSh9WmiifOjxu2mcqSv8Sx-NT7zixQ@mail.gmail.com' \
    --to=edumazet@google.com \
    --cc=bp@alien8.de \
    --cc=eric.dumazet@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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).