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).
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -360,10 +360,9 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type, · 359 unmodified lines | ||
| 360 | 360 | } |
| 361 | 361 | css_task_iter_end(&it); |
| 362 | 362 | length = n; |
| 363 | − /* now sort & (if procs) strip out duplicates */ | |
| 363 | + /* now sort & strip out duplicates (tgids or recycled thread PIDs) */ | |
| 364 | 364 | sort(array, length, sizeof(pid_t), cmppid, NULL); |
| 365 | − if (type == CGROUP_FILE_PROCS) | |
| 366 | − length = pidlist_uniq(array, length); | |
| 365 | + length = pidlist_uniq(array, length); | |
| 367 | 366 | |
| 368 | 367 | l = cgroup_pidlist_find_create(cgrp, type); |
| 369 | 368 | if (!l) { |