lkml.org 
[lkml]   [2017]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] locking/rwsem: Make rwsem_is_contended() track status of OSQ
From
Date
On 03/07/2017 12:45 PM, Peter Zijlstra wrote:
> On Tue, Mar 07, 2017 at 11:03:48AM -0500, Waiman Long wrote:
>> It was found that the current rwsem_is_contended() function did not
>> look at the status of the OSQ and hence would miss waiters on OSQ. So
>> that function is now modified to look at the OSQ as well.
> Ideally I'd kill the entire function.
>
> if (need_resched() ||
> rwsem_is_contended(&fs_info->commit_root_sem)) {
> if (wakeup)
> caching_ctl->progress = last;
> btrfs_release_path(path);
> up_read(&fs_info->commit_root_sem);
> mutex_unlock(&caching_ctl->mutex);
> cond_resched();
> mutex_lock(&caching_ctl->mutex);
> down_read(&fs_info->commit_root_sem);
> goto next;
> }
>
> is the only user of it in the entire tree and it makes no bloody sense
> what so ever. rwsem is a preemptible lock after all.

That works for me too. I do realize that there is only one user in the
kernel, but I am hesitant to change it as I am not familiar with that
piece of code.

Cheers,
Longman

\
 
 \ /
  Last update: 2017-03-07 21:51    [W:0.076 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site