Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755346AbbDGPNA (ORCPT ); Tue, 7 Apr 2015 11:13:00 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:35216 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755267AbbDGPM5 (ORCPT ); Tue, 7 Apr 2015 11:12:57 -0400 Date: Tue, 7 Apr 2015 17:12:46 +0200 From: Peter Zijlstra To: Konstantin Khlebnikov Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Ben Segall , Roman Gushchin Subject: Re: [PATCH RFC] sched/fair: fix sudden expiration of cfq quota in put_prev_task() Message-ID: <20150407151246.GS24151@twins.programming.kicks-ass.net> References: <20150403124138.1349.11633.stgit@buzz> <551E8CC5.30906@yandex-team.ru> <20150407125251.GM23123@twins.programming.kicks-ass.net> <20150407134758.GR24151@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150407134758.GR24151@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1187 Lines: 41 On Tue, Apr 07, 2015 at 03:47:58PM +0200, Peter Zijlstra wrote: > Lemme think a bit more on that. So going by 734ff2a71f9e ("sched/rt: Fix picking RT and DL tasks from empty queue") something like this would be called for. --- kernel/sched/fair.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index fdae26eb7218..1e47f816c976 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5175,6 +5175,21 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev) return p; simple: cfs_rq = &rq->cfs; + + if (cfs_bandwidth_used()) { + /* + * We may dequeue prev's cfs_rq in put_prev_task(). + * So, we update time before cfs_rq->nr_running check. + */ + if (prev->on_rq) + update_curr(cfs_rq); + + se = &prev->se; + for_each_sched_entity(se) { + cfs_rq = cfs_rq_of(se); + check_cfs_rq_runtime(cfs_rq); + } + } #endif if (!cfs_rq->nr_running) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/