linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	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>,
	Amir Goldstein <amir73il@gmail.com>, Jan Kara <jack@suse.cz>
Subject: Re: [RFC PATCH v2 2/2] locking/percpu-rwsem: Mark rwsem as non-spinnable in percpu_rwsem_release()
Date: Tue, 15 May 2018 13:51:12 +0200	[thread overview]
Message-ID: <20180515115112.GZ12217@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20180515110632.GA14527@redhat.com>

On Tue, May 15, 2018 at 01:06:33PM +0200, Oleg Nesterov wrote:
> On 05/15, Peter Zijlstra wrote:
> >
> > So what's wrong with adding:
> >
> > 	if (!read)
> > 		sem->rw_sem.owner = current;
> 
> Agreed, I have already suggested this change twice. Except we obviously
> need to check CONFIG_RWSEM_SPIN_ON_OWNER (->owner doesn't exists otherwise)
> or even CONFIG_DEBUG_RWSEMS to make the purpose more clear.

Right, details ;-)

> > Afaict the whole .owner=NULL thing in release already stops the spinners
> 
> Not really, the new writer will spin in this case, afaics.
> 
> But this is another problem and probably we do not care. The new writer is
> almost impossible in this particular case, another freeze_super() should
> notice frozen != SB_UNFROZEN and return EBUSY.

rwsem_spin_on_owner() checks rwsem_owner_is_writer(), which does owner
&& owner != RWSEM_READER_OWNED, which will fail for !owner.

Or am I completely confused again?

> > and the above 'fixes' the debug splat.
> 
> Yes.
> 
> Waiman, can't we trivially fix the problem first? Then we can add the helpers
> and think about other improvements.

It is really simple; we're not going to add public (and EXPORT'ed to
boot) interfaces to rwsem for this.

  reply	other threads:[~2018-05-15 11:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 19:31 [RFC PATCH v2 0/2] locking/rwsem: Fix DEBUG_RWSEM warning from thaw_sup Waiman Long
2018-05-14 19:31 ` [RFC PATCH v2 1/2] locking/rwsem: Add a new RWSEM_WRITER_OWNED_NOSPIN flag Waiman Long
2018-05-15  6:59   ` Amir Goldstein
2018-05-15  8:25   ` Peter Zijlstra
2018-05-14 19:31 ` [RFC PATCH v2 2/2] locking/percpu-rwsem: Mark rwsem as non-spinnable in percpu_rwsem_release() Waiman Long
2018-05-15  5:42   ` Amir Goldstein
2018-05-15  7:04     ` Amir Goldstein
2018-05-15 13:45     ` Waiman Long
2018-05-15  8:35   ` Peter Zijlstra
2018-05-15  9:00     ` Jan Kara
2018-05-15 11:33       ` Oleg Nesterov
2018-05-15  8:51   ` Peter Zijlstra
2018-05-15 11:06     ` Oleg Nesterov
2018-05-15 11:51       ` Peter Zijlstra [this message]
2018-05-15 12:45         ` Oleg Nesterov
2018-05-15 12:58           ` Peter Zijlstra
2018-05-15 13:57     ` Waiman Long
2018-05-15 14:00       ` Matthew Wilcox

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=20180515115112.GZ12217@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.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=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).