kernel-testers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Mathieu Desnoyers
	<mathieu.desnoyers-scC8bbJcJLCw5LPnMra/2Q@public.gmane.org>
Cc: Dave Jones <davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Thomas Renninger <trenn-l3A5Bk7waGM@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Ingo Molnar <mingo-X9Un+BFzKDI@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Dave Young
	<hidave.darkstar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Pekka Enberg <penberg-bbCR+/B0CizivPeTLB3BmA@public.gmane.org>
Subject: Re: cpufreq cleanups - .30 vs .31
Date: Mon, 27 Jul 2009 09:31:06 -0700	[thread overview]
Message-ID: <1248712266.11545.8824.camel@localhost.localdomain> (raw)
In-Reply-To: <20090727142532.GA22503@Krystal>

On Mon, 2009-07-27 at 07:25 -0700, Mathieu Desnoyers wrote:
> * Dave Jones (davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org) wrote:
> > On Mon, Jul 06, 2009 at 01:18:18PM +0200, Thomas Renninger wrote:
> > 
> >  > So if not find too intrusive, I'd say:
> >  > Venkatesh's whole series of:
> >  > [patch 0/4] Take care of cpufreq lockdep issues (take 2)
> >  > should be seen in .31.
> >  >  ...
> >  > The one patch from Mathieu:
> >  > [patch 2.6.30 2/4] CPUFREQ: fix (utter) cpufreq_add_dev mess
> >  > is a separate, general cleanup which should show up in .31.
> > 
> > I came to the same conclusion after reading the thread, and looking
> > over the patches.  I merged the above, and sent Linus a pull request
> > a few minutes ago.
> > 
> > Thanks Mathieu and Venki for chasing this down.
> > 
> > 	Dave
> 
> Given I never got an answer to this question, I'm re-asking a question I
> asked in a previous thread about Venki's patchset:
> 
> [CPUFREQ] Cleanup locking in ondemand governor
> commit	5a75c82828e7c088ca6e7b4827911dc29cc8e774
> 
> From the earlier thread:
> Subject: Re: [patch 2.6.30 3/4] cpufreq add gov mutex
> 
> I am worried about potential races between add_dev/remove_dev, which
> currently lock the rwsem as mean of protection, and execution of timer
> handler that would not take the rwsem to protect itself anymore, due to
> your changes.
> 
> I'm especially worried about the call to
> 
>               __cpufreq_driver_target(dbs_info->cur_policy,
>                         dbs_info->freq_lo, CPUFREQ_RELATION_H);
> 
> which seems to depend on policy-level information, protected at the
> rwsem-level.
> 
> By removing the rwsem from the timer handler, I don't see how you plan
> to protect this information from add_dev/remove_dev execution.
> 

Sorry I missed the question earlier.

The invariant here is that the timer routine will not be running while
policy is inconsistent due to add/remove. The cpufreq layer calls START
at the end of add_dev when all policy stuff has been setup, which starts
the timer. And STOP along remove_dev before cleaning up policy which
stops the timer.

If you are thinking of races with other cpufreq sysfs interfaces, they
go through the per cpu rwsem along with add/remove.

Thanks,
Venki

  reply	other threads:[~2009-07-27 16:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06 11:18 cpufreq cleanups - .30 vs .31 Thomas Renninger
     [not found] ` <200907061318.20839.trenn-l3A5Bk7waGM@public.gmane.org>
2009-07-06 13:45   ` Mathieu Desnoyers
2009-07-06 17:20   ` Pallipadi, Venkatesh
2009-07-07  1:51   ` Dave Jones
     [not found]     ` <20090707015115.GB5310-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-07-27 14:25       ` Mathieu Desnoyers
2009-07-27 16:31         ` Pallipadi, Venkatesh [this message]
     [not found]           ` <1248712266.11545.8824.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-07-27 16:37             ` Mathieu Desnoyers

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=1248712266.11545.8824.camel@localhost.localdomain \
    --to=venkatesh.pallipadi-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=cpufreq-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=davej-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hidave.darkstar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mathieu.desnoyers-scC8bbJcJLCw5LPnMra/2Q@public.gmane.org \
    --cc=mingo-X9Un+BFzKDI@public.gmane.org \
    --cc=penberg-bbCR+/B0CizivPeTLB3BmA@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=trenn-l3A5Bk7waGM@public.gmane.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;
as well as URLs for NNTP newsgroup(s).