Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp200187ybz; Tue, 21 Apr 2020 07:27:39 -0700 (PDT) X-Google-Smtp-Source: APiQypIe87fYfI3HxYKWYUbwl5tlxqWceI239DGRvi29PV/cGnuuV1I4wvHe3EJRq5YfOx/+qIe2 X-Received: by 2002:a17:906:78c:: with SMTP id l12mr20233886ejc.189.1587479259608; Tue, 21 Apr 2020 07:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587479259; cv=none; d=google.com; s=arc-20160816; b=YMC35kjjnOjjW0xvmBtzJF0mRsrNiPdb+5xlL+QfaMym5SES7yHHHt/YR1gyWLdT1B JM9kVXS7XF3eWYstI7tw0l9BeS1CtfjopCY4+d7i1UkSbemooMg12aHnYQay/RrVED5V dbVT/HBMM4xVNV3avy9scv2MLm5vZMEkDW3l9uASFwDnvofFKekHoWPwol/wYKWRIW2p eLQIroOFdgqfurSR3dO/P3TSytryfQ1HUiHCjsPQooUboxSRtSmaEtLpz08e09GkuJCk tP10Iwpc5NnO1D94sA8E5jX75bDNwzCYYNL0Xh3uhOJVFKE7DnRdine1Ya0fmO58c5xV JMHA== 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; bh=43bMZYjKf9ygSoseNPV9jAJZ/jPh/InlvlhjOuxxb7g=; b=XJEGKRAKX0+r00FyqhDJzXZWCpg4NlW7vX0CkCXQ/ihBAGHcUzOblVjRYy5S1z37hX 1YUTXvR1Gtd5yoJRrQBGtlz2ogF6gBm1lq5Dfk4uDqIJuenqgFTDz90qe5Beil12AXC7 V6GZYj7L6gXhZDN30auxZMMFSGBufyiYJsriQTbkt1BiCNwKy3wi0caxVF4Jv9ALsqRX sZDD5h6hL/1UZyN2Hv8UH3KEFnal0EINYMND0BUT5xv1YO/a8+zWeFcLqIAXb5kXceny CcnXO6JLZb1J5UJXtoLNf+L3CL6sdt+thfKG4WFKpLo+sQCIyXPV5Y0cjOaWANke974k N60w== 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 m16si1654410edq.329.2020.04.21.07.27.08; Tue, 21 Apr 2020 07:27:39 -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 S1729022AbgDUOZ5 (ORCPT + 99 others); Tue, 21 Apr 2020 10:25:57 -0400 Received: from foss.arm.com ([217.140.110.172]:35814 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726628AbgDUOZ5 (ORCPT ); Tue, 21 Apr 2020 10:25:57 -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 2656131B; Tue, 21 Apr 2020 07:25:56 -0700 (PDT) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A84FA3F68F; Tue, 21 Apr 2020 07:25:53 -0700 (PDT) Date: Tue, 21 Apr 2020 15:25:51 +0100 From: Qais Yousef To: Vincent Guittot Cc: Valentin Schneider , Ingo Molnar , Peter Zijlstra , Juri Lelli , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Andrew Morton , Thomas Gleixner , Yury Norov , Paul Turner , Alexey Dobriyan , Josh Don , Pavan Kondeti , linux-kernel , Marc Zyngier , "Rafael J. Wysocki" Subject: Re: [PATCH 0/4] sched/rt: Distribute tasks in find_lowest_rq() Message-ID: <20200421142551.hadvuw65vshzp6fe@e107158-lin.cambridge.arm.com> References: <20200414150556.10920-1-qais.yousef@arm.com> <20200421121305.ziu3dfqwo7cw6ymu@e107158-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/21/20 15:28, Vincent Guittot wrote: > On Tue, 21 Apr 2020 at 15:18, Valentin Schneider > wrote: > > > > > > On 21/04/20 13:13, Qais Yousef wrote: > > > On 04/14/20 19:58, Valentin Schneider wrote: > > >> > > >> I'm a bit wary about such blanket changes. I feel like most places impacted > > >> by this change don't gain anything by using the random thing. In sched land > > >> that would be: > > > > > > The API has always been clear that cpumask_any return a random cpu within the > > > mask. And the fact it's a one liner with cpumask_first() directly visible, > > > a user made the choice to stick to cpumask_any() indicates that that's what > > > they wanted. > > > > > > Probably a lot of them they don't care what cpu is returned and happy with the > > > random value. I don't see why it has to have an effect. Some could benefit, > > > like my use case here. Or others truly don't care, then it's fine to return > > > anything, as requested. > > > > > > > Exactly, *some* (which AFAICT is a minority) might benefit. So why should > > all the others pay the price for a functionality they do not need? > > > > I don't think your change would actually cause a splat somewhere; my point > > is about changing existing behaviour without having a story for it. The > > thing said 'pick a "random" cpu', sure, but it never did that, it always > > picked the first. > > > > I've pointed out two examples that want to be cpumask_first(), and I'm > > absolutely certain there are more than these two out there. What if folks > > ran some performance test and were completely fine with the _first() > > behaviour? What tells you randomness won't degrade some cases? > > I tend to agree that any doesn't mean random and using a random cpu > will create strange behavior > > One example is the irq affinity on b.L system. Right now, the irq are > always pinned to the same CPU (the 1st one which is most probably a > Little) but with your change we can imagine that this will change and > might ever change over 2 consecutives boot if for whatever reason (and > this happen) the drivers are not probed in the same order . At the end > you will run some tests with irq on little and other time irq on big. > And more generally speaking and a SMP system can be impacted because > the irq will not be pinned to the same CPU with always the same other > irqs For me this highlights issues that needs to be addressed. Which I think are easy enough to address. But I won't push too hard for this. Thanks -- Qais Yousef