From: Boqun Feng <boqun.feng@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>, Will Deacon <will@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, bigeasy@linutronix.de,
juri.lelli@redhat.com, williams@redhat.com, bristot@redhat.com,
longman@redhat.com, dave@stgolabs.net, jack@suse.com
Subject: Re: [PATCH] locking/percpu_rwsem: Rewrite to not use rwsem
Date: Tue, 6 Aug 2019 22:15:23 +0800 [thread overview]
Message-ID: <20190806141523.GC972@tardis> (raw)
In-Reply-To: <20190805154328.GJ2332@hirez.programming.kicks-ass.net>
[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]
On Mon, Aug 05, 2019 at 05:43:28PM +0200, Peter Zijlstra wrote:
> On Mon, Aug 05, 2019 at 10:58:13PM +0800, Boqun Feng wrote:
> > On Mon, Aug 05, 2019 at 10:43:18PM +0800, Boqun Feng wrote:
> > > On Mon, Aug 05, 2019 at 04:02:41PM +0200, Peter Zijlstra wrote:
> > > [...]
> > > >
> > > > static inline void percpu_up_read(struct percpu_rw_semaphore *sem)
> > > > {
> > > > + rwsem_release(&sem->dep_map, 1, _RET_IP_);
> > > > +
> > > > preempt_disable();
> > > > /*
> > > > * Same as in percpu_down_read().
> > > > */
> > > > - if (likely(rcu_sync_is_idle(&sem->rss)))
> > > > + if (likely(rcu_sync_is_idle(&sem->rss))) {
> > > > __this_cpu_dec(*sem->read_count);
> > > > - else
> > > > - __percpu_up_read(sem); /* Unconditional memory barrier */
> > > > - preempt_enable();
> > > > + preempt_enable();
> > > > + return;
> > > > + }
> > > >
> > > > - rwsem_release(&sem->rw_sem.dep_map, 1, _RET_IP_);
> > >
> > > Missing a preempt_enable() here?
> > >
> >
> > Ah.. you modified the semantics of __percpu_up_read() to imply a
> > preempt_enable(), sorry for the noise...
>
> Yes indeed; I suppose I should've noted that in the Changlog. The reason
> is that waitqueues use spin_lock() which change into a sleepable lock on
> RT and thus cannot be used with preeption disabled. We also cannot
> (easily) switch to swait because we use both exclusive and !exclusive
> waits.
Thanks for the explanation. I was missing the point that the modfication
is mostly for RT, much clear now ;-)
Regards,
Boqun
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-08-06 14:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 14:02 [PATCH] locking/percpu_rwsem: Rewrite to not use rwsem Peter Zijlstra
2019-08-05 14:43 ` Boqun Feng
2019-08-05 14:58 ` Boqun Feng
2019-08-05 15:43 ` Peter Zijlstra
2019-08-06 14:15 ` Boqun Feng [this message]
2019-08-06 16:17 ` Oleg Nesterov
2019-08-06 17:15 ` Peter Zijlstra
2019-08-07 9:56 ` Oleg Nesterov
2019-10-29 18:47 ` Peter Zijlstra
2019-10-30 14:21 ` Oleg Nesterov
2019-10-30 16:09 ` Peter Zijlstra
2019-10-30 17:52 ` Peter Zijlstra
2019-10-30 18:47 ` Peter Zijlstra
2019-10-30 19:31 ` Peter Zijlstra
2019-10-31 6:11 ` Peter Zijlstra
2019-08-07 14:45 ` Will Deacon
2019-10-29 19:06 ` Peter Zijlstra
2019-10-30 15:57 ` Oleg Nesterov
2019-10-30 16:47 ` Peter Zijlstra
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=20190806141523.GC972@tardis \
--to=boqun.feng@gmail.com \
--cc=bigeasy@linutronix.de \
--cc=bristot@redhat.com \
--cc=dave@stgolabs.net \
--cc=jack@suse.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=williams@redhat.com \
/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.