acrn-kernel/kernel/cgroup
Michal Koutný cb8f1dd1b7 cgroup: Remove duplicates in cgroup v1 tasks file
commit 1ca0b60515 upstream.

One PID may appear multiple times in a preloaded pidlist.
(Possibly due to PID recycling but we have reports of the same
task_struct appearing with different PIDs, thus possibly involving
transfer of PID via de_thread().)

Because v1 seq_file iterator uses PIDs as position, it leads to
a message:
> seq_file: buggy .next function kernfs_seq_next did not update position index

Conservative and quick fix consists of removing duplicates from `tasks`
file (as opposed to removing pidlists altogether). It doesn't affect
correctness (it's sufficient to show a PID once), performance impact
would be hidden by unconditional sorting of the pidlist already in place
(asymptotically).

Link: https://lore.kernel.org/r/20230823174804.23632-1-mkoutny@suse.com/
Suggested-by: Firo Yang <firo.yang@suse.com>
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-19 23:08:57 +02:00
..
Makefile
cgroup-internal.h
cgroup-v1.c cgroup: Remove duplicates in cgroup v1 tasks file 2023-10-19 23:08:57 +02:00
cgroup.c sched/cpuset: Keep track of SCHED_DEADLINE task in cpusets 2023-08-30 16:11:10 +02:00
cpuset.c cgroup/cpuset: Inherit parent's load balance state in v2 2023-09-13 09:42:49 +02:00
debug.c
freezer.c
legacy_freezer.c cgroup,freezer: hold cpu_hotplug_lock before freezer_mutex in freezer_css_{online,offline}() 2023-06-28 11:12:25 +02:00
misc.c
namespace.c cgroup:namespace: Remove unused cgroup_namespaces_init() 2023-09-13 09:42:56 +02:00
pids.c
rdma.c
rstat.c