[lkml]   [2014]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/5] cpufreq, fix locking around CPUFREQ_GOV_POLICY_EXIT calls
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:


> static inline int queue_read_trylock(struct qrwlock *lock)
> {
> u32 cnts;
> cnts = atomic_read(&lock->cnts);
> if (likely(!(cnts & _QW_WMASK))) {
> so the deadlock will not occur. the show() is opened, write lock is taken, and
> if the thread is rescheduled and takes read lock the trylock will return 0, and
> the thread will return -EBUSY to userspace avoiding the deadlock.

Which deadlock? And also your changelog talks about accessing invalid pointers
without the trylock change, how can that be possible? After the read
lock is taken,
all the pointers should be valid.

 \ /
  Last update: 2014-11-11 05:01    [W:0.101 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site