Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp414721pxu; Tue, 6 Oct 2020 09:21:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWMNu+ydyKcFuJkZ8eJOX9dL6QDWWSEP5OiUEWPClHMuz2TzRGSNtsUrAxOMTw8hF1YBmr X-Received: by 2002:a05:6402:1356:: with SMTP id y22mr6169709edw.110.1602001275996; Tue, 06 Oct 2020 09:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602001275; cv=none; d=google.com; s=arc-20160816; b=yc4QERYjRZyvD6SyL4tc9PeS0Uy3GW4Z48EO7JmbQveVZ5BTMec/JtZ8E9T1mAr+1j n5vhr5STt9rHJ7ZqLBuTZRzlWDAxMjT1nKJrPXawtUvB11ySti2QRtoSyvmIGTyeCdsz 8/k3LU941INASyKxiUfSRpxSRM0XQAUjTrbyOSwBLdIrbF6x5GiyIUjD0aDhYeD7KJx0 M82kwpBUrnMqDYrC/ckGl2YpiUf47XCIvOSsDi8o0Li3fN/cUsHfVdFPnr9L3Gz7+ojv AB5feCEPOMmcYFDGR1abmHUG+XO++4nNI9ZKWaFuycQehNQhiZu/fIzTfvyZ+YouVVNN rJIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:user-agent:references; bh=01SqVTzlST/23PQtPjnrcF2oqSXpImnLxYSKwIU3JeI=; b=lY7o+v0aGFLZr96bc1Fou+lslLSIrURjXuPHVSrYJMY06Dg8TeC/TjudS3qUE9XQmk HN0F8NC4l8sFv+rJAcvRPP4DyPAOeME8sMaCs22/iWowRke7vKqLKtG9acISO+d+7ZRR mx6uTp9x5i0ygj4t5S1XsfedKAeOyytnGkO04EzVrPp6GnGa0NLxhV6rry1MDxlKMl0y VGjOiy0en8ppNMrJnIa9s9MYQzrEeFjDQTfpCTayNJP+3rU1/L1snHancjQR2Jz+GGqV zyzCYwkEKnOWJKliKRCC4OPqveoJ05ohqZFD7VBAYo59ph7tKWAX4VFjXFDLNp3awfND 4nDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn22si3179926edb.516.2020.10.06.09.20.53; Tue, 06 Oct 2020 09:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726128AbgJFQTs (ORCPT + 99 others); Tue, 6 Oct 2020 12:19:48 -0400 Received: from foss.arm.com ([217.140.110.172]:51516 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725902AbgJFQTs (ORCPT ); Tue, 6 Oct 2020 12:19:48 -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 6BF6611B3; Tue, 6 Oct 2020 09:19:47 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6C6A33F66B; Tue, 6 Oct 2020 09:19:45 -0700 (PDT) References: <20201005145717.346020688@infradead.org> <20201005150922.458081448@infradead.org> <20201006134850.GV2628@hirez.programming.kicks-ass.net> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: Peter Zijlstra Cc: tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, bigeasy@linutronix.de, qais.yousef@arm.com, swood@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vincent.donnefort@arm.com, tj@kernel.org Subject: Re: [PATCH -v2 15/17] sched: Fix migrate_disable() vs rt/dl balancing In-reply-to: <20201006134850.GV2628@hirez.programming.kicks-ass.net> Date: Tue, 06 Oct 2020 17:19:43 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/10/20 14:48, Peter Zijlstra wrote: > On Tue, Oct 06, 2020 at 12:20:43PM +0100, Valentin Schneider wrote: >> >> An alternative I could see would be to prevent those piles from forming >> altogether, say by issuing a similar push_cpu_stop() on migrate_disable() >> if the next pushable task is already migrate_disable(); but that's a >> proactive approach whereas yours is reactive, so I'm pretty sure that's >> bound to perform worse. > > I think it is always possible to form pileups. Just start enough tasks > such that newer, higher priority, tasks have to preempt existing tasks. > > Also, we might not be able to place the task elsewhere, suppose we have > all our M CPUs filled with an RT task, then when the lowest priority > task has migrate_disable(), wake the highest priority task. > > Per the SMP invariant, this new highest priority task must preempt the > lowest priority task currently running, otherwise we would not be > running the M highest prio tasks. > Right, and it goes the other way around for the migrate_disable() task: if it becomes one of the M highest prio tasks, then it *must* run, and push/pulling its CPU's current away is the only way to do so... > That's not to say it might not still be beneficial from trying to avoid > them, but we must assume a pilup will occur, therefore my focus was on > dealing with them as best we can first. "Funny" all that... Thanks!