dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm: make idr_mutex a spinlock
Date: Fri, 29 Aug 2014 15:17:30 +0200	[thread overview]
Message-ID: <20140829131729.GV17519@ulmo> (raw)
In-Reply-To: <CANq1E4T5xULD6grCje1bvu=Gf=MuggxOQEz_T+HhqgRNhCNGMg@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 947 bytes --]

On Fri, Aug 29, 2014 at 03:11:19PM +0200, David Herrmann wrote:
> Hi
> 
> On Fri, Aug 29, 2014 at 3:10 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Fri, Aug 29, 2014 at 02:01:00PM +0200, David Herrmann wrote:
> >> There is no reason to use a heavy mutex for idr protection. Use a spinlock
> >> and make idr-allocation use idr_preload().
> >>
> >> This patch also makes mode-object lookup irq-save, in case you ever wanna
> >> lookup modeset objects from interrupts. This is just a side-effect of
> >> avoiding a mutex.
> >
> > I don't think that's entirely accurate. idr_preload(GFP_KERNEL) might
> > sleep since GFP_KERNEL & __GFP_WAIT != 0.
> 
> idr_preload() is only used in registration, not in lookups. Not sure
> what you refer to?

Yes, you're right. I wasn't paying close enough attention and somehow
applied "makes irq-safe" to the "idr_preload()" change without relating
it to "lookup".

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2014-08-29 13:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 12:01 [PATCH 1/2] drm: make idr_mutex a spinlock David Herrmann
2014-08-29 12:01 ` [PATCH 2/2] drm: don't recycle used modeset IDs David Herrmann
2014-08-29 12:51   ` Daniel Vetter
2014-08-29 12:57     ` David Herrmann
2014-08-29 13:10       ` David Herrmann
2014-08-29 15:22         ` Rob Clark
2014-08-29 13:32       ` Daniel Vetter
2014-08-29 12:53 ` [PATCH 1/2] drm: make idr_mutex a spinlock Daniel Vetter
2014-08-29 13:03   ` David Herrmann
2014-08-29 13:34     ` Daniel Vetter
2014-08-29 13:10 ` Thierry Reding
2014-08-29 13:11   ` David Herrmann
2014-08-29 13:17     ` Thierry Reding [this message]

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=20140829131729.GV17519@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dh.herrmann@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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