Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp6665033ybh; Thu, 8 Aug 2019 03:47:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6p1+h55XafzWb6/Y2MQwCvEa2zAERT6HbHnH0ikojg6CWSG+URtNRPXJNtG8deCto+9WH X-Received: by 2002:a62:770e:: with SMTP id s14mr14311806pfc.150.1565261256998; Thu, 08 Aug 2019 03:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565261256; cv=none; d=google.com; s=arc-20160816; b=059S6PzfQZ1tPQLupfvYyqGx8NfArOL5wgOyD2oaADG5LvnhQg9cUON9TKLzKdP0rd 5m1k9QzYXeZ0kqtCkc6ywxuvLdp6hndLUk2k4cYzQaIl/dc22LgGqi9iP1vyswRgzEND OFIypObaBxGtBgCab4CuDjmjeNRJYyrbb9cAXDmkFGn44oiTJiVhnUl+yZm4uBykDSrq ZyXwJU/omEwaDV67BLD5jNl4NFf8Jdn/9R8FwVIQE4jMosezTNc7foApzPhmKICGOUTR uCeidvLyqVTEdKEvraBZOi6B4R6Y9SpruqzSw6+my+iDQ/fye2QBIB8XZTZaR8PfwUKU wjAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=83ChikpVbYNDacyL0RO4zrhemQrVOalWNelpvhD/kWI=; b=AeDfxJPXvJhJNT66jdxHnUwzdxrh8xiydCqWK8R5zC3gYoqJGn6Wa3CzOIWtMq1nQT E1UDYq4TV+FDIKXhmp61MNyAG5ByF5qy3TClXJ24Jd7e/yIQkHs+FbyIEWXxYyu57wEA 3RAYl/IaJSp0I8gfw+x7rOiqFmuKb5abHOcwO4UYMhHVvKr48NVwgcAJXsqLUHxU794j +KaXncvagw0NNLaOCHjpN6wdSV2DSiaonyWvU/nddEA4FWIt3ab2ouIq9TPgQObuvzdl gBeDnSMs8khNuFS9yxL9Q5+jvIzo50E8F0yVjzfvpMj1wUvkgfTzrDx2k/t+bG1pjUIR xnhw== 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 o21si47117100pll.169.2019.08.08.03.47.21; Thu, 08 Aug 2019 03:47:36 -0700 (PDT) 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 S1732310AbfHHKqj (ORCPT + 99 others); Thu, 8 Aug 2019 06:46:39 -0400 Received: from foss.arm.com ([217.140.110.172]:60008 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731755AbfHHKqj (ORCPT ); Thu, 8 Aug 2019 06:46:39 -0400 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 E81C728; Thu, 8 Aug 2019 03:46:38 -0700 (PDT) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 407633F694; Thu, 8 Aug 2019 03:46:38 -0700 (PDT) Subject: Re: [PATCH 2/3] sched/fair: Prevent active LB from preempting higher sched classes To: Qais Yousef Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org References: <20190807174026.31242-1-valentin.schneider@arm.com> <20190807174026.31242-3-valentin.schneider@arm.com> <20190808092455.qavanylzts2vmktk@e107158-lin.cambridge.arm.com> From: Valentin Schneider Message-ID: <4d7cd9de-9f90-0e47-5c77-e888fb7eb3ef@arm.com> Date: Thu, 8 Aug 2019 11:46:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190808092455.qavanylzts2vmktk@e107158-lin.cambridge.arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/08/2019 10:24, Qais Yousef wrote: >> @@ -8834,6 +8834,10 @@ static inline enum alb_status active_load_balance(struct lb_env *env) >> >> raw_spin_lock_irqsave(&busiest->lock, flags); >> >> + /* Make sure we're not about to stop a task from a higher sched class */ >> + if (busiest->curr->sched_class != &fair_sched_class) >> + goto unlock; >> + > > This looks correct to me, but I wonder if this check is something that belongs > to the CONFIG_PREEMPT_RT land. This will give a preference to not disrupt the > RT/DL tasks which is certainly the desired behavior there, but maybe in none > PREEMPT_RT world balancing CFS tasks is more important? Hmmm > My take on this is that if the running task isn't CFS, there is no point in running the cpu_stopper there (PREEMPT_RT or not). We can still try other things though. It could be that the running task had been > CFS all along, so if we failed to move any load then we just couldn't pull any CFS task and should bail out of load balance at this point. If the running task was CFS but got preempted by a > CFS task in the meantime (e.g. after detach_tasks() failed to pull anything), the best we could do is run detach_one_task() (locally - no need for any cpu_stopper) to try and nab the now not-running CFS task. Otherwise we'll have to wait for another round of load_balance(). Not sure how much we care about this case - I think it's extremely unlikely to repeatedly want to pull a currently-running CFS task and have it repeatedly preempted by a > CFS task whenever we get to active_load_balance(). Let me try and see if I can come up with something sensible with that detach_one_task() thingy. > -- > Qais Yousef > >> /* >> * Don't kick the active_load_balance_cpu_stop, if the curr task on >> * busiest CPU can't be moved to dst_cpu: >> -- >> 2.22.0 >>