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,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V4] cpufreq: governor: Quit work-handlers early if governor is stopped
Date: Thu, 05 Nov 2015 23:41:36 +0100	[thread overview]
Message-ID: <10826143.ebnrY1EVJN@vostro.rjw.lan> (raw)
In-Reply-To: <133510f34e89a9be81766bea3c7ddc1605198ee6.1446086230.git.viresh.kumar@linaro.org>

On Thursday, October 29, 2015 08:08:38 AM Viresh Kumar wrote:
> gov_queue_work() acquires cpufreq_governor_lock to allow
> cpufreq_governor_stop() to drain delayed work items possibly scheduled
> on CPUs that share the policy with a CPU being taken offline.
> 
> However, the same goal may be achieved in a more straightforward way if
> the policy pointer in the struct cpu_dbs_info matching the policy CPU is
> reset upfront by cpufreq_governor_stop() under the timer_mutex belonging
> to it and checked against NULL, under the same lock, at the beginning of
> dbs_timer().
> 
> In that case every instance of dbs_timer() run for a struct cpu_dbs_info
> sharing the policy pointer in question after cpufreq_governor_stop() has
> started will notice that that pointer is NULL and bail out immediately
> without queuing up any new work items.  In turn, gov_cancel_work()
> called by cpufreq_governor_stop() before destroying timer_mutex will
> wait for all of the delayed work items currently running on the CPUs
> sharing the policy to drop the mutex, so it may be destroyed safely.
> 
> Make cpufreq_governor_stop() and dbs_timer() work as described and
> modify gov_queue_work() so it does not acquire cpufreq_governor_lock any
> more.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Applied, thanks!

Rafael


      reply	other threads:[~2015-11-05 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29  2:38 Viresh Kumar
2015-11-05 22:41 ` 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=10826143.ebnrY1EVJN@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@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®