kernel-testers.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Dave Jones <davej@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"kernel-testers@vger.kernel.org" <kernel-testers@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, "Rafael J. Wysocki" <rjw@sisk.pl>,
	Dave Young <hidave.darkstar@gmail.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	Thomas Renninger <trenn@suse.de>
Subject: Re: [patch 2/3] cpufreq: Define dbs_mutex purpose and cleanup its usage
Date: Thu, 25 Jun 2009 13:54:45 -0700	[thread overview]
Message-ID: <1245963285.4534.20542.camel@localhost.localdomain> (raw)
In-Reply-To: <20090625194648.GA24657@Krystal>

On Thu, 2009-06-25 at 12:46 -0700, Mathieu Desnoyers wrote:
> * venkatesh.pallipadi@intel.com (venkatesh.pallipadi@intel.com) wrote:
> > Commit b14893a62c73af0eca414cfed505b8c09efc613c although it was very
> > much needed to cleanup ondemand timer cleanly, openup a can of worms
> > related to locking dependencies in cpufreq.
> > 
> > Patch here defines the need for dbs_mutex and cleans up its usage in
> > ondemand governor. This also resolves the lockdep warnings reported here
> > 
> > http://lkml.indiana.edu/hypermail/linux/kernel/0906.1/01925.html
> > 

> > @@ -598,14 +593,16 @@ static int cpufreq_governor_dbs(struct cpufreq_policy *policy,
> >  				max(min_sampling_rate,
> >  				    latency * LATENCY_MULTIPLIER);
> >  		}
> > +		mutex_unlock(&dbs_mutex);
> > +
> >  		dbs_timer_init(this_dbs_info);
> >  
> > -		mutex_unlock(&dbs_mutex);
> >  		break;
> >  
> >  	case CPUFREQ_GOV_STOP:
> > -		mutex_lock(&dbs_mutex);
> >  		dbs_timer_exit(this_dbs_info);
> 
> Hrm, so.. how do we protect against concurrent :
> 
> CPUFREQ_GOV_START/CPUFREQ_GOV_STOP now ?

concurrent _START _STOP across CPUs does not matter for timer_init and
timer_exit. On same CPU, there cannot be two concurrent _START as upper
level cpufreq will have policy_rwsem in write mode. I cannot think of a
flow where _START and _STOP on same CPU is possible.

However two concurrent _STOP for same CPU is still possible, as we are
releasing the rwsem lock before STOP callback. "Back to drawing board"
time to figure this all out..

Thanks,
Venki

  reply	other threads:[~2009-06-25 20:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25 18:33 [patch 0/3] Take care of cpufreq lockdep issues venkatesh.pallipadi-ral2JQCrhuEAvxtiuMwx3w
2009-06-25 18:33 ` [patch 1/3] cpufreq: remove rwsem lock from CPUFREQ_GOV_STOP call (second call site) venkatesh.pallipadi-ral2JQCrhuEAvxtiuMwx3w
2009-06-25 18:33 ` [patch 2/3] cpufreq: Define dbs_mutex purpose and cleanup its usage venkatesh.pallipadi-ral2JQCrhuEAvxtiuMwx3w
     [not found]   ` <20090625183601.493904000-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2009-06-25 19:46     ` Mathieu Desnoyers
2009-06-25 20:54       ` Pallipadi, Venkatesh [this message]
     [not found]         ` <1245963285.4534.20542.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-06-25 21:32           ` Mathieu Desnoyers
2009-06-25 18:33 ` [patch 3/3] cpufreq: Define dbs_mutex purpose and cleanup its usage conservative gov venkatesh.pallipadi-ral2JQCrhuEAvxtiuMwx3w

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=1245963285.4534.20542.camel@localhost.localdomain \
    --to=venkatesh.pallipadi@intel.com \
    --cc=cpufreq@vger.kernel.org \
    --cc=davej@redhat.com \
    --cc=hidave.darkstar@gmail.com \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    --cc=rjw@sisk.pl \
    --cc=trenn@suse.de \
    /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).