From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: "open list:HID CORE LAYER" <linux-input@vger.kernel.org>,
Henrik Rydberg <rydberg@euromail.se>
Subject: Re: [RFC PATCH] Input: evdev - drop redundant list-locking
Date: Sun, 20 Jul 2014 12:53:31 -0700 [thread overview]
Message-ID: <20140720195331.GB4446@core.coreip.homeip.net> (raw)
In-Reply-To: <CANq1E4RRV7A3dAJgeNCV72Q_sUz7mhbSPFLP+f3J+K2YVd4_0w@mail.gmail.com>
On Sun, Jul 20, 2014 at 09:00:02PM +0200, David Herrmann wrote:
> Hi
>
> On Sun, Jul 20, 2014 at 8:54 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Sun, Jul 20, 2014 at 08:48:12PM +0200, David Herrmann wrote:
> >> evdev->client_list is rcu-protected. There is no need to have a
> >> separate spinlock just for the list. Either one is good enough, so lets
> >> drop the spinlock.
> >>
> >> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
> >> ---
> >> Hi
> >>
> >> I stumbled across this one when doing some evdev reviews. Maybe I'm missing
> >> something obvious and I should stop coding on Sundays. But the RCU-protection
> >> should be enough here, right?
> >
> > RCU protection is for traversing list only, writes (as is adding and removing
> > elements from client_list) still have to be mutually exclusive.
>
> Oh, you mean to protect against concurrent writes? Right, but we could
> just use evdev->mutex for that. I mean all paths that call
> attach_client() or detach_client() already lock evdev->mutex at some
> point. It would allow us to get rid of the lock.
Right, we probably could do it by pulling taking/releasing evdev->mutex into
evdev_pen and evdev_release.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2014-07-20 19:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-20 18:48 [RFC PATCH] Input: evdev - drop redundant list-locking David Herrmann
2014-07-20 18:54 ` Dmitry Torokhov
2014-07-20 19:00 ` David Herrmann
2014-07-20 19:53 ` Dmitry Torokhov [this message]
2014-07-20 20:03 ` [PATCH v2] " David Herrmann
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=20140720195331.GB4446@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=dh.herrmann@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=rydberg@euromail.se \
/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.