Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp707650ybb; Wed, 8 Apr 2020 08:25:18 -0700 (PDT) X-Google-Smtp-Source: APiQypIgAdP2W0eerg+u578yaoAJlZ5c0xHIgYyGTGeG5bqJu0qBSP8BI5/Wz5PiMYQApFIvjq5e X-Received: by 2002:aca:2209:: with SMTP id b9mr2887887oic.103.1586359518794; Wed, 08 Apr 2020 08:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586359518; cv=none; d=google.com; s=arc-20160816; b=l9GTAUX+mMnPZ5jQnZH4a5f2q2RVFIuLbnR+Gg49V8bibi3izHfz0VZFrgT6+Ujrfl D8lny23OfFRcLQlnlXs+NvYSNvVoQaZgdyRWJz/kgZI44qcKTLePIm7MhhdMG3hh/3/F jdhJBJLB3/GYLp5FoSoIeWDOMl3t9h67Kw1nOYspbNj86B1J/nbx6eJNq7bmsoTcroVT +pBJRu74mkOy6n5+7SlX1esDQPs2wO0v+zPZCm5SH7E/vjYN64wMj+13/ybWE/mfFmWw AC1V5PTrVLOFcXnOLufAzjnH+RjvGAlXzDX4/viYf58je3OhldjB6e279U3mqBx38QDt lOng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=Se0uLNhgmWzhptHoUN3PsTKwsBoAbCDCYL3z4eTUJAU=; b=ni9yOcCfQpa5TpPIKU+Et32fVGJEWyRI8tkLrcU5L9/G/59Cm+8AlUHj4H3k20UmzN 841hu8qHRVpFKf+cv4DgNa/B076CwBjGrcgYzS/6TXS87Hvz9KKi9SlHaS8pM7LFV9W1 vSmSuU515jHpHwCXg+vADvgwbdeMt6yptr4052ZqqNSTszEMbHDUCdGFPgXr78TtnLNI L8OcL76B6PX3EgMXzTFhaZ4MsliChjTiqB/eVgwjbiX9foe6gfCjqY0pNJcjojjaMbpP H+/Ua8HS4Bs/XBqf9M9b43ugQw1+vyHvWcoEam0ZPOeYf7g61bD2d4LEJq9xqFfWdBEb Nc2A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k201si2207859oib.94.2020.04.08.08.24.59; Wed, 08 Apr 2020 08:25:18 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729078AbgDHPBw (ORCPT + 99 others); Wed, 8 Apr 2020 11:01:52 -0400 Received: from foss.arm.com ([217.140.110.172]:39654 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727906AbgDHPBv (ORCPT ); Wed, 8 Apr 2020 11:01:51 -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 E80431045; Wed, 8 Apr 2020 08:01:50 -0700 (PDT) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EAF5E3F68F; Wed, 8 Apr 2020 08:01:48 -0700 (PDT) References: <20200408095012.3819-1-dietmar.eggemann@arm.com> <20200408095012.3819-3-dietmar.eggemann@arm.com> <20200408153032.447e098d@nowhere> User-agent: mu4e 0.9.17; emacs 26.3 From: Valentin Schneider To: luca abeni Cc: Dietmar Eggemann , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Steven Rostedt , Daniel Bristot de Oliveira , Wei Wang , Quentin Perret , Alessio Balsini , Pavan Kondeti , Patrick Bellasi , Morten Rasmussen , Qais Yousef , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] sched/deadline: Improve admission control for asymmetric CPU capacities In-reply-to: <20200408153032.447e098d@nowhere> Date: Wed, 08 Apr 2020 16:01:43 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/04/20 14:30, luca abeni wrote: >> >> I don't think this is strictly equivalent to what we have now for the >> SMP case. 'cpus' used to come from dl_bw_cpus(), which is an ugly way >> of writing >> >> cpumask_weight(rd->span AND cpu_active_mask); >> >> The rd->cpu_capacity_orig field you added gets set once per domain >> rebuild, so it also happens in sched_cpu_(de)activate() but is >> separate from touching cpu_active_mask. AFAICT this mean we can >> observe a CPU as !active but still see its capacity_orig accounted in >> a root_domain. > > Sorry, I suspect this is my fault, because the bug comes from my > original patch. > When I wrote the original code, I believed that when a CPU is > deactivated it is also removed from its root domain. > > I now see that I was wrong. > Well it is indeed the case, but sadly it's not an atomic step - AFAICT with cpusets we do hold some cpuset lock when calling __dl_overflow() and when rebuilding the domains, but not when fiddling with the active mask. I just realized it's even more obvious for dl_cpu_busy(): IIUC it is meant to prevent the removal of a CPU if it would lead to a DL overflow - it works now because the active mask is modified before it gets called, but here it breaks because it's called before the sched_domain rebuild. Perhaps re-computing the root domain capacity sum at every dl_bw_cpus() call would be simpler. It's a bit more work, but then we already have a for_each_cpu_*() loop, and we only rely on the masks being correct. > > Luca