Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1232418pxj; Fri, 21 May 2021 09:17:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw52ew5n0bwuggjMf6PfaTy+97Dwm0UFrG8u0wKJRGc2jjZZZFlwpWcqdpU+WZmFwRI3o8q X-Received: by 2002:a17:906:128e:: with SMTP id k14mr10933617ejb.485.1621613835233; Fri, 21 May 2021 09:17:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621613835; cv=none; d=google.com; s=arc-20160816; b=xlH+g2pz/6+B7pldINP73svzxdHfE+zrQDZ0OagRCZZRODNAda7hLmd3YjWeSNshCk /2qpnVMBZAIBRUXCBNl2a70Cv4yytPLV79LpEALCId+bg9yaXQWDcgI1LMy5VI0TyPvO Kg2Xw57Zs3eCNfKx1RDmedXgLtF9Pg0JROTPD9cbmI/FEMZMy9qS5AgP6NnSTHfFdHZu 9qwedsu3976S60mb+QgqMgDWNVZENu2nCUVzIi2+7PfVum3h41YIp+swQjHgj55QiZQA ts7SieMb6XfhV2QcpkQpH15wB7v+0q1LKm86EaeeRR3KUiJMQSyX3ghN2zg9yWPfNyV3 qf5Q== 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; bh=BqXxYrgozG6Ww2sJDWGhLq7kNSoFC9HGWcvOoBnpoIA=; b=Qb8qgL20Jv4jEQT4iiql9hcr0R9bbxJEMOXjsf1Jxw4D3bhQ6TPSv5bOaZtLMe9LCb P00qNildE3RV/2Mq+xNVljtHDa9Y7drDwaQBbo3TTATXweOOS9uLDXQ0yvtEalUXodcs vUJX0+y6ObV2q1hxeX7Vs0p5xFeRH6TcQ7D7e7sFYVE4f+py9Q47mCCpVQgoTRQ8d9hZ qKIrRMlzeFh58zU1i/sO+5VMQi77nxfUSjJhpaq6MDcJ9Z5ABhHjx6EmcFRLEKExPOrJ Fc3YzDZqIxifckJgh8CbvEYnR+r9GUR42bygG6hhekUG/4Oe+waOtGiSx+cQxzdwofyM y19Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si5956668eja.23.2021.05.21.09.16.51; Fri, 21 May 2021 09:17:15 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235752AbhETR4y (ORCPT + 99 others); Thu, 20 May 2021 13:56:54 -0400 Received: from foss.arm.com ([217.140.110.172]:56592 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235086AbhETR4x (ORCPT ); Thu, 20 May 2021 13:56:53 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CAA2A11B3; Thu, 20 May 2021 10:55:31 -0700 (PDT) Received: from [192.168.1.16] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5EFE43F719; Thu, 20 May 2021 10:55:28 -0700 (PDT) Subject: Re: [PATCH v6 13/21] sched: Admit forcefully-affined tasks into SCHED_DEADLINE To: Daniel Bristot de Oliveira , 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: Dietmar Eggemann Message-ID: <8bc24850-3a14-5dd2-fbc2-bf745616949f@arm.com> Date: Thu, 20 May 2021 19:55:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: 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 20/05/2021 18:00, Daniel Bristot de Oliveira wrote: > 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? Not sure. Reading this thread I was under the assumption that the only change would be the drop of this patch. But I assume there is also this 'if DL AC is on then let sched_setattr() fail for this 32bit task'. IMHO, the current patch-stack w/o this patch should let (1) succeed with DL AC.