Skip to content

Commit 20f4757

Browse files
committed
Merge tag 'cgroup-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
Pull cgroup fixes from Tejun Heo: - In cgroup1, the `tasks` file could have duplicate pids which can trigger a warning in seq_file. Fix it by removing duplicate items after sorting - Comment update * tag 'cgroup-for-6.6-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Fix incorrect css_set_rwsem reference in comment cgroup: Remove duplicates in cgroup v1 tasks file
2 parents e5e1170 + 13cc9ee commit 20f4757

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/linux/cgroup-defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ struct css_set {
238238
* Lists running through all tasks using this cgroup group.
239239
* mg_tasks lists tasks which belong to this cset but are in the
240240
* process of being migrated out or in. Protected by
241-
* css_set_rwsem, but, during migration, once tasks are moved to
241+
* css_set_lock, but, during migration, once tasks are moved to
242242
* mg_tasks, it can be read safely while holding cgroup_mutex.
243243
*/
244244
struct list_head tasks;

kernel/cgroup/cgroup-v1.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,9 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type,
360360
}
361361
css_task_iter_end(&it);
362362
length = n;
363-
/* now sort & (if procs) strip out duplicates */
363+
/* now sort & strip out duplicates (tgids or recycled thread PIDs) */
364364
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);
367366

368367
l = cgroup_pidlist_find_create(cgrp, type);
369368
if (!l) {

0 commit comments

Comments
 (0)