Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp819316pxj; Thu, 20 May 2021 23:14:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZUvgVd9JZMhLeCGGcrpuLBg7ZFqbAQ1p5bKwR8KGT1021eGP8jmUy3YY83n3cGpeDhOI3 X-Received: by 2002:a17:906:a415:: with SMTP id l21mr8514656ejz.233.1621577692650; Thu, 20 May 2021 23:14:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621577692; cv=none; d=google.com; s=arc-20160816; b=RsG0EdYoj8XWLHdvwkomzNzQHkyr6kDHYk82QY7KLqktzET6yZXlPM0IwFlsXwaxkX JXjnt+qwgTTt40pWywLTLaLYNJKfq0R6NxCCePYwEHQMwzTrnWwTewX7L8zHxXFgZcpz SxPeckUy2ot+B/D8vgBpxUGaGjB59Yb4SeTgJwGimBNMUdEBSM0ZfAtHAKd/LFiDBLRp yfPOIrJvUxprdmJo0aWijVkEUGWDk6s1M8Xr84GBkWbrHBy3H5L2q2WT/GaKzM8SRE5g YqwIkUubslbmId0Q4ZYShbaKs0odNFAl+btN+5nBcPykLdcw7lF8VM/w7uAillEg+92w j1Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=8JiB2x9xqhth6XifEh3aGlH81y4eaL+aj39sK1+85dc=; b=087AtMPeRBKLY3/vKCE5xvrhDoPvtKzndDfjTCy/9Z8dMDB++AWQq+v+vWH37IhWu7 BaO1uQRMlEQDhSq+ZcQVaz0cftWmExxOAgnswDiwjhPpGXczbNmm+gpsS4+ZMVEc+VNb mZIrnIuz/1QPqQQIECg5TgvxxIhmiaf1tjPXL0oFQG60L1PqKtVuOWFwj2eafGM2mFgP LJh5ADIIZz5ssNPUh/CJA4fIw/7J5ZDUAKI/6qgpd7ZMkjVzfHmfQrL1lPAF7qxdMtYl ewzhkxbHsUe7UWs55mssKF+T6olnB2hTIdAsJnCLZPTe9F+A3CZ8Bxjhi0AM9OHU5lDZ hQDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bD2lm8qe; 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 g9si4818234ejx.5.2021.05.20.23.14.29; Thu, 20 May 2021 23:14:52 -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=bD2lm8qe; 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 S233342AbhETQB6 (ORCPT + 99 others); Thu, 20 May 2021 12:01:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58415 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233306AbhETQB5 (ORCPT ); Thu, 20 May 2021 12:01:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621526435; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8JiB2x9xqhth6XifEh3aGlH81y4eaL+aj39sK1+85dc=; b=bD2lm8qeHPm63RJjoE+U8BxeSg3eFTFf0yAg0FP22p9/atZMqvnFbN99nIAbSG36/YsNbM YwI1+sePI0LxvWbZLUY57+tITiYKva/BAXYf3/bpXUQuTLFvPgZZj7leTcy/D3dMiY93bl BWBcWE/9Ow28EYc6RoQlN1eNv2HiM34= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-333-RMSqsGmvOGmyEhd632dOlw-1; Thu, 20 May 2021 12:00:33 -0400 X-MC-Unique: RMSqsGmvOGmyEhd632dOlw-1 Received: by mail-ed1-f72.google.com with SMTP id m6-20020aa7c4860000b029038d4e973878so5568379edq.10 for ; Thu, 20 May 2021 09:00:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8JiB2x9xqhth6XifEh3aGlH81y4eaL+aj39sK1+85dc=; b=b+FEZrL/Y5+QhoXfzsB7zbxz45KcrmDUq3kX/pEbii4uFNCIkUYm0Dn0HOhboB5GCZ t0fun2EUXrfAGfcT3zfW7fhn1fzqyjssA6rdLVZ8n+mISbjzVAL8kUf04f96QS3Sx98L QG8qQiRJTQniHHM0n1COnVGc7foHxMf/l1A1wTHPV7cE5O7fKJAtpnoxpHVS8bJWY3Lb XF72lZakcSh96k0QL6h0JDivTeeysLoimYfUyTvQziw25SaoiNnuXmWp/3waZvWsvZ1T uJoepvZnRV9+DoGL3OvufSPh5KWWPE1hFsKaTdZC99yymlVOjdiLieM6AfaUuY/fCbq+ dHLw== X-Gm-Message-State: AOAM530zXyB+Q+RKOcHGvQEWUpHIw6MAYNIQdZ3zIQvn68AUUnswgL/v MYkSuVorwVf2Lyeb26yKHNPyvL0VYzwpdPk3Yw5C9erhAJqFOAUP92ZFpctu/Y1kogCxTVtdxaV yBWtri9jBPx5E5o08YHEJD+5v X-Received: by 2002:a05:6402:2207:: with SMTP id cq7mr5641177edb.216.1621526431805; Thu, 20 May 2021 09:00:31 -0700 (PDT) X-Received: by 2002:a05:6402:2207:: with SMTP id cq7mr5641148edb.216.1621526431629; Thu, 20 May 2021 09:00:31 -0700 (PDT) Received: from x1.bristot.me (host-87-19-51-73.retail.telecomitalia.it. [87.19.51.73]) by smtp.gmail.com with ESMTPSA id z17sm1586158ejc.69.2021.05.20.09.00.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 May 2021 09:00:31 -0700 (PDT) Subject: Re: [PATCH v6 13/21] sched: Admit forcefully-affined tasks into SCHED_DEADLINE To: Dietmar Eggemann , Quentin Perret , Will Deacon Cc: Juri Lelli , 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 References: <20210518094725.7701-1-will@kernel.org> <20210518094725.7701-14-will@kernel.org> <20210518102833.GA7770@willie-the-truck> <20210518105951.GC7770@willie-the-truck> <20210520101640.GA10065@willie-the-truck> <0dbdfe1e-dede-d33d-ca89-768a1fa3c907@arm.com> From: Daniel Bristot de Oliveira Message-ID: Date: Thu, 20 May 2021 18:00:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <0dbdfe1e-dede-d33d-ca89-768a1fa3c907@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/21 5:06 PM, Dietmar Eggemann wrote: > On 20/05/2021 14:38, Daniel Bristot de Oliveira wrote: >> On 5/20/21 12:33 PM, Quentin Perret wrote: >>> On Thursday 20 May 2021 at 11:16:41 (+0100), Will Deacon wrote: >>>> Ok, thanks for the insight. In which case, I'll go with what we discussed: >>>> require admission control to be disabled for sched_setattr() but allow >>>> execve() to a 32-bit task from a 64-bit deadline task with a warning (this >>>> is probably similar to CPU hotplug?). >>> >>> Still not sure that we can let execve go through ... It will break AC >>> all the same, so it should probably fail as well if AC is on IMO >>> >> >> If the cpumask of the 32-bit task is != of the 64-bit task that is executing it, >> the admission control needs to be re-executed, and it could fail. So I see this >> operation equivalent to sched_setaffinity(). This will likely be true for future >> schedulers that will allow arbitrary affinities (AC should run on affinity >> change, and could fail). >> >> I would vote with Juri: "I'd go with fail hard if AC is on, let it >> pass if AC is off (supposedly the user knows what to do)," (also hope nobody >> complains until we add better support for affinity, and use this as a motivation >> to get back on this front). >> >> -- Daniel > > (1) # chrt -d -T 5000000 -P 16666666 0 ./32bit_app > > (2) # ./32bit_app & > > # chrt -d -T 5000000 -P 16666666 -p 0 pid_of(32bit_app) > > > Wouldn't the behaviour of (1) and (2) be different w/o this patch? > > In (1) __sched_setscheduler() happens before execve so it operates on > p->cpus_ptr equal span. > > In (2) span != p->cpus_ptr so DL AC will fail. > As far as I got, the case (1) would be spitted in two steps: - __sched_setscheduler() will work, then - execv() would fail because (span != p->cpus_ptr) So... at the end, both (1) and (2) would result in a failure... am I missing something? -- Daniel