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 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=-5.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 844BEC433B4 for ; Tue, 18 May 2021 10:31:37 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 199B260720 for ; Tue, 18 May 2021 10:31:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 199B260720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=gjoFHxooWhJmPr4vFJY/B3sPaB3yANEk4Mi2SKwRXeE=; b=akTrtAFCTWk2XgqvQ394DI4Yj BrzCzzOUEZ9luPdty6OPPLpeZ5P34QLpJPf0owBT9uHoU2UqfM0auOPeDZh4G88Jbnn8kFgA5Zi84 HZJlmN3PsZAAXQD7gJTsB0tKEa/WUuv6Vi+Go/EmhjwH0t0suXxLRp0562mznGDvQXRustgNIqrZa KjJGYSBhKTi3NQLpD09tWBBNLXVcglgXtQnhOh6IBsheVmKaPq/JIukEU8BxGXTWYr6SLOpAAWRJK FYyOzhCqeO4SzEaP0djlSipYAj29wpK/nuJWdfEGHaR3X6c7cKRvPccmhtpc9iXswSNYLTknfPEb+ pTh9M2uog==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1liwz1-000NyH-09; Tue, 18 May 2021 10:29:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liwxv-000Nh0-Ch for linux-arm-kernel@desiato.infradead.org; Tue, 18 May 2021 10:28:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VG01HVh6pVg1V5QDLefzdlAvJuHeD6bXsPSByZHf/E0=; b=Z6F80VrBOFqObw84R6L1kMfj5d iEC+tsFtUretPC9dgDVeWLqbubJlzILtu1ZGGbifbCwpSchIVECxEiebFz6tPQvNpIksVJOvG5RhF Op3k8U5Ca+kcy1gWQ0pgUc3FG2ofbe4V51zm04Mn+WXCk/RuSar1woAQTrHYBg1ABQNSdqo+Wej6q 4qqSpygCepItQsjAuJjOfyD0a89HU/pyTI5PolPlc7gwcCVkkN19JsUmcyV1eVmHxEmfzm11+RX47 8VvJ67S9AkFADg7TPKMLuU2BHY5/k7ndgANJJ+HuBcCNxZrwGGWmelA0zPHK8t/xa3KkDCkpCfH9B gEHVZLOA==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1liwxs-00EZ4V-O5 for linux-arm-kernel@lists.infradead.org; Tue, 18 May 2021 10:28:42 +0000 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210518_032840_825073_AAF477CC X-CRM114-Status: GOOD ( 19.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel