Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1661767pxj; Wed, 19 May 2021 10:54:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz120nA6FlZ4nWlXU4SlqmnZFXExTJcdknyYxlj71d67x9mGVqdSxn0Gn/UfHVEyA5PfHjL X-Received: by 2002:a05:6e02:4af:: with SMTP id e15mr165572ils.131.1621446844307; Wed, 19 May 2021 10:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621446844; cv=none; d=google.com; s=arc-20160816; b=BQtKR2q3MZWjKYtp3ql8xGcgw4vqbOIu+bd7GFh9PXBEDE71mjY6eJgr5qMAC1ZeF2 IrMRK0JwhqPOEFrZ7YZwUugHN/sogsohzMdkmKGYDYtkImLqKum7Q6kgksUYPJWSTTBQ dDlOQLz8b6RvaFUklJGrVtMP5jytw4t7vc6EMdKdDke+yCGTsZtNiP22qRvwzp0L9bgj 4eZNntJGrTV6q4kJCmEDo8L/9+f06gmO36rvIFOSvIA71TRGGNWZX/nEUbtEv2/nzwNs A24Q2sQEebgbsNEiz6SIIXi9LTiCiS4JSVjczdTTYtPzosoGwmqeKrA7BJyvdnWXVGm7 DzFQ== 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=8lLpjLSTsHI4OkoHgEh0NL0Y7jaNgduFir7Zd97cQ9s=; b=lw6G0USx9f1+crAj1vrxj9k1bkGYvhC51VNKPWbLCx3msymkmZPSpsldGLK2/Aj2Mc bSmduoVPBdy+7FGWXFYpkAAqnh/ntXnhmtjvoqjIZt/dPRfee2tu8ijVWfglCxLoD4td OCT6FjlitOM0PA9ce3bW4wD0w+wttaQQA12Atg3h4nK1GLPwzFBMgrY+fopCc8pVcs8C AHK14j+bswtgqSjiAWdSCiIhqh8rCfF2TYDmKUfCr6Py/AAzKGSFqVtJh0yyCpW/e7vm gS/0k8OEmT8YrzD50aFZl/BoxYOcLhFVki99iRIgdpVcI1HIB+AM6z39I7IEkNRNhVTR QJ3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nTvC5ILg; 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 17si281717ilj.19.2021.05.19.10.53.51; Wed, 19 May 2021 10:54:04 -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=nTvC5ILg; 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 S1348695AbhERLBQ (ORCPT + 99 others); Tue, 18 May 2021 07:01:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:42350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348192AbhERLBP (ORCPT ); Tue, 18 May 2021 07:01:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 345F661285; Tue, 18 May 2021 10:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621335598; bh=GAu4rojTdKt4OvWm/lfPAfaF+P0Bv2/Zuy8m9Dpr8Hc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nTvC5ILgSDMPBB8Q9/Fxmdl3wZl2k2z0lugQX1WTE6EO+qimQX0L2JoXL0BQ++6XT Rv2RQVPF0QOZxJsiIzJmcoIBI8/qdm6AxvyJExYfMwqoawA2Iqg74sZDL0ytyt5vDD HZa3gQhf2m+scTQtuvvpcDLjfUEdalI2Gov/1/rMQNQLu+aYInC5QOy7tb6qqyke6e R/A1hui4xM2JA4lki0nnUaiUaLWVQ8Q7xnGGSwdvkwIy3GW7xjbTUntn4dR3uOOg5j n63+dCR7pS6yDz6/NAXlT5KcX5jS93daKIuB34/x0mVvwiSKeixbtMpGuPxYm9CE6a q7IrFG7a2UZuA== Date: Tue, 18 May 2021 11:59:51 +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: <20210518105951.GC7770@willie-the-truck> References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-14-will@kernel.org> <20210518102833.GA7770@willie-the-truck> 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 On Tue, May 18, 2021 at 10:48:07AM +0000, Quentin Perret wrote: > On Tuesday 18 May 2021 at 11:28:34 (+0100), Will Deacon wrote: > > 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. > > Yep, probably. > > > 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. > > Right so I think either way will be imperfect, so I agree with the > above. > > Maybe one thing though is that, IIRC, userspace _can_ disable admission > control if it wants to. In this case I'd have no problem with allowing > this weird behaviour when admission control is off -- the kernel won't > provide any guarantees. But if it's left on, then it's a different > story. > > So what about we say, if admission control is off, we allow execve() and > sched_setattr() with appropriate warnings as you suggest, but if > admission control is on then we fail both? That's an interesting idea. The part that I'm not super keen about is that it means admission control _also_ has an effect on the behaviour of execve(), so practically you'd have to have it disabled as long as you have the possibility of 32-bit deadline tasks anywhere in the system, which impacts 64-bit tasks which may well want admission control enabled. So perhaps my initial position of trying to keep sched_setattr() and execve() consistent with each other is flawed and actually we can say: * Disable admission control if you want to admit a 32-bit task explicitly via sched_setattr() * If a 64-bit deadline task execve()s a 32-bit program then we warn and override the affinity (i.e. you should avoid doing this if you care about the deadlines). That amounts to dropping this patch and tweaking the documentation. Dunno, what do you think? Will