All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
	"Ingo Molnar" <mingo@elte.hu>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Nick Piggin" <nickpiggin@yahoo.com.au>
Subject: Re: [RFC][PATCH 2/6] lockdep: validate rcu_dereference() vs rcu_read_lock()
Date: Wed, 19 Sep 2007 22:13:49 +0200	[thread overview]
Message-ID: <20070919221349.2935f69d@lappy> (raw)
In-Reply-To: <d120d5000709191249w461967d6w8da303dc54f2dd41@mail.gmail.com>

On Wed, 19 Sep 2007 15:49:24 -0400 "Dmitry Torokhov"
<dmitry.torokhov@gmail.com> wrote:

> On 9/19/07, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > On Wed, 19 Sep 2007 14:49:56 -0400 "Dmitry Torokhov"
> > <dmitry.torokhov@gmail.com> wrote:
> >
> > > On 9/19/07, Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> >
> > > > PS to previous -- any problem with inserting rcu_read_lock() and
> > > > rcu_read_unlock() around the portion of the IRQ handler that has
> > > > these accesses?
> > > >
> > >
> > > I guess I could but it is an extra lock that needs to be managed and
> > > given the fact that it is not really needed (other to make a newly
> > > developed tool happy) I am hestsant to do that.
> >
> > As is, these sites are a bug in -rt and we'll need to fix them anyway.
> >
> > As for the code you pointed me to, the i8042 driver, it seems to play
> > way to funny tricks for a simple 'slow' driver.
> 
> Even "slow" driver should try not to slow down the rest of the system
> if it can help it. I am sorry if the thing it does do not quite fit in
> with the changes you are proposing but it does not make the exeisting
> code invalid.
> 
> >
> > If you replace the spin_lock() + sync_sched(), with rcu_read_lock() +
> > rcu_call() it should work again without adding an extra lock.
> >
> 
> Except that I need spin_lock_irq for other reasons. I could take the
> same lock in write-side code and not use RCU at all but using RCU
> allows opening/closing input devices without slowing down interrupt
> handlers so why not use it?

If the IRQ handler does rcu_read_lock(),unlock() and the i8042_stop()
function does sync_rcu() instead of _sched(), it should be good again.
It will not affect anything else than the task that calls _stop(). And
even there the only change is that the sleep might be a tad longer.

I find it curious that a driver that is 'low performant' and does not
suffer lock contention pioneers locking schemes. I agree with
optimizing, but this is not the place to push the envelope.

  reply	other threads:[~2007-09-19 20:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 10:41 [RFC][PATCH 0/6] using lockdep to validate rcu usage Peter Zijlstra
2007-09-19 10:41 ` [RFC][PATCH 1/6] lockdep: annotate rcu_read_{,un}lock{,_bh} Peter Zijlstra
2007-09-19 23:06   ` Paul E. McKenney
2007-09-19 10:41 ` [RFC][PATCH 2/6] lockdep: validate rcu_dereference() vs rcu_read_lock() Peter Zijlstra
2007-09-19 14:17   ` Dmitry Torokhov
2007-09-19 14:31     ` Peter Zijlstra
2007-09-19 15:16       ` Dmitry Torokhov
2007-09-19 15:25         ` Peter Zijlstra
2007-09-19 15:37         ` Paul E. McKenney
2007-09-19 16:59           ` Dmitry Torokhov
2007-09-19 17:32             ` Paul E. McKenney
2007-09-19 17:48               ` Paul E. McKenney
2007-09-19 18:49                 ` Dmitry Torokhov
2007-09-19 19:41                   ` Peter Zijlstra
2007-09-19 19:49                     ` Dmitry Torokhov
2007-09-19 20:13                       ` Peter Zijlstra [this message]
2007-09-19 20:41                         ` Dmitry Torokhov
2007-09-19 21:19                           ` Peter Zijlstra
2007-09-19 21:29                             ` Dmitry Torokhov
2007-09-19 21:47                               ` Peter Zijlstra
2007-09-20 17:31                                 ` Dmitry Torokhov
2007-09-21  0:01                                   ` Paul E. McKenney
2007-09-21 14:15                                     ` Dmitry Torokhov
2007-09-21 14:30                                       ` Peter Zijlstra
2007-09-19 20:48                       ` Paul E. McKenney
2007-09-19 10:41 ` [RFC][PATCH 3/6] lockdep: rcu_dereference() vs preempt_disable() Peter Zijlstra
2007-09-19 10:41 ` [RFC][PATCH 4/6] implicit vs explicit preempt_disable() Peter Zijlstra
2007-09-19 10:41 ` [RFC][PATCH 5/6] fixup funny preemption tricks in irq_exit Peter Zijlstra
2007-09-19 10:41 ` [RFC][PATCH 6/6] fixup early boot Peter Zijlstra
2007-09-19 13:38 ` [RFC][PATCH 0/6] using lockdep to validate rcu usage Ingo Molnar

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=20070919221349.2935f69d@lappy \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=paulmck@linux.vnet.ibm.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.