LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] sched/fair: initialize throttle_count for new task-groups lazily
Date: Wed, 22 Jun 2016 10:23:57 +0200
Message-ID: <20160622082357.GA30154@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <576A4806.3090701@yandex-team.ru>

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.

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16 12:57 Konstantin Khlebnikov
2016-06-16 17:03 ` bsegall
2016-06-16 17:23   ` Konstantin Khlebnikov
2016-06-16 17:33     ` bsegall
2016-06-21 13:41 ` Konstantin Khlebnikov
2016-06-21 21:10 ` Peter Zijlstra
2016-06-22  8:10   ` Konstantin Khlebnikov
2016-06-22  8:23     ` Peter Zijlstra [this message]
2016-06-24  8:59 ` [tip:sched/urgent] sched/fair: Initialize " tip-bot for Konstantin Khlebnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160622082357.GA30154@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git
	git clone --mirror https://lore.kernel.org/lkml/10 lkml/git/10.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git