Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-13 Thread Saravana Kannan
On 11/11/2014 05:07 AM, Viresh Kumar wrote: On 11 November 2014 17:45, Prarit Bhargava wrote: the deadlock in commit 955ef4833574636819cd269cfbae12f79cbde63a [ 75.471265]CPU0CPU1 [ 75.476327] [ 75.481385] lock(>rwsem); [

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-13 Thread Saravana Kannan
On 11/11/2014 05:07 AM, Viresh Kumar wrote: On 11 November 2014 17:45, Prarit Bhargava pra...@redhat.com wrote: the deadlock in commit 955ef4833574636819cd269cfbae12f79cbde63a [ 75.471265]CPU0CPU1 [ 75.476327] [ 75.481385]

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-11 Thread Viresh Kumar
On 11 November 2014 17:45, Prarit Bhargava wrote: > the deadlock in commit 955ef4833574636819cd269cfbae12f79cbde63a > > [ 75.471265]CPU0CPU1 > [ 75.476327] > [ 75.481385] lock(>rwsem); > [ 75.485307]

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-11 Thread Prarit Bhargava
On 11/10/2014 10:37 PM, Viresh Kumar wrote: > On 10 November 2014 17:56, Prarit Bhargava wrote: > >>> I still fail to understand why ? What will the _trylock() change ? >> >> viresh, afaict read_trylock will return 0 when busy with write: > > Yes.. > >> static inline int

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-11 Thread Prarit Bhargava
On 11/10/2014 10:37 PM, Viresh Kumar wrote: On 10 November 2014 17:56, Prarit Bhargava pra...@redhat.com wrote: I still fail to understand why ? What will the _trylock() change ? viresh, afaict read_trylock will return 0 when busy with write: Yes.. static inline int

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-11 Thread Viresh Kumar
On 11 November 2014 17:45, Prarit Bhargava pra...@redhat.com wrote: the deadlock in commit 955ef4833574636819cd269cfbae12f79cbde63a [ 75.471265]CPU0CPU1 [ 75.476327] [ 75.481385] lock(policy-rwsem); [ 75.485307]

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-10 Thread Viresh Kumar
On 10 November 2014 17:56, Prarit Bhargava wrote: >> I still fail to understand why ? What will the _trylock() change ? > > viresh, afaict read_trylock will return 0 when busy with write: Yes.. > static inline int queue_read_trylock(struct qrwlock *lock) > { > u32 cnts; > >

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-10 Thread Prarit Bhargava
On 11/10/2014 05:44 AM, Viresh Kumar wrote: > On 5 November 2014 20:23, Prarit Bhargava wrote: >> commit 955ef4833574636819cd269cfbae12f79cbde63a (" cpufreq: Drop rwsem >> lock around CPUFREQ_GOV_POLICY_EXIT") opens up a hole in the locking >> scheme for cpufreq. >> >> Simple tests such as

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-10 Thread Viresh Kumar
On 5 November 2014 20:23, Prarit Bhargava wrote: > commit 955ef4833574636819cd269cfbae12f79cbde63a (" cpufreq: Drop rwsem > lock around CPUFREQ_GOV_POLICY_EXIT") opens up a hole in the locking > scheme for cpufreq. > > Simple tests such as rapidly switching the governor between ondemand and >

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-10 Thread Viresh Kumar
On 5 November 2014 20:23, Prarit Bhargava pra...@redhat.com wrote: commit 955ef4833574636819cd269cfbae12f79cbde63a ( cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT) opens up a hole in the locking scheme for cpufreq. Simple tests such as rapidly switching the governor between ondemand

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-10 Thread Prarit Bhargava
On 11/10/2014 05:44 AM, Viresh Kumar wrote: On 5 November 2014 20:23, Prarit Bhargava pra...@redhat.com wrote: commit 955ef4833574636819cd269cfbae12f79cbde63a ( cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT) opens up a hole in the locking scheme for cpufreq. Simple tests such as

Re: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-10 Thread Viresh Kumar
On 10 November 2014 17:56, Prarit Bhargava pra...@redhat.com wrote: I still fail to understand why ? What will the _trylock() change ? viresh, afaict read_trylock will return 0 when busy with write: Yes.. static inline int queue_read_trylock(struct qrwlock *lock) { u32 cnts;

[PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-05 Thread Prarit Bhargava
commit 955ef4833574636819cd269cfbae12f79cbde63a (" cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT") opens up a hole in the locking scheme for cpufreq. Simple tests such as rapidly switching the governor between ondemand and performance or attempting to read policy values while a governor

[PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls

2014-11-05 Thread Prarit Bhargava
commit 955ef4833574636819cd269cfbae12f79cbde63a ( cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT) opens up a hole in the locking scheme for cpufreq. Simple tests such as rapidly switching the governor between ondemand and performance or attempting to read policy values while a governor