From: Catalin Marinas <catalin.marinas@arm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"ego@linux.vnet.ibm.com" <ego@linux.vnet.ibm.com>
Subject: Re: [PATCH V4 1/3] cpufreq: Make sure frequency transitions are serialized
Date: Fri, 21 Mar 2014 11:05:59 +0000 [thread overview]
Message-ID: <20140321110559.GB13596@arm.com> (raw)
In-Reply-To: <CAKohpomY4xf4tOFTGt-ykE7sUi4ks7vW5qp8ytgopm6CiY9QRg@mail.gmail.com>
On Fri, Mar 21, 2014 at 09:21:02AM +0000, Viresh Kumar wrote:
> @Catalin: We have a problem here and need your expert advice. After changing
> CPU frequency we need to call this code:
>
> cpufreq_notify_post_transition();
> policy->transition_ongoing = false;
>
> And the sequence must be like this only. Is this guaranteed without any
> memory barriers? cpufreq_notify_post_transition() isn't touching
> transition_ongoing at all..
The above sequence doesn't say much. As rmk said, the compiler wouldn't
reorder the transition_ongoing write before the function call. I think
most architectures (not sure about Alpha) don't do speculative stores,
so hardware wouldn't reorder them either. However, other stores inside
the cpufreq_notify_post_transition() could be reordered after
transition_ongoing store. The same for memory accesses after the
transition_ongoing update, they could be reordered before.
So what we actually need to know is what are the other relevant memory
accesses that require strict ordering with transition_ongoing.
What I find strange in your patch is that
cpufreq_freq_transition_begin() uses spinlocks around transition_ongoing
update but cpufreq_freq_transition_end() doesn't.
--
Catalin
next prev parent reply other threads:[~2014-03-21 11:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-21 5:34 [PATCH V4 0/3] cpufreq: Introduce cpufreq_freq_transition_{begin|end}() Viresh Kumar
2014-03-21 5:34 ` [PATCH V4 1/3] cpufreq: Make sure frequency transitions are serialized Viresh Kumar
2014-03-21 7:46 ` Srivatsa S. Bhat
2014-03-21 7:58 ` Viresh Kumar
2014-03-21 8:42 ` Srivatsa S. Bhat
2014-03-21 9:21 ` Viresh Kumar
2014-03-21 10:06 ` Viresh Kumar
2014-03-21 11:05 ` Catalin Marinas [this message]
2014-03-21 11:24 ` Srivatsa S. Bhat
2014-03-21 18:07 ` Catalin Marinas
2014-03-22 3:48 ` Viresh Kumar
2014-03-24 6:48 ` Srivatsa S. Bhat
2014-03-24 6:19 ` Viresh Kumar
2014-03-21 5:34 ` [PATCH V4 2/3] cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} Viresh Kumar
2014-03-21 7:48 ` Srivatsa S. Bhat
2014-03-21 7:59 ` Viresh Kumar
2014-03-21 5:34 ` [PATCH V4 3/3] cpufreq: Make cpufreq_notify_transition & cpufreq_notify_post_transition static Viresh Kumar
2014-03-21 7:51 ` Srivatsa S. Bhat
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=20140321110559.GB13596@arm.com \
--to=catalin.marinas@arm.com \
--cc=cpufreq@vger.kernel.org \
--cc=ego@linux.vnet.ibm.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=srivatsa.bhat@linux.vnet.ibm.com \
--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