Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8115249ybn; Tue, 1 Oct 2019 03:30:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSvQDn73bBPZUVGUX4xsnq0jbas92/nXbx6dvSUeQgD/3qzSbYCytDxOeKzLhojBhiJMrx X-Received: by 2002:a17:906:3286:: with SMTP id 6mr23157229ejw.37.1569925854244; Tue, 01 Oct 2019 03:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569925854; cv=none; d=google.com; s=arc-20160816; b=T42dM1+9DQCd99XU3PMoHwnRIH0xVYSEw+GM/FCbRxNgdvNr+3wO33sHZ09Mjze53m 5qzhgMW9/dmNXHum4eOdK//GYb411rkv+ujQsPsGyR0qOjDSmC1dhY4Zp28OfSPASCff +qnshMt04fXoJJbOrErUCHITSmM6hS3lMHocYkS3yy/mTJhU5+VTqZWpMAHHDGXfM01h w8AIrh4e3lLi6FGUXUkW+OopDhe5UwB+x3vYts4kuuv/4MHGS5zjVgfhY7PWrtfwjX8e +Oshqv2WBPZ9w+GlVLAKrc+JQtNpcYObXa4l/ewrQSBcC3/kx0nNGfGMWUB8v2pFXXoC 53Yg== 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:references:cc:to:from:subject; bh=2RoPJ7nqWtShdDteOSZ6uPWRsAplcJtButXxeNy3cVk=; b=ha6jNBdcbkBXqFEZNCcHuFFVomhUeaeGle98J33ZN74nd3qfMtn/XH/7plCySZcaiK RF5GjnQ80GS3wpJwqIMWNFo705EBVHCM1kPNUCQRqnMPjWDev3vtVOzAH5ROpUnTRIlS XwVtxF2yevBIxkJARvO1jK956nJzG+G3BOt+rqwsJMiWVDsLLEuosQ4rf0MUq0YqdO/L dkGkuiukugtZRAur8/q7svugPTTlgPZ0CcsBzhdJz7AEId5j8FsOwVeO53Mszt7Q9zFx FEZyCg/NB3TrtmlQVOQmQsXmvo0zQ297iMfO+Iz6lBwrj7ZKpI8zMf4RzNIxOlc7Ug5l 4beg== 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 be24si8562810edb.120.2019.10.01.03.30.29; Tue, 01 Oct 2019 03:30:54 -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 S1730808AbfJAK3r (ORCPT + 99 others); Tue, 1 Oct 2019 06:29:47 -0400 Received: from foss.arm.com ([217.140.110.172]:46192 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730006AbfJAK3p (ORCPT ); Tue, 1 Oct 2019 06:29:45 -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 649FA1000; Tue, 1 Oct 2019 03:29:45 -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 5D7F33F739; Tue, 1 Oct 2019 03:29:44 -0700 (PDT) Subject: Re: [PATCH v2 0/4] sched/fair: Active balancer RT/DL preemption fix From: Valentin Schneider To: linux-kernel@vger.kernel.org Cc: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, tglx@linutronix.de, qais.yousef@arm.com, Juri Lelli , Steven Rostedt References: <20190815145107.5318-1-valentin.schneider@arm.com> Message-ID: Date: Tue, 1 Oct 2019 11:29:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190815145107.5318-1-valentin.schneider@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 (expanded the Cc list) RT/DL folks, any thought on the thing? On 15/08/2019 15:51, Valentin Schneider wrote: > Vincent's load balance rework [1] got me thinking about how and where we > use rq.nr_running vs rq.cfs.h_nr_running checks, and this lead me to > stare intently at the active load balancer. > > I haven't seen it happen (yet), but from reading the code it really looks > like we can have some scenarios where the cpu_stopper ends up preempting > a > CFS class task, since we never actually look at what's the remote rq's > running task. > > This series shuffles things around the CFS active load balancer to prevent > this from happening. > > - Patch 1 is a freebie cleanup > - Patch 2 is a preparatory code move > - Patch 3 adds h_nr_running checks > - Patch 4 adds a sched class check + detach_one_task() to the active balance > > This is based on top of today's tip/sched/core: > a46d14eca7b7 ("sched/fair: Use rq_lock/unlock in online_fair_sched_group") > > v1 -> v2: > - (new patch) Added need_active_balance() cleanup > > - Tweaked active balance code move to respect existing > sd->nr_balance_failed modifications > - Added explicit checks of active_load_balance()'s return value > > - Added an h_nr_running < 1 check before kicking the cpu_stopper > > - Added a detach_one_task() call in active_load_balance() when the remote > rq's running task is > CFS > > [1]: https://lore.kernel.org/lkml/1564670424-26023-1-git-send-email-vincent.guittot@linaro.org/ > > Valentin Schneider (4): > sched/fair: Make need_active_balance() return bools > sched/fair: Move active balance logic to its own function > sched/fair: Check for CFS tasks before detach_one_task() > sched/fair: Prevent active LB from preempting higher sched classes > > kernel/sched/fair.c | 151 ++++++++++++++++++++++++++++---------------- > 1 file changed, 95 insertions(+), 56 deletions(-) > > -- > 2.22.0 >