]> git.baikalelectronics.ru Git - kernel.git/commit
mm/vmscan: add sync_shrinkers function v3
authorChristian König <ckoenig.leichtzumerken@gmail.com>
Thu, 15 Apr 2021 11:56:23 +0000 (13:56 +0200)
committerChristian König <christian.koenig@amd.com>
Fri, 27 Aug 2021 07:55:15 +0000 (09:55 +0200)
commit116c4c410a6a9b8d6eae46a2c4bbb5dc69310e6f
tree60547e431f158d6a5cf33d96f60dab470253486e
parentc1ea94998c991ac0cc02afb26dc5647f977ad162
mm/vmscan: add sync_shrinkers function v3

While unplugging a device the TTM shrinker implementation
needs a barrier to make sure that all concurrent shrink
operations are done and no other CPU is referring to a
device specific pool any more.

Taking and releasing the shrinker semaphore on the write
side after unmapping and freeing all pages from the device
pool should make sure that no shrinker is running in
paralell.

This allows us to avoid the contented mutex in the TTM pool
implementation for every alloc/free operation.

v2: rework the commit message to make clear why we need this
v3: rename the function and add more doc as suggested by Daniel

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Huang Rui <ray.huang@amd.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210820120528.81114-2-christian.koenig@amd.com
include/linux/shrinker.h
mm/vmscan.c