public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 4/5] drm/i915: Spin for struct_mutex inside shrinker
Date: Tue, 13 Jun 2017 16:59:09 +0300	[thread overview]
Message-ID: <1497362349.5158.1.camel@linux.intel.com> (raw)
In-Reply-To: <20170609110350.1767-4-chris@chris-wilson.co.uk>

On pe, 2017-06-09 at 12:03 +0100, Chris Wilson wrote:
> Having resolved whether or not we would deadlock upon a call to
> mutex_lock(&dev->struct_mutex), we can then spin for the contended
> struct_mutex if we are not the owner. We cannot afford to simply block
> and wait for the mutex, as the owner may itself be waiting for the
> allocator -- i.e. a cyclic deadlock. This should significantly improve
> the chance of running the shrinker for other processes whilst the GPU is
> busy.
> 
> A more balanced approach would be to optimistically spin whilst the
> mutex owner was on the cpu and there was an opportunity to acquire the
> mutex for ourselves quickly. However, that requires support from
> kernel/locking/ and a new mutex_spin_trylock() primitive.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-06-13 13:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 11:03 [PATCH v2 1/5] drm/i915: Encourage our shrinker more when our shmemfs allocations fails Chris Wilson
2017-06-09 11:03 ` [PATCH v2 2/5] drm/i915: Remove __GFP_NORETRY from our buffer allocator Chris Wilson
2017-06-09 11:07   ` Michal Hocko
2017-06-13 14:01   ` Joonas Lahtinen
2017-06-09 11:03 ` [PATCH v2 3/5] drm/i915: Only restrict noreclaim in the early shrink passes Chris Wilson
2017-06-13 14:02   ` Joonas Lahtinen
2017-06-09 11:03 ` [PATCH v2 4/5] drm/i915: Spin for struct_mutex inside shrinker Chris Wilson
2017-06-13 13:59   ` Joonas Lahtinen [this message]
2017-06-09 11:03 ` [PATCH v2 5/5] drm/i915: Start writeback from the shrinker Chris Wilson
2017-06-09 11:17   ` Michal Hocko
2017-06-09 11:51     ` Chris Wilson
2017-06-09 13:35       ` Michal Hocko
2017-06-13 14:07   ` Joonas Lahtinen
2017-06-14 10:03     ` Chris Wilson
2017-06-09 11:31 ` ✓ Fi.CI.BAT: success for series starting with [v2,1/5] drm/i915: Encourage our shrinker more when our shmemfs allocations fails Patchwork

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=1497362349.5158.1.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@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