Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1428540

Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily
Date 2016-06-22 10:30 +0200
Message-ID <rMLHQ-ZT-13@gated-at.bofh.it> (permalink)
References <rKF3Q-8v4-23@gated-at.bofh.it> <rMBIu-2Rm-29@gated-at.bofh.it> <rMLy9-Wz-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jun 22, 2016 at 11:10:46AM +0300, Konstantin Khlebnikov wrote:
> On 22.06.2016 00:10, Peter Zijlstra wrote:
> >On Thu, Jun 16, 2016 at 03:57:01PM +0300, Konstantin Khlebnikov wrote:
> >>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).
> >
> >You're talking about taking rq->lock in alloc_fair_sched_group(), right?
> >
> >We're about to go do that anyway... But I suppose for backports this
> >makes sense. Doing it at creation time also avoids the issues Ben
> >raised, right?
> 
> Yes, all will be fine. But for 8192-cores this will be disaster =)

Well, creating cgroups isn't something you do much of, and creating them
will be proportionally expensive already, as we allocate all kinds of
per-cpu data.

In any case, we 'need' to do this because of the per entity load
tracking stuff, entities, even blocked, should be added to the cfs_rq.

> throttle_count must be initialized after linking tg into lists. obviously.

Crud, that's later than we currently take the rq lock. Let me see how
much pain it is to re-order all that.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] sched/fair: initialize throttle_count for new task-groups  lazily Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2016-06-16 15:00 +0200
  Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily bsegall@google.com - 2016-06-16 19:10 +0200
    Re: [PATCH] sched/fair: initialize throttle_count for new task-groups  lazily Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2016-06-16 19:30 +0200
      Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily bsegall@google.com - 2016-06-16 19:40 +0200
  Re: [PATCH] sched/fair: initialize throttle_count for new task-groups  lazily Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2016-06-21 15:50 +0200
  Re: [PATCH] sched/fair: initialize throttle_count for new  task-groups lazily Peter Zijlstra <peterz@infradead.org> - 2016-06-21 23:50 +0200
    Re: [PATCH] sched/fair: initialize throttle_count for new task-groups  lazily Konstantin Khlebnikov <khlebnikov@yandex-team.ru> - 2016-06-22 10:20 +0200
      Re: [PATCH] sched/fair: initialize throttle_count for new  task-groups lazily Peter Zijlstra <peterz@infradead.org> - 2016-06-22 10:30 +0200

csiph-web