Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4717095ybv; Mon, 17 Feb 2020 04:36:43 -0800 (PST) X-Google-Smtp-Source: APXvYqw1xxA9y0PcJATfrYsGhYFePXXdhJLC19gOnxEqRKkoe4vMNwAaWPP2gGJ7PCphKKBBFueR X-Received: by 2002:a05:6808:98e:: with SMTP id a14mr9350802oic.8.1581943003345; Mon, 17 Feb 2020 04:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581943003; cv=none; d=google.com; s=arc-20160816; b=fyhzE8Vm0SjLozdOKizvcSIfy2QpfyUqj4iZyXzAC8iqswI1l4Lbt+A4AOT+0SA8tv ybLHCKwZEg+47MD/nOZKCj98MxQAaBwoZqhCCMFifw+PUZzkOi7Tp5aFD6rVywdI5K7M TbfapSS8YDiUFjnDM+EpQbJ/fKQJTCo8vqAI0tOIQRHjExGjQRWhXg9UKPS77MKD/yk6 00F4me942xOAfhab2KdEOvfnyGQ/CF6KeFnbbeWKMqFaArVz0RHApymhJaal1AA1fpX3 CoiuCNHw+OmCGKN/c2WfUGCeZUkkNpYMSWiQ8oq3vBrazFb8l5MMDsBHYmaHJ/suOMEV DakA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=S1S+CfaBIahpnnDkoyOUc6StqKwfR4mRdaX0XHsLctw=; b=kFd23rRvtCzDKH3CYgcr2lpHn4u9pbFLpKhQ916xdqiFxxNrQcxwMpGwyTmbwAWa4s bS+hr917yJXVaEF4vVpefj060B4hfL6QvvfmYcuCfiJm7M0dltQ0pnb6ZrW+MutBsm0W eoRUeFaM2N5h/lEZEMN7Hr36SW0El0f+AxEbFyrdiCviybtIObbtWoWguYIItm2UJhno OEartmEDoGpzq0giATZe22h4hp6kkNFxJ/u2msY3EqdT4SiwfFWsNSRtWMeQHhVyzV/p +cg0yEFAUvfav6lRSwK63oHnbx3MqHUtICvPobf67OSY2i3QBtad72+ZrV7oLIPNlUqW VCPw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a143si6340746oii.179.2020.02.17.04.36.31; Mon, 17 Feb 2020 04:36:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728611AbgBQLUk (ORCPT + 99 others); Mon, 17 Feb 2020 06:20:40 -0500 Received: from foss.arm.com ([217.140.110.172]:34300 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727983AbgBQLUk (ORCPT ); Mon, 17 Feb 2020 06:20:40 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DEF2830E; Mon, 17 Feb 2020 03:20:39 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F03D3F6CF; Mon, 17 Feb 2020 03:20:38 -0800 (PST) Date: Mon, 17 Feb 2020 11:20:36 +0000 From: Qais Yousef To: Pavan Kondeti Cc: Ingo Molnar , Peter Zijlstra , Steven Rostedt , Dietmar Eggemann , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] sched/rt: allow pulling unfitting task Message-ID: <20200217112034.54yoockxvfe3fw6y@e107158-lin.cambridge.arm.com> References: <20200214163949.27850-1-qais.yousef@arm.com> <20200214163949.27850-3-qais.yousef@arm.com> <20200217091042.GB28029@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200217091042.GB28029@codeaurora.org> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/17/20 14:40, Pavan Kondeti wrote: > Hi Qais, > > On Fri, Feb 14, 2020 at 04:39:48PM +0000, Qais Yousef wrote: > > When implemented RT Capacity Awareness; the logic was done such that if > > a task was running on a fitting CPU, then it was sticky and we would try > > our best to keep it there. > > > > But as Steve suggested, to adhere to the strict priority rules of RT > > class; allow pulling an RT task to unfitting CPU to ensure it gets a > > chance to run ASAP. When doing so, mark the queue as overloaded to give > > the system a chance to push the task to a better fitting CPU when a > > chance arises. > > > > Suggested-by: Steven Rostedt > > Signed-off-by: Qais Yousef > > --- > > kernel/sched/rt.c | 16 +++++++++++++--- > > 1 file changed, 13 insertions(+), 3 deletions(-) > > > > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > > index 4043abe45459..0c8bac134d3a 100644 > > --- a/kernel/sched/rt.c > > +++ b/kernel/sched/rt.c > > @@ -1646,10 +1646,20 @@ static void put_prev_task_rt(struct rq *rq, struct task_struct *p) > > > > static int pick_rt_task(struct rq *rq, struct task_struct *p, int cpu) > > { > > - if (!task_running(rq, p) && > > - cpumask_test_cpu(cpu, p->cpus_ptr) && > > - rt_task_fits_capacity(p, cpu)) > > + if (!task_running(rq, p) && cpumask_test_cpu(cpu, p->cpus_ptr)) { > > + > > + /* > > + * If the CPU doesn't fit the task, allow pulling but mark the > > + * rq as overloaded so that we can push it again to a more > > + * suitable CPU ASAP. > > + */ > > + if (!rt_task_fits_capacity(p, cpu)) { > > + rt_set_overload(rq); > > + rq->rt.overloaded = 1; > > + } > > + > > Here rq is source rq from which the task is being pulled. I can't understand > how marking overload condition on source_rq help. Because overload condition > gets cleared in the task dequeue path. i.e dec_rt_tasks->dec_rt_migration-> > update_rt_migration(). Err yes indeed I rushed this patch. Let me try again. Thanks -- Qais Yousef