From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13A00C433B4 for ; Thu, 20 May 2021 17:55:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC7F060FE8 for ; Thu, 20 May 2021 17:55:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235977AbhETR4z (ORCPT ); Thu, 20 May 2021 13:56:55 -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. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6548C433ED for ; Thu, 20 May 2021 17:57:39 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6AF886100A for ; Thu, 20 May 2021 17:57:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AF886100A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mf+sS/DRfNP/SBQLl9p8KD1R3fH25meJBdEr/d70+gE=; b=Ka7RLkD8Rkv8QvUAykhKdVcnS2 gWyyHsmhIak/I4xkB1OgMQ+BYeRR9uTQnBGr/wYzaDen6vQbCnOhRdCpYuNmc5ohbwwBwloUwo8sM yDEybcb53qJQZb9X4CHQLfkfgVhg0RNWTbneuDtKbU3aY3lW2+wiKFTYEdbjmJGzQTteBJf0h5DNd oPjmJltIjBQ1xxo83tma1jUoHgKjjx0k/T1oBT9FC2MXKeIrMwwInEvTjJCYS3u6S3dMaZ6n8IKTe mftBCYdCOUJl0hBJbnMxUpxGPW7eWLidmkiRArxP+MHrZmjzncz8badeYh9l/4oH10QMze4xdzIJK 1uXUE9zw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljmtX-002B1b-5O; Thu, 20 May 2021 17:55:39 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljmtU-002B1G-9k for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 17:55:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=BqXxYrgozG6Ww2sJDWGhLq7kNSoFC9HGWcvOoBnpoIA=; b=VjF3XFGnGkeSzaycBSoa5ehioM B4oZGGFw3kAZKPDNriGm+LrbVwLupU+FULC4QP3gzSw14JRaRZyk//6PNcQsUSbhaIDvA5rON8lkR pXadGMx+1wdv0yViMwr9Du+bZ8qIcN3W2O8oUhBbgMMrK5fWiujhaL5Gj9YA4oXZUSlXa0vRt7lMa I+fDXzKokt+9PaFeWHD/LLKM5JON/tjDRnnvxXsBnk4tcL85Ba731sE5igiu9M1f9FZEHwyNc3kmY 2toEVrBHotbDpOpaTfKbetVN8Wt8eg+kUTEx/LJo6U4XTwe9t8h70VVC06SqQnDlCMacfp/UcF0cO j8tR339g==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1ljmtR-00GYbL-J0 for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 17:55:35 +0000 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_105533_753775_04D963B4 X-CRM114-Status: GOOD ( 21.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel