]> git.baikalelectronics.ru Git - kernel.git/commit
rculist: Add hlists_swap_heads_rcu
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 24 Apr 2020 16:19:10 +0000 (11:19 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 28 Apr 2020 21:08:54 +0000 (16:08 -0500)
commit1c1edca5eb48901be3de286b680f72fd8184e138
treea461194992f27f31aad43d2c15ee8e0c53d81b91
parent18b4f1d3d36f3f537f8c57665105e8b2b0e707fc
rculist: Add hlists_swap_heads_rcu

Using the struct pid to refer to two tasks in de_thread was a clever
idea and ultimately too clever, as it has lead to proc_flush_task
being called inconsistently.

To support rectifying this add hlists_swap_heads_rcu.  An hlist
primitive that just swaps the hlist heads of two lists.  This is
exactly what is needed for exchanging the pids of two tasks.

Only consideration of correctness of the code has been given,
as the caller is expected to be a slowpath.

Link: https://lore.kernel.org/lkml/87mu6vajnq.fsf_-_@x220.int.ebiederm.org/
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
include/linux/rculist.h