Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1534764ybz; Thu, 30 Apr 2020 00:46:28 -0700 (PDT) X-Google-Smtp-Source: APiQypL1Xwg+wxDfVIol4bHKtyS8RY82Ao9VgGRSzV480MKJ+0S2xmNcMm0XPiqqXX0E6jot0sy3 X-Received: by 2002:aa7:d514:: with SMTP id y20mr1517721edq.28.1588232788813; Thu, 30 Apr 2020 00:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588232788; cv=none; d=google.com; s=arc-20160816; b=IEra+ChbyqeY0FAALXIKMJJifC44U9ZDM+JPU//Om6Xrs0n2TT4Un8bpoMqB1gGsM6 zI+sf2fwcNndyUDLG22aVcH37WqO6nG8fEYTNlLBJJdigLAIQe+4v3NvmDUlu9qmkJIM t+zEdMLvHjMau2wCXwhb+erCbZRHa0mU/0uYaNMqfI4tXTF1E2WD7ickIoZ7PFF29o+l Fkpe+yjMjYyW6PWBtzGasLPpDmv0rGPsLfL+qHsQpVywLItNwkMpfrbs6SXH/0djGOEa Q+TZCOG9hPEV6UA2N6j9zgxux59zyyx5iaffSKQ7ppsNDVqKFFaqgrnqL+2hjt4wWyE0 sdmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4Me2gp8RxPqDFf1rj2uLX6ZZDuLWQfRcDDy0cz86Ar4=; b=jg0dcdr14+WcNHL5rAtEfZ89gRDZlzeY2lIVazI3JVhQio0T1sQ9dw0HgTQS01e6JH pPxPlAvQPMwWFL1r8DE+RMGMWGWssB8ZDvfxDKPM/tJ11bZ7ya3agJ8BCz3ZTzItgmop plQPMt7SekPbITc4tcRFueng2Ka5Wr9mVv4uRW4pWMl5XzNcyuV4QQd6xBtzWt2f7045 qf5Ck7qCyFY0MglWQzkUkArzmqzkZuXuim57Q0uO8NWMF4bu6JsqrtOz5zF3uavGs2j8 /ig97/BXgOVo6/xex07/mhRW7sj4EN4EVv+qZHiagl50rUHou2nzYeTbY6lnmGOiaNAi pv7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HTntdA1e; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k16si5666981ejr.429.2020.04.30.00.46.05; Thu, 30 Apr 2020 00:46:28 -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=@linaro.org header.s=google header.b=HTntdA1e; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726476AbgD3Hod (ORCPT + 99 others); Thu, 30 Apr 2020 03:44:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbgD3Hod (ORCPT ); Thu, 30 Apr 2020 03:44:33 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC761C035494 for ; Thu, 30 Apr 2020 00:44:32 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id j3so5384711ljg.8 for ; Thu, 30 Apr 2020 00:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4Me2gp8RxPqDFf1rj2uLX6ZZDuLWQfRcDDy0cz86Ar4=; b=HTntdA1e6qLCVEhkkCFcGCJFM/M5KjS7mWSAH3SEPWbOK3uPptqOf+qIOqMPLPLeqh lZSU14ZbKzzz2QrUYiNs3ll80ddlnMRvpwO1wprzjl4zd7obM6COomWvByQVqBSS7z1Q 7WBC770BX5/8rNcU+77BpzBYcooj9v+XjPFyvxu1hbvJP7zCsT5yvMC/RIhh1LASnWBj XiaOEAwFxyl4Z6H0nMIhTSoPvfa9BLyopZH4M1DTInw4JO+GjFx4pUuRF85G1stw9+3e B+sY+43awFa5UKl2edbGLFGwZsZiWudYeFERlsz5qzJ/+1/SQDrh05/9CpELzZiawho4 kqSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4Me2gp8RxPqDFf1rj2uLX6ZZDuLWQfRcDDy0cz86Ar4=; b=QQ4vls2ZwQQ63TAObC1+VZhKsb6ZBYG4wOzoPQ1UQjj5j5FFj6FPRkPw2uBJZ9F0rK 5OXx31MS1eLUqh69XcfHbO1UwvGH4Tf8WJYbLG+0Yt07Iw7JQi1wIfLsxWCLp6snVM9L 8ofpHdwWTQSfhg5P9sORxFCqTc7q70CG+ku+A4X2NFwzCeNO5oasae+BwrWOtCASvcMF nsQND3svMcHOtPiYZtNeP0UuhCuGqjXVlhAr5XLpN1nR2ddwziJf3HI0dw0n9JhVR1r/ 2lGJrQ8oT8V4rotKa77VCgRuVKBnsTxu2oezUIdhRKsKa9paJKkhrzYk3bFKqxiCZFuE KQWQ== X-Gm-Message-State: AGi0PuYCP3Mj9Dm8Ax2zWui7W+qIAoul4fojGhFmTrVvfg3dAZUutkZ9 mwUVsXNPMBQYzeY9qfahjqUawXObOuPfNRo8JBjD3w== X-Received: by 2002:a2e:740f:: with SMTP id p15mr1348569ljc.151.1588232671090; Thu, 30 Apr 2020 00:44:31 -0700 (PDT) MIME-Version: 1.0 References: <20200428050242.17717-1-swood@redhat.com> In-Reply-To: From: Vincent Guittot Date: Thu, 30 Apr 2020 09:44:19 +0200 Message-ID: Subject: Re: [RFC PATCH 0/3] newidle_balance() latency mitigation To: Valentin Schneider Cc: Scott Wood , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Dietmar Eggemann , Rik van Riel , Mel Gorman , linux-kernel , linux-rt-users Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 30 Apr 2020 at 01:13, Valentin Schneider wrote: > > > On 28/04/20 06:02, Scott Wood wrote: > > These patches mitigate latency caused by newidle_balance() on large > > systems, by enabling interrupts when the lock is dropped, and exiting > > early at various points if an RT task is runnable on the current CPU. > > > > When applied to an RT kernel on a 72-core machine (2 threads per core), I > > saw significant reductions in latency as reported by rteval -- from > > over 500us to around 160us with hyperthreading disabled, and from > > over 1400us to around 380us with hyperthreading enabled. > > > > This isn't the first time something like this has been tried: > > https://lore.kernel.org/lkml/20121222003019.433916240@goodmis.org/ > > That attempt ended up being reverted: > > https://lore.kernel.org/lkml/5122CD9C.9070702@oracle.com/ > > > > The problem in that case was the failure to keep BH disabled, and the > > difficulty of fixing that when called from the post_schedule() hook. > > This patchset uses finish_task_switch() to call newidle_balance(), which > > enters in non-atomic context so we have full control over what we disable > > and when. > > > > There was a note at the end about wanting further discussion on the matter -- > > does anyone remember if that ever happened and what the conclusion was? > > Are there any other issues with enabling interrupts here and/or moving > > the newidle_balance() call? > > > > Random thought that just occurred to me; in the grand scheme of things, > with something in the same spirit as task-stealing (i.e. don't bother with > a full fledged balance at newidle, just pick one spare task somewhere), > none of this would be required. newly idle load balance already stops after picking 1 task Now if your proposal is to pick one random task on one random cpu, I'm clearly not sure that's a good idea > > Sadly I don't think anyone has been looking at it any recently.