Received: by 10.223.176.5 with SMTP id f5csp705493wra; Fri, 2 Feb 2018 04:54:50 -0800 (PST) X-Google-Smtp-Source: AH8x224XGuA86pkmPjZQze8lgoiqR4CSBCi7jYTawKD5QCBMShtcLCAXimkOKKh0IV2BUX+UwTWc X-Received: by 10.101.97.139 with SMTP id c11mr1877811pgv.219.1517576090341; Fri, 02 Feb 2018 04:54:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517576090; cv=none; d=google.com; s=arc-20160816; b=Fi3vBLahHBFuP8F8yScyV9EJrCb0RE7hVRYKt7dp1Odby16KeGwkMia1oYrbT+gh2n JrPsehd+884JkV+/Pi9y63nfZ1mmCQokw9RMntIr+YDtMwBZCDc/QoC1wN4UsaNziwMD 2bkalSRN7tL9k4JLEoBGfadIb5191bzrsukwFBrzXDXGqRG1ogDyDPq/BSN1LNfEzJpE sPiO97VMZ5mgVPkpSvCPLDV8fRLiIUQDssLfLSRroZMWTbFWak/6v93Myu0ToDKOnj0v ZrGsZVxjEESG19Z5bI6Do98xSbebmKcOxtxTgTPIuM3ESMgnJKuGmIAVB6vdyy1i2uY0 zOWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=W//g3ntwAS6vLNS8LwjiuXNlAEHA/SS/k7c4Y7FhU0E=; b=0AqjKbEgw+E65RkZJkotuEgQXIK5A4YxYULqDLMXWt3v7w604va3SQj3GRfXgw+H9f /G89igx8oeyoMOyOJIRXY9uAaPCGJE5Kfjm9BRrsbyJecdwAvYeAPFd1KXYpFM5BvL0t ejO3TOt2CyqAgtp/MjiQ+2UMP+8Hpj50qTI4g+6Ml1e9+KRaY6nEq88xcwhtOI0xxBR8 UppPR1/6YASKSS1jd7P+oThWkkEthw7u8vcRJd8skDBWp4zdn8eJWzbuaj8jQt1/8Yrg Gd5STb1MRB+sEa1d4WUKia+cm86ggcNsJc43r1fSXoyRHBxTCLKKwT0YpUh767HlFV2Z 6IhQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17si1406426pgb.353.2018.02.02.04.54.35; Fri, 02 Feb 2018 04:54:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751872AbeBBMx2 (ORCPT + 99 others); Fri, 2 Feb 2018 07:53:28 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50221 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752118AbeBBMwg (ORCPT ); Fri, 2 Feb 2018 07:52:36 -0500 Received: by mail-wm0-f67.google.com with SMTP id f71so12406387wmf.0 for ; Fri, 02 Feb 2018 04:52:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=W//g3ntwAS6vLNS8LwjiuXNlAEHA/SS/k7c4Y7FhU0E=; b=nbfMINMXHPb7Zj6Lpr3wk0gvT5wqcC2zLKBbkTclfODGtLnd19jNGAb7NIjrUGTHeW L7yC5jjp3b2fpN4ir77vGDbDUyyeC0khEbricYOGt8sKXr37af5BHQ5z0sdKT8G7Io4b Zq2nukxP7OA9Yc2EEM6QT6IkaKmPB1TIEagXiO8dHOJYGzTnOGYp4HkPKfOeRvBgdiH8 rdJnNgbgO4Z1d/SEi4deiFrel1jZWitLn0inEAsbocv6c5t1LcghAMJbnf1c/zWoIq3d XANaO2kjBbyffDlYwowlVWSJVLjUfP/kGvDdze5nuVNaDZzveOt1YUUo6p7YLvzl+lxM WxSg== X-Gm-Message-State: AKwxytdvzhQ+/R/vASENqeiup2EynqQxjCNlLmYJL8P8Aj8hOUzlHwxj xsH/GQT9qgslGmXpO0UnLoglCw== X-Received: by 10.28.154.67 with SMTP id c64mr31546938wme.125.1517575954732; Fri, 02 Feb 2018 04:52:34 -0800 (PST) Received: from localhost.localdomain ([151.15.228.62]) by smtp.gmail.com with ESMTPSA id h200sm736184wme.11.2018.02.02.04.52.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 02 Feb 2018 04:52:34 -0800 (PST) Date: Fri, 2 Feb 2018 13:52:31 +0100 From: Juri Lelli To: Mathieu Poirier Cc: peterz@infradead.org, lizefan@huawei.com, mingo@redhat.com, rostedt@goodmis.org, claudio@evidence.eu.com, bristot@redhat.com, tommaso.cucinotta@santannapisa.it, luca.abeni@santannapisa.it, linux-kernel@vger.kernel.org Subject: Re: [PATCH V2 2/7] cpuset: Rebuild root domain deadline accounting information Message-ID: <20180202125231.GT19535@localhost.localdomain> References: <1517503869-3179-1-git-send-email-mathieu.poirier@linaro.org> <1517503869-3179-3-git-send-email-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517503869-3179-3-git-send-email-mathieu.poirier@linaro.org> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathieu, On 01/02/18 09:51, Mathieu Poirier wrote: > When the topology of root domains is modified by CPUset or CPUhotplug > operations information about the current deadline bandwidth held in the > root domain is lost. > > This patch address the issue by recalculating the lost deadline > bandwidth information by circling through the deadline tasks held in > CPUsets and adding their current load to the root domain they are > associated with. > > Signed-off-by: Mathieu Poirier > --- [...] > +static void update_tasks_root_domain(struct cpuset *cs) > +{ > + struct css_task_iter it; > + struct task_struct *task; > + > + css_task_iter_start(&cs->css, 0, &it); > + > + while ((task = css_task_iter_next(&it))) > + dl_add_task_root_domain(task); > + > + css_task_iter_end(&it); > +} > + > +/* > + * Called with cpuset_mutex held (rebuild_sched_domains()) > + * Called with hotplug lock held (rebuild_sched_domains_locked()) > + * Called with sched_domains_mutex held (partition_and_rebuild_domains()) > + */ > +static void rebuild_root_domains(void) > +{ > + struct cpuset *cs = NULL; > + struct cgroup_subsys_state *pos_css; > + > + rcu_read_lock(); > + > + /* > + * Clear default root domain DL accounting, it will be computed again > + * if a task belongs to it. > + */ > + dl_clear_root_domain(&def_root_domain); Can't a __sched_setscheduler sneak in at this point, set a task to DEADLINE, add its bandwidth to the rd... > + > + cpuset_for_each_descendant_pre(cs, pos_css, &top_cpuset) { > + > + if (cpumask_empty(cs->effective_cpus)) { > + pos_css = css_rightmost_descendant(pos_css); > + continue; > + } > + > + css_get(&cs->css); > + > + rcu_read_unlock(); > + > + update_tasks_root_domain(cs); ... and this adds it again? > + > + rcu_read_lock(); > + css_put(&cs->css); > + } > + rcu_read_unlock(); > +} Best, - Juri