lkml.org 
[lkml]   [2017]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] mm, shrinker: make shrinker_list lockless
From
Date
Shakeel Butt wrote:
> > If you can accept serialized register_shrinker()/unregister_shrinker(),
> > I think that something like shown below can do it.
>
> If we assume that we will never do register_shrinker and
> unregister_shrinker on the same object in parallel then do we still
> need to do msleep & synchronize_rcu() within mutex?

Doing register_shrinker() and unregister_shrinker() on the same object
in parallel is wrong. This mutex is to ensure that we do not need to
worry about ->list.next field. synchronize_rcu() should not be slow.
If you want to avoid msleep() with mutex held, you can also apply

> > If you want parallel register_shrinker()/unregister_shrinker(), something like
> > shown below on top of shown above will do it.

change.

\
 
 \ /
  Last update: 2017-11-09 22:46    [W:0.094 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site