Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-26 Thread Christian König
Am 26.08.21 um 17:34 schrieb Daniel Vetter: On Thu, Aug 26, 2021 at 04:58:06PM +0200, Christian König wrote: Am 26.08.21 um 15:28 schrieb Daniel Vetter: On Thu, Aug 26, 2021 at 03:27:30PM +0200, Daniel Vetter wrote: On Fri, Aug 20, 2021 at 02:05:27PM +0200, Christian König wrote: From: Chr

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-26 Thread Daniel Vetter
On Thu, Aug 26, 2021 at 04:58:06PM +0200, Christian König wrote: > Am 26.08.21 um 15:28 schrieb Daniel Vetter: > > On Thu, Aug 26, 2021 at 03:27:30PM +0200, Daniel Vetter wrote: > > > On Fri, Aug 20, 2021 at 02:05:27PM +0200, Christian König wrote: > > > > From: Christian König > > > > > > > > Wh

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-26 Thread Christian König
Am 26.08.21 um 15:28 schrieb Daniel Vetter: On Thu, Aug 26, 2021 at 03:27:30PM +0200, Daniel Vetter wrote: On Fri, Aug 20, 2021 at 02:05:27PM +0200, Christian König wrote: From: Christian König While unplugging a device the TTM shrinker implementation needs a barrier to make sure that all con

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-26 Thread Daniel Vetter
On Thu, Aug 26, 2021 at 03:27:30PM +0200, Daniel Vetter wrote: > On Fri, Aug 20, 2021 at 02:05:27PM +0200, Christian König wrote: > > From: Christian König > > > > While unplugging a device the TTM shrinker implementation > > needs a barrier to make sure that all concurrent shrink > > operations

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-26 Thread Daniel Vetter
On Fri, Aug 20, 2021 at 02:05:27PM +0200, Christian König wrote: > From: Christian König > > 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

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-22 Thread Andrew Morton
On Fri, 20 Aug 2021 14:05:27 +0200 "Christian König" wrote: > 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 th

[PATCH 1/2] mm/vmscan: add sync_shrinkers function v2

2021-08-20 Thread Christian König
From: Christian König 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 unmapp

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function

2021-04-15 Thread Daniel Vetter
On Thu, Apr 15, 2021 at 01:56:23PM +0200, Christian König wrote: > To be able to switch to a spinlock and reduce lock contention in the TTM > shrinker we don't want to hold a mutex while unmapping and freeing pages > from the pool. > > But then we somehow need to prevent a race between (for exampl

[PATCH 1/2] mm/vmscan: add sync_shrinkers function

2021-04-15 Thread Christian König
To be able to switch to a spinlock and reduce lock contention in the TTM shrinker we don't want to hold a mutex while unmapping and freeing pages from the pool. But then we somehow need to prevent a race between (for example) the shrinker trying to free pages and hotplug trying to remove the devic

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function

2021-04-09 Thread Christian König
Am 09.04.21 um 13:00 schrieb Vlastimil Babka: On 4/9/21 9:17 AM, Christian König wrote: To be able to switch to a spinlock and reduce lock contention in the TTM shrinker we don't want to hold a mutex while unmapping and freeing pages from the pool. Does using spinlock instead of mutex really re

Re: [PATCH 1/2] mm/vmscan: add sync_shrinkers function

2021-04-09 Thread Vlastimil Babka
On 4/9/21 9:17 AM, Christian König wrote: > To be able to switch to a spinlock and reduce lock contention in the TTM > shrinker we don't want to hold a mutex while unmapping and freeing pages > from the pool. Does using spinlock instead of mutex really reduce lock contention? > But then we someho

[PATCH 1/2] mm/vmscan: add sync_shrinkers function

2021-04-09 Thread Christian König
To be able to switch to a spinlock and reduce lock contention in the TTM shrinker we don't want to hold a mutex while unmapping and freeing pages from the pool. But then we somehow need to prevent a race between (for example) the shrinker trying to free pages and hotplug trying to remove the devic