Re: [v7 PATCH 03/12] mm: vmscan: use shrinker_rwsem to protect shrinker_maps allocation

2021-02-09 Thread Yang Shi
On Tue, Feb 9, 2021 at 12:33 PM Roman Gushchin wrote: > > On Tue, Feb 09, 2021 at 09:46:37AM -0800, Yang Shi wrote: > > Since memcg_shrinker_map_size just can be changed under holding > > shrinker_rwsem > > exclusively, the read side can be protected by holding read lock, so it > > sounds > > su

Re: [v7 PATCH 03/12] mm: vmscan: use shrinker_rwsem to protect shrinker_maps allocation

2021-02-09 Thread Roman Gushchin
On Tue, Feb 09, 2021 at 09:46:37AM -0800, Yang Shi wrote: > Since memcg_shrinker_map_size just can be changed under holding shrinker_rwsem > exclusively, the read side can be protected by holding read lock, so it sounds > superfluous to have a dedicated mutex. > > Kirill Tkhai suggested use write

[v7 PATCH 03/12] mm: vmscan: use shrinker_rwsem to protect shrinker_maps allocation

2021-02-09 Thread Yang Shi
Since memcg_shrinker_map_size just can be changed under holding shrinker_rwsem exclusively, the read side can be protected by holding read lock, so it sounds superfluous to have a dedicated mutex. Kirill Tkhai suggested use write lock since: * We want the assignment to shrinker_maps is visible