Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp208241pxj; Thu, 20 May 2021 07:41:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzusIGtMWSsw7AqNpCIIk+ZIsof/hcTp718cN7KgY9ijkWYqOXI0z9bRIlFcyyTz1Pk9nBc X-Received: by 2002:a17:906:71a:: with SMTP id y26mr3141974ejb.491.1621521704005; Thu, 20 May 2021 07:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621521703; cv=none; d=google.com; s=arc-20160816; b=tPQdQlOrMz6wjyX5b5BhNaO8GH7jTpGHjbtCImU0/tCf8BJ650i4oIAdh+E4FK53RY yhzXLF1Up68H9y74pZujYzdaWpg9uzrafULOcgq44n2TklavYaie0CTkqRUe7o97dUZl rCW/Jcq0XJFp/aA3ujanVvy2FwsfzYHSeszPDg6kkINVEnzqASjkaXf9ud9hEntlokx+ /YBJjZ3SbeJ5U25QuVR5J+iXvFYaCjA9qJjV2V8sxniWnJFNVXZrtzyzNLp4ytLSKB4h GTv+37sHc4fvoN+2ZjPOybZT5LNfZRgOBKfsI0g5EQQkc91ckUlUVcpdX+fnSjxmZnJW TI8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=59HPsGZmbzpogUicaNHmrUD8Ii9KkB0f2xmqCHspsTo=; b=TLZLv0s0eWciiI+0VtPqKr4P0YSiIiC6i3dVbBfnJ6kv2wdAHtYTGQsueBLvA58bGS FKyDTYo8blM2PjQ780cdbxprgyeucm615eFzTKjgRcaIxDIyzDA7HeEbGjer1UweTvlo Wn6X21Js41YxO1eXviLGhqfnmXpz8u80KBm1AmfRZ2GvrwSI9AVKIWWhB2md2CwOQSna cBR4PUV+r6KL+UQdA3ZHb1SxQSg76hvUvouzuzNfcUgulCWSaBtqyIX0CkHjfFPh+i1Z TTNea9xh8NCQWx0+Q45ANpHthMfvNAfxPx7oQE47/Nfqm7jY14DgMAUpqAnxUXc3DNeJ Gnrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LQAZUEv5; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si3498014ejj.270.2021.05.20.07.41.20; Thu, 20 May 2021 07:41:43 -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=@redhat.com header.s=mimecast20190719 header.b=LQAZUEv5; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231410AbhETJPH (ORCPT + 99 others); Thu, 20 May 2021 05:15:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53212 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230361AbhETJPG (ORCPT ); Thu, 20 May 2021 05:15:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621502025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=59HPsGZmbzpogUicaNHmrUD8Ii9KkB0f2xmqCHspsTo=; b=LQAZUEv5YMShFMGwZ7wluDVqOj9HbUIVSk90lyzrNkx5EbNxblVFq09Ot0PXRRj0Mmyy7b 6gLgUItsgFMt4UsGjLmG8GFwC8unbMMagx8wiu/zouHCQQFTyyVE1tvRmGECWk0s9LxXT/ 6GsmQNeda6/3IoDAPMc+jX9OYbHFc4U= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-573-pRcF2XPLMmib_lsDg4veLg-1; Thu, 20 May 2021 05:13:43 -0400 X-MC-Unique: pRcF2XPLMmib_lsDg4veLg-1 Received: by mail-ed1-f71.google.com with SMTP id d4-20020aa7ce040000b029038d1d0524d0so8454006edv.3 for ; Thu, 20 May 2021 02:13:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=59HPsGZmbzpogUicaNHmrUD8Ii9KkB0f2xmqCHspsTo=; b=R9jDrojWk07Cws3bJ7lfAZn6zzbHpTWQ/Ta1MAbsGnFek0HyasWK+P8ARvFZhe6Dvx GlJYwm7LwDW0Pbf6zz+En8+vSX56h0sIZjkIZEZbNKge3q/wA0k9V7aNQpWudlQZ5B0C e8m0k6ybmI2U16L+WmWoe/8v4Ef13PJAmfRLrvlffBlji0xeSZXnHHkERHj3/ncMSgRS RLWDfOeQNVqYQTuaI9htFFRYgBQ03u3G6b/mS32l7Pt7gQvhwy04WtyXckN7cOgjBFyc 1xgItYrgpA7j14+KAJ/Zi58RhctWCKS++aTNVvsUPGdzeqQIF/gZ7+p/SNANSdCN0ppR /3aw== X-Gm-Message-State: AOAM531tGqf58AMQRsyeevhCOWfhoTvQ6ZgWs1AvUvrF64x6GkCgRQ9J H1vPGIVc2OGb0metII8nRl0RsxyrOP1110vhjn9q4SuHG6jP350FekY7ADexaUuHcnLlj8FzqUr OotB3hguO1rC8ujLjKzivRdcX X-Received: by 2002:aa7:cf03:: with SMTP id a3mr3881009edy.314.1621502022602; Thu, 20 May 2021 02:13:42 -0700 (PDT) X-Received: by 2002:aa7:cf03:: with SMTP id a3mr3880983edy.314.1621502022394; Thu, 20 May 2021 02:13:42 -0700 (PDT) Received: from localhost.localdomain ([151.29.18.58]) by smtp.gmail.com with ESMTPSA id gt12sm1047058ejb.60.2021.05.20.02.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 02:13:41 -0700 (PDT) Date: Thu, 20 May 2021 11:13:39 +0200 From: Juri Lelli To: Quentin Perret Cc: Will Deacon , 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 , Vincent Guittot , "Rafael J. Wysocki" , kernel-team@android.com, Daniel Bristot de Oliveira Subject: Re: [PATCH v6 13/21] sched: Admit forcefully-affined tasks into SCHED_DEADLINE Message-ID: References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-14-will@kernel.org> <20210518102833.GA7770@willie-the-truck> <20210518105951.GC7770@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Quentin and Will, Apologies for the delay in replying. On 18/05/21 13:19, Quentin Perret wrote: > On Tuesday 18 May 2021 at 11:59:51 (+0100), Will Deacon wrote: > > 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() > > Right, that's a good point. And it looks like fork() behaves the same > regardless of admission control being enabled or not -- it is forbidden > from DL either way. So I can't say there is a precedent :/ > > > 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. > > Indeed, this is a bit sad, but I don't know if the kernel should pretend > it can guarantee to meet your deadlines and at the same time allow to do > something that wrecks the underlying theory. > > I'd personally be happy with saying that admission control should be > disabled on these dumb systems (and have that documented), at least > until DL gets proper support for affinities. ISTR there was work going > in that direction, but some folks in the CC list will know better. > > @Juri, maybe you would know if that's still planned? I won't go as far as saying planned, but that is still under "our" radar for sure. Daniel was working on it, but I don't think he had any time to resume that bit of work lately. So, until we have that, I think we have been as conservative as we could for this type of decisions. I'm a little afraid that allowing configuration to break admission control (even with a non fatal warning is emitted) is still risky. I'd go with fail hard if AC is on, let it pass if AC is off (supposedly the user knows what to do). But I'm not familiar with the mixed 32/64 apps usecase you describe, so I might be missing details. Best, Juri