Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754695AbbDGNsL (ORCPT ); Tue, 7 Apr 2015 09:48:11 -0400 Received: from casper.infradead.org ([85.118.1.10]:39602 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754123AbbDGNsH (ORCPT ); Tue, 7 Apr 2015 09:48:07 -0400 Date: Tue, 7 Apr 2015 15:47:58 +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: <20150407134758.GR24151@twins.programming.kicks-ass.net> References: <20150403124138.1349.11633.stgit@buzz> <551E8CC5.30906@yandex-team.ru> <20150407125251.GM23123@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150407125251.GM23123@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: 1122 Lines: 36 On Tue, Apr 07, 2015 at 02:52:51PM +0200, Peter Zijlstra wrote: > If the above set_next_entity() is indeed the simple one, does the below > cure things? > > --- > kernel/sched/fair.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index fdae26eb7218..df72d61138a8 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -5176,12 +5176,11 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev) > simple: > cfs_rq = &rq->cfs; > #endif > + put_prev_task(rq, prev); > > if (!cfs_rq->nr_running) > goto idle; > > - put_prev_task(rq, prev); > - > do { > se = pick_next_entity(cfs_rq, NULL); > set_next_entity(cfs_rq, se); Bah, that's broken because if we end up going idle pick_next_task_idle() is going to do put_prev_task() again. Lemme think a bit more on that. -- 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/