Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3853854pxj; Mon, 24 May 2021 16:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUkGCBU3LyBSekK3V+qxGUQ+7Fxd5vkcHfwsXdXofrA2m0XZGyiENm3pkV8SVo1tbd/mCF X-Received: by 2002:a02:7354:: with SMTP id a20mr27178908jae.94.1621900632477; Mon, 24 May 2021 16:57:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621900632; cv=none; d=google.com; s=arc-20160816; b=pNX5c+6R27E1eyVzbnMrvYF+k2MPDba69C9sJ9B777zyKtsxehN2lFgT1AY9MAkQPK PwHiRzBRlnToUHgt6BMZ+3ZSAHwDRIDNJFfPF5IfEd2Kvhmxo0bFI7fPA9W9ny5M7nbO ql3+XfDTEm8sfxXDqPjROIYC6eYcvGl1BNifrJzipeVBE8vggEFGV1gzWpRnZoTnGGBQ RC0YWp3V9Avd7AX7Aq2Xpf3ch/mNUMr+G8CTo/PPqILdsuU0g2R3IHOiIdSeMC9lw5w5 cKAKzif4OIx5B1AFASNna02m3atBjTt8NcJcQ2PD5qKV5BehtmfBzTVZ4xsOEgvhSE0f jjDg== 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=Q0Y1MSFNtzN4AFO6UssfYe4AsbYkLeilwXeIPQ0mAOY=; b=co5gW2KU+IY0TdCnpQo/szjDO6+fC0nFCNTBrIoY7CWaU8IzhM3rF+JoUdGSLh0i1X K/QZVFVrcjLxgzaAKt82Ww2tExa9cD3ZkW3R4WfHSidmwU0W4OydAnDcQIur4NRJtWez TOeaWkRGHqI6nBuGXJaKVrsvz9d3k9sKI0BCzPe94GMjY2n4uC57E5o8WOPeK08eDkLP Z7O1ErbWKybCp3m0KohMM4NjuFfr515qrdDKOREnxVePgKi6ISUrWTnB97P0mEe4yIe+ PupDWpBuEwSqznYOhI7hiKSx0GrG/sf9Hmgj0vFr3dnEbDyJDdE/0C2mQ38yAz2tEygi PFEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HmJw8NGK; 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 k2si15377512iow.30.2021.05.24.16.56.59; Mon, 24 May 2021 16:57:12 -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=HmJw8NGK; 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 S233512AbhEXUsm (ORCPT + 99 others); Mon, 24 May 2021 16:48:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233183AbhEXUsl (ORCPT ); Mon, 24 May 2021 16:48:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 053B961405; Mon, 24 May 2021 20:47:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621889233; bh=UgjQUQLFaMWyKj6Zcvq2RbMKVtls6JxUFa1a/1pBQ0g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HmJw8NGKyGMgFxlc0lX9EYXvjA5+XvjYQ2D4Zu+nqkxRHcDppn8oRJgDQ3PDFz7OO yykoE128gO8ILMXjJb0gFQKGqTLClSfdJ+//io7qhCydw6Lk96ueXWs3giEmFS8AzZ 4Vc/RQtNUGFdEMKUVB/mLUNMhU8JphsWgmNJU8nt8+4KKkazRQUeCYQGRTwEiZ966B sbhQqxhQln/+12J0jqml3wRpjinRDCnO1ZUDewyv2ooaXqyZSGPZ1fN4ZXAJcK/xc1 t6uKIF68FC6c5PW7syyfdjPLwtKBS0n1ZwF3XC89EbPrw7w/7x7qs+IUBQ+kI6z0Y3 VxKFQmJYLg8aA== Date: Mon, 24 May 2021 21:47:06 +0100 From: Will Deacon To: Daniel Bristot de Oliveira Cc: Juri Lelli , Quentin Perret , 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 Subject: Re: [PATCH v6 13/21] sched: Admit forcefully-affined tasks into SCHED_DEADLINE Message-ID: <20210524204706.GE15545@willie-the-truck> References: <20210520101640.GA10065@willie-the-truck> <20210520180138.GA10523@willie-the-truck> <20210521103724.GA11680@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 Fri, May 21, 2021 at 03:00:42PM +0200, Daniel Bristot de Oliveira wrote: > On 5/21/21 12:37 PM, Will Deacon wrote: > > Interesting, thanks. Thinking about this some more, it strikes me that with > > these silly asymmetric systems there could be an interesting additional > > problem with hotplug and deadline tasks. Imagine the following sequence of > > events: > > > > 1. All online CPUs are 32-bit-capable > > 2. sched_setattr() admits a 32-bit deadline task > > 3. A 64-bit-only CPU is onlined > > At the point 3, the global scheduler assumption is broken. For instance, in a > system with four CPUs and five ready 32-bit-capable tasks, when the fifth CPU as > added, the working conserving rule is violated because the five highest priority > thread are not running (only four are) :-(. > > So, at this point, for us to keep to the current behavior, the addition should > be.. blocked? :-(( > > > 4. Some of the 32-bit-capable CPUs are offlined > > Assuming that point 3 does not exist (i.e., all CPUs are 32-bit-capable). At > this point, we will have an increase in the pressure on the 32-bit-capable CPUs. > > This can also create bad effects for 64-bit tasks, as the "contended" 32-bit > tasks will still be "queued" in a future time where they were supposed to be > done (leaving time for the 64-bit tasks). That's a really interesting point that I hadn't previously considered. It means that the effects of 32-bit tasks with forced affinity are far reaching when it comes to deadline tasks. > > I wonder if we can get into a situation where we think we have enough > > bandwidth available, but in reality the 32-bit task is in trouble because > > it can't make use of the 64-bit-only CPU. > > I would have to think more, but there might be a case where this contended > 32-bit tasks could cause deadline misses for the 64-bit too. > > > If so, then it seems to me that admission control is really just > > "best-effort" for 32-bit deadline tasks on these systems because it's based > > on a snapshot in time of the available resources. > > The admission test as is now is "best-effort" in the sense that it allows a > workload higher than it could handle (it is necessary, but not sufficient AC). > But it should not be considered "best-effort" because of violations in the > working conserving property as a result of arbitrary affinities among tasks. > Overall, we have been trying to close any "exception left" to this later case. > > I know, it is a complex situation, I am just trying to illustrate our concerns, > because, in the near future we might have a scheduler that handles arbitrary > affinity correctly. But that might require us to stick to an AC. The AC is > something precious for us. I've implemented AC on execve() of a 32-bit program so we'll fail that system call with -ENOEXEC if the root domain contains 64-bit-only CPUs. As expected, the failure mode is awful because it seems as though the ELF binary is then treated like a shell script by userspace and passed to /bin/sh: $ sudo chrt -d -T 5000000 -P 16666666 0 ./hello32 ./hello32: 1: Syntax error: word unexpected (expecting ")") Anyway, I'll include this in v7. Cheers, Will