From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD5FEC433ED for ; Tue, 18 May 2021 10:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD0236108D for ; Tue, 18 May 2021 10:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348512AbhERKaD (ORCPT ); Tue, 18 May 2021 06:30:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:34418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348403AbhERK35 (ORCPT ); Tue, 18 May 2021 06:29:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5923E61002; Tue, 18 May 2021 10:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621333720; bh=jROP8po3PHoJPLBp5hT2Ed99bWiPnCq4HCpYcHosU5A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dY9PsWH41vfE039KOYtoNvZdPHH6YPaLsRb7+M8zabd1d0vgUxqVszgt/TZprtwM0 T3RRwSL1dYA5bhMMrLFQ2YYY7iNnEZ8IJsk98eXclkbQwzwKP+1IIoWjyvD8k5Yjt7 CSIgIxFWLZmRASIu5GxPgto9EUFcKDlRy93QWDNvrgagncMik/d2rNw8t5/5adn0r9 jBnFnpnzhZzvwwqgepTmaP+5Aujk8j/ESQ4sr5ByqdjayE/Nd6rGh0SGqYwwDYl3NV FPSuZOKypWOTKxXqAYNfVsyqo1/hQIiEUaIvYbSCmyDOZrcAWRdKL9bPngvDpjdSq3 LYc5HfQkozGmg== Date: Tue, 18 May 2021 11:28:34 +0100 From: Will Deacon To: Quentin Perret Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , Marc Zyngier , Greg Kroah-Hartman , Peter Zijlstra , Morten Rasmussen , Qais Yousef , Suren Baghdasaryan , Tejun Heo , Johannes Weiner , Ingo Molnar , Juri Lelli , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com Subject: Re: [PATCH v6 13/21] sched: Admit forcefully-affined tasks into SCHED_DEADLINE Message-ID: <20210518102833.GA7770@willie-the-truck> References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-14-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Dropping Li Zefan as his mail is bouncing] On Tue, May 18, 2021 at 10:20:38AM +0000, Quentin Perret wrote: > On Tuesday 18 May 2021 at 10:47:17 (+0100), Will Deacon wrote: > > On asymmetric systems where the affinity of a task is restricted to > > contain only the CPUs capable of running it, admission to the deadline > > scheduler is likely to fail because the span of the sched domain > > contains incompatible CPUs. Although this is arguably the right thing to > > do, it is inconsistent with the case where the affinity of a task is > > restricted after already having been admitted to the deadline scheduler. > > > > For example, on an arm64 system where not all CPUs support 32-bit > > applications, a 64-bit deadline task can exec() a 32-bit image and have > > its affinity forcefully restricted. > > So I guess the alternative would be to fail exec-ing into 32bit from a > 64bit DL task, and then drop this patch? > > The nice thing about your approach is that existing applications won't > really notice a difference (execve would still 'work'), but on the cons > side it breaks admission control, which is sad. Right, with your suggestion here we would forbid any 32-bit deadline tasks on an asymmetric system, even if you'd gone to the extraordinary effort to cater for that (e.g. by having a separate root domain). > I don't expect this weird execve-to-32bit pattern from DL to be that > common in practice (at the very least not in Android), so maybe we could > start with the stricter version (fail the execve), and wait to see if > folks complain? Making things stricter later will be harder. > > Thoughts? I don't have strong opinions on this, but I _do_ want the admission via sched_setattr() to be consistent with execve(). What you're suggesting ticks that box, but how many applications are prepared to handle a failed execve()? I suspect it will be fatal. Probably also worth pointing out that the approach here will at least warn in the execve() case when the affinity is overridden for a deadline task. Will