[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191030160908.GS4114@hirez.programming.kicks-ass.net>
Date: Wed, 30 Oct 2019 17:09:08 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Will Deacon <will.deacon@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, bigeasy@...utronix.de,
juri.lelli@...hat.com, williams@...hat.com, bristot@...hat.com,
longman@...hat.com, dave@...olabs.net, jack@...e.com
Subject: Re: [PATCH] locking/percpu_rwsem: Rewrite to not use rwsem
On Wed, Oct 30, 2019 at 03:21:10PM +0100, Oleg Nesterov wrote:
> On 10/29, Peter Zijlstra wrote:
> >
> > I like that symmetry, but see below ...
>
> ...
>
> > > void __percpu_up_read(struct percpu_rw_semaphore *sem)
> > > {
> > > smp_mb();
> > >
> > > __this_cpu_dec(*sem->read_count);
> > >
> > preempt_enable();
> > > wake_up(&sem->waiters);
> > preempt_disable()
> >
> > and this (sadly) means there's a bunch of back-to-back
> > preempt_disable()+preempt_enable() calls.
>
> Hmm. Where did these enable+disable come from?
>
> void __percpu_up_read(struct percpu_rw_semaphore *sem)
> {
> smp_mb();
>
> __this_cpu_dec(*sem->read_count);
>
> wake_up(&sem->waiters);
> }
>
> should work just fine?
Not on PREEMPT_RT, because wake_up() will take wait_queue_head::lock,
which is spin_lock_t and turns into a pi_mutex, which we cannot take
with preemption disabled.
Powered by blists - more mailing lists