Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1658986pxj; Wed, 19 May 2021 10:49:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvP//bICT2QiRANQC+8Suhzgy2gZQ7j1UmzYD3bPCwjoPZOOSHoA5caNWC2OH0XnTRoTQJ X-Received: by 2002:a05:6402:cb8:: with SMTP id cn24mr206222edb.325.1621446597329; Wed, 19 May 2021 10:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621446597; cv=none; d=google.com; s=arc-20160816; b=J0HCHkFlE6zQ1njQlsJMGTpTGB+1Lmr81/hRYujnojgvFfRkK/5isAY3SuGHWZxvMW 6GvVPu56ynHhOxAdAec/bwHdyCT1lFlFhZ93T2/4ihMGJ/59guQQTYTzH68O7yTHhChl o9Zc2RjsplMWgH2r65jp9SCCM6EhKyIDiIgCy75EBp2WjsiV9VqNZ6pN0wqgu/yg5+Xc vAizUwks1cYnoIi0fzukdJa2HZBBjvcubknj7t1SVD9mTelJ8WHeftrCK9baJdHWjD62 O/3GXZ1FGq1IxDDXTzQUpM2BL+nAE85V2DQG5OBJ+lKnGblHQeccDVd+x/UMnHI/VxGr jTPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VG01HVh6pVg1V5QDLefzdlAvJuHeD6bXsPSByZHf/E0=; b=boqFF+Hxg6t7FWc7dzcvHzvXm79NRasV3GC1JmZ3NSFxaICCYnxK90PryxnE0dtPdT WfVyXdid4jn604RbmzfZQb7S54s3CP4vn1Ui0QnbIvURmeVJGildDfGxqmRfNTZejU19 GaZDHVTyxSlB4x3TkiBeiAEfCguoxQcZen2LFFe6XtnVkjkyoLOGl3etrWRFzT1Zmb2B q8ARlxMjia3tTvcg6xIB1Y4/f67l3S/4DcJ9THj238b7o2SuvfUWVFINyrTRYlAL1LSw ayStTm08bth3gQCT9iGvgu9Wr/TZlXuB9voubdLLXKCFc821e8iKcSjopSfLWoNU7LVH LF/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dY9PsWH4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si22704765edb.244.2021.05.19.10.49.32; Wed, 19 May 2021 10:49:57 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dY9PsWH4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348507AbhERKaB (ORCPT + 99 others); Tue, 18 May 2021 06:30:01 -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