]> git.baikalelectronics.ru Git - kernel.git/commit
sched/fair: Initialize throttle_count for new task-groups lazily
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Thu, 16 Jun 2016 12:57:01 +0000 (15:57 +0300)
committerIngo Molnar <mingo@kernel.org>
Fri, 24 Jun 2016 06:26:44 +0000 (08:26 +0200)
commit2da979cad74581d87e1ab213664b4567699e69b2
treea46b2d8e6e72d37af00388d20bdfb900f895f2c0
parent50485e02684f054b964d3e72d53e9872cd701011
sched/fair: Initialize throttle_count for new task-groups lazily

Cgroup created inside throttled group must inherit current throttle_count.
Broken throttle_count allows to nominate throttled entries as a next buddy,
later this leads to null pointer dereference in pick_next_task_fair().

This patch initialize cfs_rq->throttle_count at first enqueue: laziness
allows to skip locking all rq at group creation. Lazy approach also allows
to skip full sub-tree scan at throttling hierarchy (not in this patch).

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bsegall@google.com
Link: http://lkml.kernel.org/r/146608182119.21870.8439834428248129633.stgit@buzz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/fair.c
kernel/sched/sched.h