Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3455263pxy; Tue, 4 May 2021 02:37:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxczzgjl4TLHIkYQGx6eMGDFBiJtXOzarrIElHqkhnvPCrOhooZxZPKj5Ax8Y4ADQqC6V8z X-Received: by 2002:aa7:d1d9:: with SMTP id g25mr25925203edp.30.1620121037664; Tue, 04 May 2021 02:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620121037; cv=none; d=google.com; s=arc-20160816; b=KeXf5Ddy6fchqJHHd2QCaTsJJ3TsbEiMm0Ne7I6x9TyQT78j+l7nUux/MjqWLdOUKY 8T5s2W23Nt2BCRYyTDwpLZUu4RWVqPKv8KsCjljjs6b4jGQw5u0nXwG6v9YRHPBsjLZ2 thyLasaJnJRvbtoewloV7stMSUdYT80pcjZbQL4OR8XRVZgrm0hlNulPj1AxHJQ5bPql EgXwDZFVzlh+MJmp2Y95qSzUy8Wj2BHpirc7KgIDLUsLmD1Ab85Y9bn+czkzPN579ew0 Uo2EpjVnIe+MW1ORengW4HRfBLZjjmaP0+pPaivjBTQ3hAdObcdNsBho5u39YFtDJr4d fVdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HVDMhGxlUpZhhlMcAlfvkm85ng62ef3vR38l+wYqSfI=; b=MPKtQPlOgyRmy/Aa12liLXcVfbRw5E45DT0sc1Szs4sFvTYVPtqxurF6FGkG5DlhQE fFbHIEDMvnV8DjzLCdth91aNxqqcrVy/mcy9ae80d2a/W0bgHrDJNPDxzG5eWjObpQDT zvkTz6C/a1r4RvjHKJ3eHaTf+lxH4oxuXnnu2UVWAioP5N9Cu1h4JR9/b8WV0N1ovygw fjEFQ7WxnkhiSGENmmM7Dd8fMmFQGIji0k0zJ//4uqjWgHus9xFrvPuBfhmBA+tz2/gG nlRzkD6g0UG5auCCAJgYr/ahehiYLce8TSd6H5EtJboyhwx/HGTwq42lpFLSHMJl2rEd 6D2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=EzaBXYOk; 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 m21si7557810edc.194.2021.05.04.02.36.54; Tue, 04 May 2021 02:37:17 -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=@infradead.org header.s=casper.20170209 header.b=EzaBXYOk; 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 S229953AbhEDJXK (ORCPT + 99 others); Tue, 4 May 2021 05:23:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbhEDJXI (ORCPT ); Tue, 4 May 2021 05:23:08 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80C12C061574 for ; Tue, 4 May 2021 02:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HVDMhGxlUpZhhlMcAlfvkm85ng62ef3vR38l+wYqSfI=; b=EzaBXYOkcVlhuSpp3qYEK+E5DZ zCKLb6yXKM4BJnWD9c0kek7AZagdy46sOlX8+HJS3nn6sMwOEAGcU+5Diq3/AJtcJ7NaMUR2vtZiV 2fOfyHc3BI53ggiKFBlhBm3EgbL4qk55XGlrQLBnfqXy198q9+EUWxgBBd/Cg65qRLsrozGQPfAA8 BYWNz7sbE8+UnxTeZlSIacD9tbaK+pDH6leYyfzV2Ho8xSEb+PnV48VKGTr58Ov9Uwa1Qi0LPt4OJ 5NnMdioICQFmigFU1GhSDgB4IFSxsJscQk4lAY+17bVJSyWW1fQ3UwKi30VzDoK9n7SdK1O0SlZ1v FNeKD2qQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1ldrFS-00GOBK-Vq; Tue, 04 May 2021 09:21:49 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C8B553001D0; Tue, 4 May 2021 11:21:44 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id AF0B020264CB5; Tue, 4 May 2021 11:21:44 +0200 (CEST) Date: Tue, 4 May 2021 11:21:44 +0200 From: Peter Zijlstra To: Vincent Guittot Cc: Rik van Riel , linux-kernel , Kernel Team , Valentin Schneider , Ingo Molnar , Dietmar Eggemann , Mel Gorman Subject: Re: [PATCH v4] sched,fair: Skip newidle_balance if a wakeup is pending Message-ID: References: <20210422130236.0bb353df@imladris.surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 07:09:46PM +0200, Vincent Guittot wrote: > On Thu, 22 Apr 2021 at 19:02, Rik van Riel wrote: > > > > The try_to_wake_up function has an optimization where it can queue > > a task for wakeup on its previous CPU, if the task is still in the > > middle of going to sleep inside schedule(). > > > > Once schedule() re-enables IRQs, the task will be woken up with an > > IPI, and placed back on the runqueue. > > > > If we have such a wakeup pending, there is no need to search other > > CPUs for runnable tasks. Just skip (or bail out early from) newidle > > balancing, and run the just woken up task. > > > > For a memcache like workload test, this reduces total CPU use by > > about 2%, proportionally split between user and system time, > > and p99 and p95 application response time by 10% on average. > > The schedstats run_delay number shows a similar improvement. > > > > Signed-off-by: Rik van Riel > > Reviewed-by: Vincent Guittot Thanks!