All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Davidlohr Bueso <dave@stgolabs.net>,
	"Theodore Y. Ts'o" <tytso@mit.edu>,
	Oleg Nesterov <oleg@redhat.com>,
	Amir Goldstein <amir73il@gmail.com>, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH v4 1/2] locking/rwsem: Add a new RWSEM_ANONYMOUSLY_OWNED flag
Date: Fri, 18 May 2018 09:02:58 +0200	[thread overview]
Message-ID: <20180518070258.GA20971@gmail.com> (raw)
In-Reply-To: <20180516121947.GE20670@bombadil.infradead.org>


* Matthew Wilcox <willy@infradead.org> wrote:

> On Tue, May 15, 2018 at 05:49:50PM -0400, Waiman Long wrote:
> > @@ -357,11 +357,8 @@ static inline bool rwsem_can_spin_on_owner(struct rw_semaphore *sem)
> >  
> >  	rcu_read_lock();
> >  	owner = READ_ONCE(sem->owner);
> > -	if (!rwsem_owner_is_writer(owner)) {
> > -		/*
> > -		 * Don't spin if the rwsem is readers owned.
> > -		 */
> > -		ret = !rwsem_owner_is_reader(owner);
> > +	if (!owner || !is_rwsem_owner_spinnable(owner)) {
> > +		ret = !owner;	/* !owner is spinnable */
> >  		goto done;
> >  	}
> 
> This is confusingly written.  I think you mean ...
> 
> 	if (!owner)
> 		goto done;
> 	if (!is_rwsem_owner_spinnable(owner)) {
> 		ret = false;
> 		goto done;
> 	}

Yes, that's cleaner. Waiman, mind sending a followup patch that cleans this up?

Thanks,

	Ingo

  reply	other threads:[~2018-05-18  7:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 21:49 [PATCH v4 0/2] locking/rwsem: Fix DEBUG_RWSEM warning from thaw_super() Waiman Long
2018-05-15 21:49 ` [PATCH v4 1/2] locking/rwsem: Add a new RWSEM_ANONYMOUSLY_OWNED flag Waiman Long
2018-05-16 10:34   ` [tip:locking/urgent] " tip-bot for Waiman Long
2018-05-16 10:48   ` [PATCH v4 1/2] " Oleg Nesterov
2018-05-16 11:59     ` Peter Zijlstra
2018-05-16 13:11     ` Waiman Long
2018-05-16 15:27       ` Oleg Nesterov
2018-05-16 12:19   ` Matthew Wilcox
2018-05-18  7:02     ` Ingo Molnar [this message]
2018-05-18  8:41       ` Oleg Nesterov
2018-05-18  9:40         ` Ingo Molnar
2018-05-18 16:55           ` [PATCH] locking/rwsem: simplify the is-owner-spinnable checks Oleg Nesterov
2018-05-18 17:00             ` Waiman Long
2018-05-25  9:51             ` [tip:locking/core] locking/rwsem: Simplify " tip-bot for Oleg Nesterov
2018-05-15 21:49 ` [PATCH v4 2/2] locking/percpu-rwsem: Annotate rwsem ownership transfer by setting RWSEM_OWNER_UNKNOWN Waiman Long
2018-05-16  5:37   ` Amir Goldstein
2018-05-16 13:17     ` Waiman Long
2018-05-16 10:35   ` [tip:locking/urgent] " tip-bot for Waiman Long

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=20180518070258.GA20971@gmail.com \
    --to=mingo@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=dave@stgolabs.net \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=willy@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.