mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiaoguang Chen <chenxg.marvell@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Xiaoguang Chen <chenxg@marvell.com>,
	"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>,
	"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH 1/2] cpufreq: Add governor operation ongoing flag
Date: Wed, 14 Aug 2013 16:19:31 +0800	[thread overview]
Message-ID: <CAFgnuDetTVYayBABNPhME15b+b6qUtJX2hBaJ6y4+gOSgGFwdQ@mail.gmail.com> (raw)
In-Reply-To: <CAKohponD2LdDsJy=UJCf-1yANjyPjmAyokV5a4HOSJn_DMJVhA@mail.gmail.com>

2013/8/14 Viresh Kumar <viresh.kumar@linaro.org>:
> I am still not sure if I got what you are trying to say, sorry :(
>
> On 14 August 2013 13:06, Xiaoguang Chen <chenxg.marvell@gmail.com> wrote:
>> Please see below code in __cpufreq_governor function
>>
>> mutex_lock(&cpufreq_governor_lock);
>> if ((!policy->governor_enabled && (event == CPUFREQ_GOV_STOP)) ||
>>                             //////////// <1> Here one process A tries
>> to stop governor, it finds governor is enabled, so it will pass down.
>>    (policy->governor_enabled && (event == CPUFREQ_GOV_START))) {
>>                           /////////////<3> Process B tries to start
>> governor, it finds enable flag is false, so it can also pass down.
>
> Processes aren't allowed to call START/STOP in random manner. They
> must do a STOP first, if it succeeds do a START.
>
> So lets see it this way:
>
> Process A                            Process B
> STOP
>                                             STOP
>                                             START (If STOP passed)
> START (If STOP passed)
>
> So, Process B tries to STOP/START after governor is Stopped by A.
> Now call to STOP for process B will fail as we are already stopped..
>
> Can you explain with this example the problem you are trying to solve?

Yes, "START (If STOP passed)", this is important,  we don't have this
patch on our code base, So even Process B's STOP failed(as governor
enable flag is set to false by process A already ), it can still do
START operation, So my problem occurs.
My problem is that I see ondemand governor is started twice during
frequent governor switch and cpu hotplug stress test.

The After seeing your patch for the return value checking, I think my
problem should not occur.
This issue really botherred me for a long time. :(


Thanks
Xiaoguang

  reply	other threads:[~2013-08-14  8:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-13  7:09 Xiaoguang Chen
2013-08-13  7:09 ` [PATCH 2/2] cpufreq: Only do governor start after successful stop Xiaoguang Chen
2013-08-14  5:23   ` Viresh Kumar
2013-08-14  7:38     ` Xiaoguang Chen
2013-08-14  5:21 ` [PATCH 1/2] cpufreq: Add governor operation ongoing flag Viresh Kumar
2013-08-14  7:36   ` Xiaoguang Chen
2013-08-14  7:48     ` Viresh Kumar
2013-08-14  8:19       ` Xiaoguang Chen [this message]
2013-08-14  8:22         ` Viresh Kumar
2013-08-14  8:50           ` Xiaoguang Chen
2013-08-14  8:54             ` Viresh Kumar

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=CAFgnuDetTVYayBABNPhME15b+b6qUtJX2hBaJ6y4+gOSgGFwdQ@mail.gmail.com \
    --to=chenxg.marvell@gmail.com \
    --cc=chenxg@marvell.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --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®