Re: [PATCH] locking/percpu_rwsem: Rewrite to not use rwsem

Peter Zijlstra
2019-10-30T16:47:55Z

On Wed, Oct 30, 2019 at 04:57:20PM +0100, Oleg Nesterov wrote:
> On 10/29, Peter Zijlstra wrote:
> >
> > That said, I think cgroups use a variant of percpu-rwsem that wreck rss
> > on purpose and always take the slowpaths.
>
> I forgot (never understodd) why does Android need this.
>
> I am wondering if it makes any sense to add a config/boot or even runtime
> knob for cgroup_threadgroup_rwsem.

It isn't just Android, but Android in specific likes to move tasks
between cgroups a lot.

And moving tasks between cgroups is what requires the write-side of the
cgroup percpu-rwsem to be taken. Adding an RCU-GP to every task movement
wasn't making them happy (which I can understand).