Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1445130

Re: [rfc PATCH] drm/i915: Simplify shrinker_lock

From Chris Wilson <chris@chris-wilson.co.uk>
Newsgroups linux.kernel
Subject Re: [rfc PATCH] drm/i915: Simplify shrinker_lock
Date 2016-07-18 00:00 +0200
Message-ID <rW2gp-5Ys-3@gated-at.bofh.it> (permalink)
References <rVZix-4fE-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Jul 17, 2016 at 11:45:44AM -0700, Davidlohr Bueso wrote:
> In addition, we can simplify the overall function wrt (2), by first
> checking if we are the lock owner, then address the trylock and
> deal with (2) if locked/contended by a traditional mutex_lock().
> This should be safe considering that if current is the lock owner,
> then we are guaranteed not to race with the counter->owner updates
> (the counter is updated first which sets the mutex to be visibly locked).

However, that is then subject to an indirect ABBA deadlock, between the
shrinker lock and the struct mutex (or at least that used to be the case
where the kswapd reclaim would be blocked on the mutex and an alloc
blocked on kswapd).

Unravelling the gross locking is an ongoing task, with one of the chief
goals being able to reclaim memory whenever required. It is not pretty
and often fails under pressure.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[rfc PATCH] drm/i915: Simplify shrinker_lock Davidlohr Bueso <dave@stgolabs.net> - 2016-07-17 20:50 +0200
  Re: [rfc PATCH] drm/i915: Simplify shrinker_lock Chris Wilson <chris@chris-wilson.co.uk> - 2016-07-18 00:00 +0200
    Re: [Intel-gfx] [rfc PATCH] drm/i915: Simplify shrinker_lock Daniel Vetter <daniel@ffwll.ch> - 2016-07-19 09:10 +0200

csiph-web