From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751743AbdBWR3T (ORCPT ); Thu, 23 Feb 2017 12:29:19 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:42942 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751107AbdBWR3R (ORCPT ); Thu, 23 Feb 2017 12:29:17 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B20E46085F Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pkondeti@codeaurora.org MIME-Version: 1.0 In-Reply-To: <20170223163737.GW6536@twins.programming.kicks-ass.net> References: <20170119101703.2abeaeb6@gandalf.local.home> <20170119174408.GN6485@twins.programming.kicks-ass.net> <20170223135458.GC6515@twins.programming.kicks-ass.net> <20170223152533.GG6515@twins.programming.kicks-ass.net> <20170223163737.GW6536@twins.programming.kicks-ass.net> From: Pavan Kondeti Date: Thu, 23 Feb 2017 22:59:15 +0530 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] sched: Optimize pick_next_task for idle_sched_class too To: Peter Zijlstra Cc: Pavan Kondeti , Steven Rostedt , LKML , Ingo Molnar , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 23, 2017 at 10:07 PM, Peter Zijlstra wrote: > On Thu, Feb 23, 2017 at 04:25:33PM +0100, Peter Zijlstra wrote: >> >> Ah, I read your question wrong. Yes I think you're right, we now loose >> the pull when the last RT task goes away. >> >> Hmm.. how to fix that nicely.. > > Something like so perhaps? This would make a pull happen when the last > RT task on this CPU goes away. > > Steve? > > --- > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > index 9f3e40226dec..283d591078b0 100644 > --- a/kernel/sched/rt.c > +++ b/kernel/sched/rt.c > @@ -1336,6 +1336,9 @@ static void dequeue_task_rt(struct rq *rq, struct task_struct *p, int flags) > dequeue_rt_entity(rt_se, flags); > > dequeue_pushable_task(rq, p); > + > + if (!rq->rt.rt_nr_running) > + queue_pull_task(rq); > } > > /* The next balance_callback() is not called until the context switch is completed. So we potentially pick a lower class task before the pull happens. Would it be wrong to call pull_rt_task() directly instead of queuing the callback. -- Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project