mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	"# v4 . 2+" <stable@vger.kernel.org>,
	Juri Lelli <juri.lelli@arm.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cpufreq: Fix NULL reference crash while accessing policy->governor_data
Date: Fri, 29 Jan 2016 04:33:58 +0100	[thread overview]
Message-ID: <1958686.xNEGILnNaB@vostro.rjw.lan> (raw)
In-Reply-To: <20160128021553.GC3935@vireshk>

On Thursday, January 28, 2016 07:45:53 AM Viresh Kumar wrote:
> On 27-01-16, 23:54, Rafael J. Wysocki wrote:
> > So I've applied this, but I'm not sure it is sufficient yet.
> 
> At least, this solves the crash Juri was hitting on a multi cluster
> box.

Yes, it makes the crash go away in his setup.

> > Have you double checked whether or not stuff cannot be reordered by
> > the CPU and/or the compiler and no additional memory barriers are needed?
> 
> I don't think CPU will reorder things before a function call.

It can do that in theory.

First of all, functions may be inlined by the compiler.

Second, even if they aren't, the call instruction only means "take the next
instruction from that other location in memory" to the CPU and the instructions
following the call go into the pipeline along with the ones preceding it and
they may be reordered in the process.

> It can reorder lines,

Not lines, but instructions.

> which CPU thinks aren't related but it can't assume the
> same in this case. We have tons of code like this.

Code that relies on specific ordering of instructions executed by different
CPUs for correctness usually requires memory barriers.

Thanks,
Rafael

      parent reply	other threads:[~2016-01-29  3:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 17:03 Viresh Kumar
2016-01-26  9:57 ` Juri Lelli
2016-01-26 18:01   ` Juri Lelli
2016-01-26 22:49     ` Rafael J. Wysocki
2016-01-27 10:22       ` Juri Lelli
2016-01-27  3:12     ` Viresh Kumar
2016-01-27  3:10   ` Viresh Kumar
2016-01-27 10:18     ` Juri Lelli
2016-01-27 22:54 ` Rafael J. Wysocki
2016-01-28  2:15   ` Viresh Kumar
2016-01-28 10:44     ` Juri Lelli
2016-01-29  3:33     ` Rafael J. Wysocki [this message]

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=1958686.xNEGILnNaB@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=juri.lelli@arm.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=viresh.kumar@linaro.org \
    /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

all inboxes | Powered by JetHome®