Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2966919pxy; Mon, 3 May 2021 11:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTgV5/m1w1vwFZOlafB+y0p5GUMZI/0S8k7MFDDffV6PS7tC95Y8IJD/WSBW92Logpofqi X-Received: by 2002:a63:7986:: with SMTP id u128mr19718253pgc.223.1620068085198; Mon, 03 May 2021 11:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620068085; cv=none; d=google.com; s=arc-20160816; b=IpfjPNYZwHhZ1fg/ITXnnY1WFPvjjnNYliCXcNA8Gx8H1wdyyTG31C12/5B2cF0NNN QCrYiaytjnt4qQDKVT0qCdjAR3bsXXCxx03IUME9vEsp03hG4nf5pFsdbKbsfmubZUNt c9eyL9LUpI61zXBG/hSWOH23TdR1gX38sUs4f730If6SA4Jdp76ogn0++F7SJtm158jU /Ma7QR4Vv3rAHLfciV7ErtcjH/v4jHVUt9+rVxZVLFqmR6K3yNj3VHBq5kEDWJeq4NP+ Zch+8JxvPoUBIV8Eve+HZysE7KdUzmAaYBbC+CUh/MKjIJHykq45TGd8UdIdFROED1Ku Zrog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=SXcGunFJQd9s2ZT/Ktmo2UkGRaVfz5YkQ1c2/p9NsRc=; b=Dh6wQV7HO1ngd17jy/ogpyGTD941Y9NpLOYvag8eN3J6neo0g+lA8GSVWmpL8vsRlH LCW9mLVynfbd5z4INXV3RBKmI865M2p6UdPD5HutAFc94+n/8Ddzb+jqxwYyTpXAWfUo J35JuSqh0DR3mlusQINe4jAcc7JzhDa7A3xH51Ffz20+vsarEdR5tRupBwIKTvHxM41W hmvNcr70kd2YFrxo2BfKvfHF0uT0kFHckZ00CaUp+lIPmMeaC5iMZTmaZaxhMLyq+P18 1tRTcaRwlEB/9o7PZ1NzUFh4/kbLJtOGDGjLFv2txZ9o/8CTunWCQieIjmVGrAsFHasO kGUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Bt8LcCaW; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d184si526330pga.273.2021.05.03.11.54.31; Mon, 03 May 2021 11:54:45 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Bt8LcCaW; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229634AbhECSyf (ORCPT + 99 others); Mon, 3 May 2021 14:54:35 -0400 Received: from mout.gmx.net ([212.227.17.22]:45123 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbhECSyd (ORCPT ); Mon, 3 May 2021 14:54:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620067967; bh=A/TMQuiuLC0Rhe8BIv4n8MfCqBTIsiRGtqT7aR8Go+c=; h=X-UI-Sender-Class:Subject:From:To:Cc:Date:In-Reply-To:References; b=Bt8LcCaWzXzngxXIo/78yKF3ejeuqziaBI0HxUJWn20pc/cG0fEjL9JmK6jf6XfoN ZJyDbbZnzluHeVe2lzaiJQg2RGIGug3m8cG8QOXcLtJcvZY9tjwTmYRjcphEiRDYRc f4OpsdrICM+1DVa28YcmDJP0LoTPfdUWtuu5z5hc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from homer.fritz.box ([185.221.149.135]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M1Ygt-1lgfgb3KaR-0039e8; Mon, 03 May 2021 20:52:46 +0200 Message-ID: <3773421d06bed0beed9971d03e8fa2050a14cc13.camel@gmx.de> Subject: Re: [PATCH v2 0/3] newidle_balance() PREEMPT_RT latency mitigations From: Mike Galbraith To: Scott Wood , Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Valentin Schneider , linux-kernel , linux-rt-users , Sebastian Andrzej Siewior , Thomas Gleixner Date: Mon, 03 May 2021 20:52:45 +0200 In-Reply-To: <4170501b7c4f19ba66d870b671dc90ffbf4623d6.camel@redhat.com> References: <20210428232821.2506201-1-swood@redhat.com> <7b796a085b0bc638c9df70d3a20718f8d1d776c8.camel@redhat.com> <4170501b7c4f19ba66d870b671dc90ffbf4623d6.camel@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" User-Agent: Evolution 3.34.4 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:8I6k35QKpm5b64+O31dj4ji8yjXkdtha+BrTy2xVijV8+VkWomv Me0Nj/S8RvSf/UagzWJzEPC+eReBwbojYTD/Yy8pKtXOIBNtPTqDeclq4H2xCJV54ArB+Vc tcezZx3xv/gUPatLloEWn3R8qGnbg+PF6B1WRtf3up057DDtmqn5NvjI0FPjPtZq+Wk2RHD uB7yte0vf/Dmh22yxrfEw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Tos9M+1xUEY=:1vA/k0uxL40hk+lHdttlXR 7a59s/dq9EIDkRWbKSbhEuhyZHt9Snfx093H5u3ck/IeTQEyMI98Cw1qw3Y0evWBuqGp/vis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mlhdPBj+P5IJvwQ1RszV nixAyivthEXQWf55hsbugMkODwey5cXuYru3fDYhgpvyqqooSbeF0HqEqeOgSQJO3yHwY= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-05-03 at 11:33 -0500, Scott Wood wrote: > On Sun, 2021-05-02 at 05:25 +0200, Mike Galbraith wrote: > > On Sat, 2021-05-01 at 17:03 -0500, Scott Wood wrote: > > > On Thu, 2021-04-29 at 09:12 +0200, Vincent Guittot wrote: > > > > Hi Scott, > > > > > > > > On Thu, 29 Apr 2021 at 01:28, Scott Wood wrote: > > > > > These patches mitigate latency caused by newidle_balance() on la= rge > > > > > systems when PREEMPT_RT is enabled, by enabling interrupts when = the > > > > > lock > > > > > is dropped, and exiting early at various points if an RT task is > > > > > runnable > > > > > on the current CPU. > > > > > > > > > > On a system with 128 CPUs, these patches dropped latency (as > > > > > measured by > > > > > a 12 hour rteval run) from 1045us to 317us (when applied to > > > > > 5.12.0-rc3-rt3). > > > > > > > > The patch below has been queued for v5.13 and removed the update o= f > > > > blocked load what seemed to be the major reason for long preempt/i= rq > > > > off during newly idle balance: > > > > https://lore.kernel.org/lkml/20210224133007.28644-1-vincent.guitto= t@linaro.org/ > > > > > > > > I would be curious to see how it impacts your cases > > > > > > I still get 1000+ ms latencies with those patches applied. > > > > If NEWIDLE balancing migrates one task, how does that manage to consum= e > > a full *millisecond*, and why would that only be a problem for RT? > > > > -Mike > > > > (rt tasks don't play !rt balancer here, if CPU goes idle, tough titty) > > Determining which task to pull is apparently taking that long (again, th= is > is on a 128-cpu system). RT is singled out because that is the config t= hat > makes significant tradeoffs to keep latencies down (I expect this would = be > far from the only possible 1ms+ latency on a non-RT kernel), and there w= as > concern about the overhead of a double context switch when pulling a tas= k to > a newidle cpu. What I think has be going on is that you're running a synchronized RT load, many CPUs go idle as a thundering herd, and meet at focal point busiest. What I was alluding to was that preventing such size scale pile-ups would be way better than poking holes in it for RT to try to sneak through. If pile-up it is, while not particularly likely, the same should happen with normal tasks, wasting cycles generating heat. The main issue I see with these patches is that the resulting number is still so gawd awful as to mean "nope, not rt ready", making the whole exercise look a bit like a noop. -Mike