All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ilija Hadzic <ihadzic@research.bell-labs.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v3] drm: do not sleep on vblank while holding a mutex
Date: Mon, 31 Oct 2011 22:09:44 +0100	[thread overview]
Message-ID: <20111031210944.GD30108@phenom.ffwll.local> (raw)
In-Reply-To: <1320081021-14970-1-git-send-email-ihadzic@research.bell-labs.com>

On Mon, Oct 31, 2011 at 01:10:21PM -0400, Ilija Hadzic wrote:
> drm_wait_vblank must be DRM_UNLOCKED because otherwise it
> will grab the drm_global_mutex and then go to sleep until the vblank
> event it is waiting for. That can wreck havoc in the windowing system
> because if one process issues this ioctl, it will block all other
> processes for the duration of all vblanks between the current and the
> one it is waiting for. In some cases it can block the entire windowing
> system.
> 
> v2: incorporate comments received from Daniel Vetter and
>     Michel Daenzer.
> 
> v3: after a lengty discussion with Daniel Vetter, it was concluded
>     we should not worry about any locking, within drm_wait_vblank
>     function so this patch becomes a rather trivial removal
>     of drm_global_mutex from drm_wait_vblank

That commit message is a bit garbage. What about ...

"... it was concluded that the only think not yet protected with locks and
atomic ops is the write to dev->last_vblank_wait. It's only used in a
debug file in proc, and the current code already employs no correct
locking: the proc file only takes dev->struct_mutex, whereas
drm_wait_vblank implicitly took the drm_global_mutex. Given all this, it's
not worth bothering to try to fix this at this time."

I think it's important to correctly document the conclusion of this
discussion, because we've worried quite a bit about correct locking.

Yours, Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2011-10-31 21:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 17:10 [PATCH v3] drm: do not sleep on vblank while holding a mutex Ilija Hadzic
2011-10-31 21:09 ` Daniel Vetter [this message]
2011-10-31 21:13   ` Ilija Hadzic

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=20111031210944.GD30108@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ihadzic@research.bell-labs.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.