From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, Intel-gfx@lists.freedesktop.org
Subject: Re: [RFC 1/4] drm/i915: Reduce recursive mutex locking from the shrinker
Date: Thu, 3 Jan 2019 13:09:05 +0000 [thread overview]
Message-ID: <bc7b0505-91e2-4c0c-8860-23993c5a5cd6@linux.intel.com> (raw)
In-Reply-To: <154651856102.27300.15362060114461995053@skylake-alporthouse-com>
On 03/01/2019 12:29, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-01-03 12:23:26)
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> In two codepaths internal to the shrinker we know we will end up taking
>> the resursive mutex path.
>>
>> It instead feels more elegant to avoid this altogether and not call
>> mutex_trylock_recursive in those cases.
>>
>> We achieve this by adding a new I915_SHRINK_LOCKED flag which gets passed
>> to i915_gem_shrink by the internal callers.
>
> Since we reach here from many paths with struct_mutex either locked or
> unlocked, special casing one such seems silly. Especially when removing
> struct_mutex from here entirely is within our grasp.
Hm, for me it is silly that we rely on mutex_trylock_recursive to handle
what the code clearly knows. Would you be happy with the
__i915_gem_shrink which does no locking, and i915_gem_shrink wraps with
locking, approach instead?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-01-03 13:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 12:23 [RFC 0/4] Shrinker tweaks/fixes? Tvrtko Ursulin
2019-01-03 12:23 ` [RFC 1/4] drm/i915: Reduce recursive mutex locking from the shrinker Tvrtko Ursulin
2019-01-03 12:29 ` Chris Wilson
2019-01-03 13:09 ` Tvrtko Ursulin [this message]
2019-01-03 12:23 ` [RFC 2/4] drm/i915: Fix timeout handling in i915_gem_shrinker_vmap Tvrtko Ursulin
2019-01-03 12:23 ` [RFC 3/4] drm/i915: Return immediately if trylock fails for direct-reclaim Tvrtko Ursulin
2019-01-03 12:23 ` [RFC 4/4] drm/i915: Remove trylock-looping from the shrinker Tvrtko Ursulin
2019-01-03 12:56 ` Chris Wilson
2019-01-03 13:10 ` Tvrtko Ursulin
2019-01-03 12:45 ` ✗ Fi.CI.CHECKPATCH: warning for Shrinker tweaks/fixes? Patchwork
2019-01-03 12:47 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-01-03 13:06 ` ✓ Fi.CI.BAT: success " Patchwork
2019-01-03 14:54 ` ✗ Fi.CI.IGT: failure " 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=bc7b0505-91e2-4c0c-8860-23993c5a5cd6@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=chris@chris-wilson.co.uk \
/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.