Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2013989pxy; Sat, 24 Apr 2021 02:30:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqUHOTq9koFk72EKQAcogRSYIjDMtHjH5RubrEe15klmx6MxH8GerxOtxtneF7eMcbhxSc X-Received: by 2002:a65:480a:: with SMTP id h10mr7585744pgs.63.1619256649621; Sat, 24 Apr 2021 02:30:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619256649; cv=none; d=google.com; s=arc-20160816; b=JBRn3CWfT9KfVKIBiFofSBPNLQVJGfbbLFUCnzURQfW7hTbJqNBo2gOoJyFEFWFsut VWXnnJSvxe7IGHt9OkrLB8aTMRzdO2x5zZ0WBTaPNKXyfDl4vHg9ZneofiNAzlNCS5B2 rFhgPJXY44utuA2ldR9/nz+b2rvMMBVStO2ntu3RTNvGiFmxksyRhbArDEdgXfp2zFoP JcYreW6CoUBLu2dq/1Epj3BcJwIRcbgkV/v7LDFFqSh+cpNSSnAVC01pdfROnRvDeU9i E2x8sIj9anisOn+0TFodV7obDvMUUwX3krTtawaJjhktA2uCM1fiJ33kuk5CAy/SRg0p KQqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=mOdxwJHKCkXu3zxh/eqyl5JrcImpkD7t7hBzteVxtnI=; b=aty8eQRGfjxOu3q4moJ/Z1p1r/glZ4euq9dDyPTg53ho/gPEq46xVfySZQfLH7HpFw pX4NlfrxSX0rLz+61pXIwhhmMS52XACaLBTAoEycffU6gGHG6d5HRuqVaNJJYaZaFUKb PAHNxMy5CujZxH6rDRuFZomOn70N01qENLVMVz2nTkOTdNZqe/MzeV7BWXMIll7PKBO8 axCfguGuZh9g6VaQImuxtKBkGRVcToGnVnkc08TIJC6tUqecBDWppNiP0CqeonjeEs0x VWX5ewvPkDvftYtjX58vlga8hYG9OlLHcIrLvsZqxpCCmQGOd03tur/4DCo6E3Z9Tz+D vTKg== 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 y10si13175304pjy.122.2021.04.24.02.30.37; Sat, 24 Apr 2021 02:30:49 -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 S231771AbhDXJan (ORCPT + 99 others); Sat, 24 Apr 2021 05:30:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:44946 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229850AbhDXJal (ORCPT ); Sat, 24 Apr 2021 05:30:41 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DE60EACF6; Sat, 24 Apr 2021 09:30:02 +0000 (UTC) Date: Sat, 24 Apr 2021 10:30:00 +0100 From: Mel Gorman To: Rik van Riel Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, Vincent Guittot , Valentin Schneider , Peter Zijlstra , Ingo Molnar , Dietmar Eggemann Subject: Re: [PATCH v4] sched,fair: Skip newidle_balance if a wakeup is pending Message-ID: <20210424093000.GA4171@suse.de> References: <20210422130236.0bb353df@imladris.surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210422130236.0bb353df@imladris.surriel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 01:02:36PM -0400, 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 Acked-by: Mel Gorman -- Mel Gorman SUSE Labs