Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5003981ybl; Tue, 14 Jan 2020 01:46:22 -0800 (PST) X-Google-Smtp-Source: APXvYqy8UMdSk97mW8Wguf+WnKWk19w1JGKWMdYHhvN3QFp0zBCNFS4wTw2S7w9aOEUcQhBDUnWU X-Received: by 2002:aca:398b:: with SMTP id g133mr15366889oia.11.1578995182822; Tue, 14 Jan 2020 01:46:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578995182; cv=none; d=google.com; s=arc-20160816; b=ncVMDGK585uhskGXDCuC5PlSbZlatkaTCvz7Mh4LhSUVL0r2y4xeAyfMjoDGFxe+E/ Ar7O8UctUhhgkhLFuhK/Qb/YlaaKtuU68pEoVgYG9tejaWaSvt37kVDCcnybuN5zHq0H DuRdNdhtxbsHXzBzeboiEs7/GeJiVVowmBLzLxJMHmSNyzeGT6mTAvHiPb0IeBlfeIyN k4OH4uZOAkFm3j4NPryGnuonh3Z0Mr0uMhMmcZAxqrX4Pxg8a8uL0KsUSz1e9Qwr3b6T H1eVFF0ejRmVht5psOMExbHse2ipUX2m9BfAEhDYUTcPKZWY3W5lamRUuP9byYoyUOnb vD5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:subject:cc:to:from :date:content-transfer-encoding:mime-version:dkim-signature; bh=PI6bH7h10v6UQh6MQxPrQIUgijc7NZxt1fTg9kRMwgk=; b=EVXI4meQ4DguO7S1P3fPJ0Qw1u7/pRt/1Uv2acUA4KtzJOkJcRURDQO8jDYrHTNiFA oQr9GGEZ3MXYwlnhKDT/irfs7jK4BpLELrPZSLkc/TLf31dSVdsOygzi1iHXiFzpgpWo /R84kdChjlPsrVHJdbsrpiykwExII+RUTY7avHCQSJ1uU2amw74xmNXQQWVYFanra5vE Pu3+ZOJvvEKJLhDAvDz3atSc9V4vHTd9C7obbC3gvXr6NwjMCE+fhj2oeA14egONzquV OU0cBDvZn/sMOTtP5Ra/2i+mctBb8h6Ze9GZw8qMsBWLhxU7pAw/xPVTTMNdj0veF+QQ N99Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=lmwXCF+6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si5170910oth.158.2020.01.14.01.46.10; Tue, 14 Jan 2020 01:46:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@posteo.de header.s=2017 header.b=lmwXCF+6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=posteo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728929AbgANJoQ (ORCPT + 99 others); Tue, 14 Jan 2020 04:44:16 -0500 Received: from mout01.posteo.de ([185.67.36.65]:45134 "EHLO mout01.posteo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726053AbgANJoP (ORCPT ); Tue, 14 Jan 2020 04:44:15 -0500 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id BF25F16006C for ; Tue, 14 Jan 2020 10:44:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1578995052; bh=ZQZSbgw/YGRKUI9Cpp6WEiaoPNlOpSORV4nBp/7wD2M=; h=Date:From:To:Cc:Subject:From; b=lmwXCF+683QlsdRUz1TNxq65LQyZ/+41R039wIbfsrMaWvNrXpAdhSnijQteskB8r 9bcm1MK2yyeDLuQf3f28FcgLvSVEez0MRY1VqULG3ce7vbBL1R+cgfT4XzGVyjHKV8 e1Py7Bb9xaQGA7luWjkkD8a9nfJcNjq5SivDRDOvY/R4TAupMOESqQihN5vTLkDuWH h9IHgochJ0GaAvBOZROWhAUPnmb3r2vEv8jmsP9StQszvMIYbpJXhG8UfgaEdKMPHI V26rT9TGjDWVXad/2d2cidcNgqHU4pGsT9RixgpMeg9MdSrQQ/5h2TA4TOuLjy/YXR iUZdu5k+HfJ5g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 47xlsP6qlTz6tmG; Tue, 14 Jan 2020 10:44:09 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 14 Jan 2020 10:44:09 +0100 From: stanner@posteo.de To: Juri Lelli Cc: linux-kernel@vger.kernel.org, Hagen Pfeifer , mingo@redhat.com, peterz@infradead.org, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de Subject: Re: =?UTF-8?Q?SCHED=5FDEADLINE=20with=20CPU=20affinity?= Message-ID: <3000986a52f2c961177c95289df69535@posteo.de> X-Sender: stanner@posteo.de User-Agent: Posteo Webmail Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 13.01.2020 10:22 schrieb Juri Lelli: > Hi, > > Sorry for the delay in repling (Xmas + catching-up w/ emails). No worries >> I fear I have not understood quite well yet why this >> "workaround" leads to (presumably) the same results as set_affinity >> would. From what I have read, I understand it as follows: For >> sched_dead, admission control tries to guarantee that the requested >> policy can be executed. To do so, it analyzes the current workload >> situation, taking especially the number of cores into account. >> >> Now, with a pre-configured set, the kernel knows which tasks will run >> on which core, therefore it's able to judge wether a process can be >> deadline scheduled or not. But when using the default way, you could >> start your processes as SCHED_OTHER, set SCHED_DEADLINE as policy and >> later many of them could suddenly call set_affinity, desiring to run >> on >> the same core, therefore provoking collisions. > > But setting affinity would still have to pass admission control, and > should fail in the case you are describing (IIUC). > > https://elixir.bootlin.com/linux/latest/source/kernel/sched/core.c#L5433 Well, no, that's not what I meant. I understand that the kernel currently rejects the combination of set_affinity and sched_setattr. My question, basically is: Why does it work with exclusive cpu-sets? As I wrote above, I assume that the difference is that the kernel knows which programs will run on which core beforehand and therefore can check the rules of admission control, whereas without exclusive cpu_sets it could happen any time that certain (other) deadline applications decide to switch cores manually, causing collisions with a deadline task already running on this core. You originally wrote that this solution is "currently" required; that's why assume that in theory the admission control check could also be done dynamically when sched_setattr or set_affinity are called (after each other, without exclusive cpu sets). Have I been clear enough now? Basically I want to know why cpusets+sched_deadline works whereas set_affinity+sched_deadline is rejected, although both seem to lead to the same result. P.