Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594464

Re: [PATCH] locking/rwsem: Make rwsem_is_contended() track status of OSQ

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] locking/rwsem: Make rwsem_is_contended() track status of OSQ
Date 2017-03-07 18:50 +0100
Message-ID <tirpf-2s0-9@gated-at.bofh.it> (permalink)
References <tipQt-1uF-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] locking/rwsem: Make rwsem_is_contended() track status of OSQ Waiman Long <longman@redhat.com> - 2017-03-07 17:10 +0100
  Re: [PATCH] locking/rwsem: Make rwsem_is_contended() track status of  OSQ Peter Zijlstra <peterz@infradead.org> - 2017-03-07 18:50 +0100
    Re: [PATCH] locking/rwsem: Make rwsem_is_contended() track status of  OSQ Waiman Long <longman@redhat.com> - 2017-03-07 22:00 +0100

csiph-web