Re: [PATCH 0/2] mm/shrinker: make unregister_shrinker() less fragile

From: Christoph Hellwig
Date: Sat Jul 11 2015 - 06:02:51 EST


On Sat, Jul 11, 2015 at 11:51:53AM +0900, Sergey Senozhatsky wrote:
> Hello,
>
> Shrinker API does not handle nicely unregister_shrinker() on a not-registered
> ->shrinker. Looking at shrinker users, they all have to
> (a) carry on some sort of a flag to make sure that "unregister_shrinker()"
> will not blow up later
> (b) be fishy (potentially can Oops)
> (c) access private members `struct shrinker' (e.g. `shrink.list.next')

Ayone who does that is broken. You just need to have clear init (with
proper unwinding) and exit functions and order things properly. It
works like most register/unregister calls and should stay that way.

Maye you you should ty to explain what practical problem you're seeing
to start with.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/