All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Phil Auld <pauld@redhat.com>
Cc: linux-kernel@vger.kernel.org, Ben Segall <bsegall@google.com>,
	Ingo Molnar <mingo@redhat.com>,
	Anton Blanchard <anton@ozlabs.org>
Subject: Re: [PATCH v2] sched/fair: Limit sched_cfs_period_timer loop to avoid hard lockup
Date: Thu, 21 Mar 2019 19:01:37 +0100	[thread overview]
Message-ID: <20190321180137.GQ6058@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190319130005.25492-1-pauld@redhat.com>

On Tue, Mar 19, 2019 at 09:00:05AM -0400, Phil Auld wrote:
> sched/fair: Limit sched_cfs_period_timer loop to avoid hard lockup
> 
> With extremely short cfs_period_us setting on a parent task group with a large
> number of children the for loop in sched_cfs_period_timer can run until the
> watchdog fires. There is no guarantee that the call to hrtimer_forward_now()
> will ever return 0.  The large number of children can make
> do_sched_cfs_period_timer() take longer than the period.

> 
> To prevent this we add protection to the loop that detects when the loop has run
> too many times and scales the period and quota up, proportionally, so that the timer
> can complete before then next period expires.  This preserves the relative runtime
> quota while preventing the hard lockup.
> 
> A warning is issued reporting this state and the new values.
> 
> v2: Math reworked/simplified by Peter Zijlstra.
> 
> Signed-off-by: Phil Auld <pauld@redhat.com>
> Cc: Ben Segall <bsegall@google.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: Anton Blanchard <anton@ozlabs.org>

Thanks!

  reply	other threads:[~2019-03-21 18:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 13:00 [PATCH v2] sched/fair: Limit sched_cfs_period_timer loop to avoid hard lockup Phil Auld
2019-03-21 18:01 ` Peter Zijlstra [this message]
2019-03-21 18:32   ` Phil Auld
2019-04-03  8:38 ` [tip:sched/core] " tip-bot for Phil Auld
     [not found]   ` <20190405141524.05DDA2186A@mail.kernel.org>
2019-04-08 13:42     ` Phil Auld
2019-04-08 14:50       ` Sasha Levin
2019-04-08 17:03         ` Phil Auld
2019-04-08 17:06           ` Sasha Levin
2019-04-08 17:31             ` Phil Auld
2019-04-09 12:48   ` Phil Auld
2019-04-09 13:05     ` Peter Zijlstra
2019-04-09 13:15       ` Phil Auld
2019-04-16 13:33       ` Phil Auld
2019-04-16 16:18       ` Phil Auld
2019-04-16 15:32 ` [tip:sched/urgent] sched/fair: Limit sched_cfs_period_timer() " tip-bot for Phil Auld
2019-04-16 19:26   ` Phil Auld

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=20190321180137.GQ6058@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=anton@ozlabs.org \
    --cc=bsegall@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pauld@redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.