mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] locking/rwsem: Make rwsem_is_contended() track status of OSQ
Date: Tue, 7 Mar 2017 13:21:44 -0500	[thread overview]
Message-ID: <a4fd12c0-2422-497d-af4f-b9d5cff59d8c@redhat.com> (raw)
In-Reply-To: <20170307174504.GC3312@twins.programming.kicks-ass.net>

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

      reply	other threads:[~2017-03-07 20:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 16:03 Waiman Long
2017-03-07 17:45 ` Peter Zijlstra
2017-03-07 18:21   ` Waiman Long [this message]

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=a4fd12c0-2422-497d-af4f-b9d5cff59d8c@redhat.com \
    --to=longman@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®