Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1958484ybj; Wed, 6 May 2020 08:14:33 -0700 (PDT) X-Google-Smtp-Source: APiQypIuXe3YmOHaBp90C9d4LKeNSHy/xhoux5oUtXPK+H5ttPuU2vmuWDBZNCdSuNjF3LS6oeOB X-Received: by 2002:a17:906:300a:: with SMTP id 10mr7898882ejz.139.1588778073212; Wed, 06 May 2020 08:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588778073; cv=none; d=google.com; s=arc-20160816; b=itCcB9nIlGefLpWZ2Wq60asmnBN2ESssaEnR5HTvDMBICEPsCq7Lfhi5jCzzBTj1Hi poRetuH2uGsmYadJg1Bfqe7rt3rJx6RlgV7EChpnAjiym5P/2xQiaKurOlrK9NwXF4Vy cZFjYVEVxhbb8b8Q+dVlgoFXg248beX0NFVDXpor2qG55WyL6JqujcZQuiVS2SdmlGjZ BMeMe/tADijZbw4kJ/3o1nE6YRudzK1fiwWTgUJxdTN1F9kjxW21bqwUVZ4DhYUZ9MB+ iEOCOlkT0UsWLMWpemW+mBele1B9dH2rSyOu+DjcyJkbd6U7ayqK5QMZVE+iDbFuMU+U UbBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1H3/GtU0VyEFEQYSH7fFc7hbGPo80I8ngNd/KHmYMVU=; b=RURQ99WrbzacKaJ6hyofECIJXDbhdaI1T/F95fe8PABmdZWg6UQAdFPTLbNpl/xeQ2 YmWWDltzCYXMu1mOQjv/1d8R/pgulPlkyKv+dXvXK43iY+y5zJ7fXSZ+JQrldkZ/orwc GlKS/WFnl8SJ6W0G+XnHw9EfdWkdgIGqBnF8mPVOV6r7vQAN3cpfDzij2hqQNePICQvg 9nHV/RZyUDaGtKsTpBUpyguoIW+1poowIG3gDkQxY/hVdeDG1j61NhIGnKuy+h8FOc2u cXLoySNJNHOIypkARNmahvAGLxZZDNj2jKlyWtzvHoSvmU+kQ239oBqEowGtC/DUC196 3Y8g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si1332219ejq.430.2020.05.06.08.14.07; Wed, 06 May 2020 08:14:33 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729281AbgEFPJb (ORCPT + 99 others); Wed, 6 May 2020 11:09:31 -0400 Received: from foss.arm.com ([217.140.110.172]:38498 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728428AbgEFPJb (ORCPT ); Wed, 6 May 2020 11:09:31 -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 6725DD6E; Wed, 6 May 2020 08:09:30 -0700 (PDT) Received: from [192.168.0.7] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 12E6A3F68F; Wed, 6 May 2020 08:09:25 -0700 (PDT) Subject: Re: [PATCH v2 3/6] sched/deadline: Add dl_bw_capacity() To: Juri Lelli Cc: Ingo Molnar , Peter Zijlstra , Vincent Guittot , Steven Rostedt , Luca Abeni , Daniel Bristot de Oliveira , Wei Wang , Quentin Perret , Alessio Balsini , Pavan Kondeti , Patrick Bellasi , Morten Rasmussen , Valentin Schneider , Qais Yousef , linux-kernel@vger.kernel.org References: <20200427083709.30262-1-dietmar.eggemann@arm.com> <20200427083709.30262-4-dietmar.eggemann@arm.com> <23bde551-0d91-4bfe-ce65-40af9fbfdef9@arm.com> <20200506123738.GJ17381@localhost.localdomain> From: Dietmar Eggemann Message-ID: Date: Wed, 6 May 2020 17:09:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200506123738.GJ17381@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2020 14:37, Juri Lelli wrote: > On 06/05/20 12:54, Dietmar Eggemann wrote: >> On 27/04/2020 10:37, Dietmar Eggemann wrote: [...] >> There is an issue w/ excl. cpusets and cpuset.sched_load_balance=0. The >> latter is needed to demonstrate the problem since DL task affinity can't >> be altered. >> >> A CPU in such a cpuset has its rq attached to def_root_domain which does >> not have its 'sum_cpu_capacity' properly set. > > Hummm, but if sched_load_balance is disabled it means that we've now got > a subset of CPUs which (from a DL AC pow) are partitioned. So, I'd tend Yes, the CPUs of the cpuset w/ cpuset.sched_load_balance=0 (cpuset B in the example). > to say that we actually want to check new tasks bw requirement against > the available bandwidth of the particular CPU they happen to be running > (and will continue to run) when setscheduler is called. By 'available bandwidth of the particular CPU' you refer to '\Sum_{cpu_rq(i)->rd->span} CPU capacity', right? This is what this fix tries to achieve. Regardless whether cpu_rq(i)->rd is a 'real' rd or the def_root_domain, dl_bw_capacity() will now always return '\Sum_{cpu_rq(i)->rd->span} CPU capacity' > If then load balance is enabled again, AC check we did above should > still be valid for all tasks admitted in the meantime, no? Example (w/ this fix) on Juno [L b b L L L], capacity_orig_of(L)=446 : mkdir /sys/fs/cgroup/cpuset/A echo 0 > /sys/fs/cgroup/cpuset/A/cpuset.mems echo 1 > /sys/fs/cgroup/cpuset/A/cpuset.cpu_exclusive echo 0-2 > /sys/fs/cgroup/cpuset/A/cpuset.cpus mkdir /sys/fs/cgroup/cpuset/B echo 0 > /sys/fs/cgroup/cpuset/B/cpuset.mems echo 1 > /sys/fs/cgroup/cpuset/B/cpuset.cpu_exclusive echo 3-5 > /sys/fs/cgroup/cpuset/B/cpuset.cpus echo 0 > /sys/fs/cgroup/cpuset/B/cpuset.sched_load_balance echo 0 > /sys/fs/cgroup/cpuset/cpuset.sched_load_balance echo $$ > /sys/fs/cgroup/cpuset/B/tasks chrt -d --sched-runtime 8000 --sched-period 16000 -p 0 $$ ... [ 144.920102] __dl_bw_capacity CPU3 rd->span=3-5 return 1338 [ 144.925607] sched_dl_overflow: [bash 1999] task_cpu(p)=3 cap=1338 cpus_ptr=3-5 [ 144.932841] __dl_bw_capacity CPU3 rd->span=3-5 return 1338 ... echo 1 > /sys/fs/cgroup/cpuset/B/cpuset.sched_load_balance echo $$ > /sys/fs/cgroup/cpuset/B/tasks chrt -d --sched-runtime 8000 --sched-period 16000 -p 0 $$ ... [ 254.367982] __dl_bw_capacity CPU5 rd->span=3-5 return 1338 [ 254.373487] sched_dl_overflow: [bash 2052] task_cpu(p)=5 cap=1338 cpus_ptr=3-5 [ 254.380721] __dl_bw_capacity CPU5 rd->span=3-5 return 1338 ... Regardless of 'B/cpuset.sched_load_balance' '\Sum_{cpu_rq(i)->rd->span} CPU capacity' stays 1338 (3*446) So IMHO, DL AC check stays intact.