Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4621665ybf; Wed, 4 Mar 2020 07:29:30 -0800 (PST) X-Google-Smtp-Source: ADFU+vt5urszomgJoF57avc/gY36SRjZq0DQpsi/dqJkDzfkhSCCyVJXYI+idJZm9HXUxhTXN8wA X-Received: by 2002:a05:6830:19:: with SMTP id c25mr2650999otp.349.1583335770302; Wed, 04 Mar 2020 07:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583335770; cv=none; d=google.com; s=arc-20160816; b=FMbH7Dhe3bYNdbj4QI/UQ9RK7CeK+D/RToenyZoWSQ/uM8m5TwyqcMwr8BmrgHugzn +nB5nAnEkUMVfaJlknY65OWIzoPf+GTkWdcgvImbytt6+Tzp1rOEbFi2Fg7klOjpAq8y oL+Pt5i910uTkjcsrYCQ/KQXjLwaEU0NuJUk+X9vXdxt4FIg/qpjJ8Xy5n4gfbveiR8B oqlgxNck0bcGxiFCKtt5+ZdBsJWp75KcF6bexp6o8Lm9EG3QJ+rJfR85I2sgZ0aHnsif pjHSEe35MtJWP8aYx8oiN9zCbC5vcCp4mebptGigIYF5LzSU4O/5LSTnr+qxLEmoP7zA UMLA== 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=rOy9H9SPpcOTF91yCEV0KfPVH8C1TWip0B5beDt4SWg=; b=sHYHRj6QvoEbJ2Qe0HaevRHb4aVYRHLcMlySxOdMZthI3fxqy2G+Nmr8Y885SKFH0/ qerDYW3LuIvgw/cnGwgsKMRhvngt0oDIwVnGFPe3sma3nRXR+XVlNvp7nryL0EpYCYsR Zd9BwU4HyiVFdMax5zadg7LMCfxdKZZpeb9PD7ag7dVzVturCvEX78WzbyydTipkTNl5 QqSxt2Yp5d1b82eJB5fthbjrPPBnu6Sqv0XsaL/wwAJjAUFLI/MKM81N4gZeq+JW12+U q+sJE01JONDLnszdWJvPtom1E3Hi53pdh3/Qv8YqG677wcOtckY450UZHHoIrv/xGV57 LqwA== 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 c9si1291955oto.149.2020.03.04.07.29.18; Wed, 04 Mar 2020 07:29:30 -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 S1729707AbgCDP20 (ORCPT + 99 others); Wed, 4 Mar 2020 10:28:26 -0500 Received: from foss.arm.com ([217.140.110.172]:35764 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbgCDP2Z (ORCPT ); Wed, 4 Mar 2020 10:28:25 -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 CDD714B2; Wed, 4 Mar 2020 07:28:24 -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 1B3563F6CF; Wed, 4 Mar 2020 07:28:22 -0800 (PST) Date: Wed, 4 Mar 2020 15:28:20 +0000 From: Qais Yousef To: Tao Zhou Cc: Ingo Molnar , Peter Zijlstra , Steven Rostedt , Dietmar Eggemann , Pavan Kondeti , Juri Lelli , Vincent Guittot , Ben Segall , Mel Gorman , linux-kernel@vger.kernel.org, t1zhou@163.com Subject: Re: [PATCH v3 4/6] sched/rt: Allow pulling unfitting task Message-ID: <20200304152820.t6kkxvpgoa6444ta@e107158-lin.cambridge.arm.com> References: <20200302132721.8353-1-qais.yousef@arm.com> <20200302132721.8353-5-qais.yousef@arm.com> <20200304145219.GA14173@geo.homenetwork> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200304145219.GA14173@geo.homenetwork> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/04/20 22:52, Tao Zhou wrote: > Hi Qais, > > On Mon, Mar 02, 2020 at 01:27:19PM +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. > > > > Suggested-by: Steven Rostedt > > Fixes: 804d402fb6f6 ("sched/rt: Make RT capacity-aware") > > LINK: https://lore.kernel.org/lkml/20200203111451.0d1da58f@oasis.local.home/ > > Signed-off-by: Qais Yousef > > --- > > kernel/sched/rt.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c > > index 3071c8612c03..e79a23ad4a93 100644 > > --- a/kernel/sched/rt.c > > +++ b/kernel/sched/rt.c > > @@ -1656,8 +1656,7 @@ 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)) > > + cpumask_test_cpu(cpu, p->cpus_ptr)) > > return 1; > > > > return 0; > > -- > > 2.17.1 > > > > How about using a rt_cap_overloaded(like rt_overloaded) to indicate the > cpu is overloaded because a RT task is on unfit CPU. And use stop_one_cpu > to do in this case. We have explored a variation of this (without using the stop_one_cpu) in v2 https://lore.kernel.org/lkml/20200223184001.14248-6-qais.yousef@arm.com/ I might still consider this in the future. But I think I need to do better analysis of the cost-benefit here before pushing further for that. I'm not keen on stopping a running task as well, not yet at least. > > IIRC, HAVE_RT_PUSH_IPI do not select the specific cpu to do the > push because the complex there. When RT cap join in, i don't know it > is need to select the specific unfit CPU or rt overloaded CPU in what > order is a choice. I'm not sure I understood you completely here. I think the patch above dealt with the complexity I think you're talking about. Thanks -- Qais Yousef