From patchwork Thu Apr 25 09:37:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 162835 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1701099jan; Thu, 25 Apr 2019 02:37:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpDZ26WPlevrTaTjpjOq/6wu0en73QLkB3uK7dp281goXCw6HpIV3oiMoNwtS6iEuo/bma X-Received: by 2002:aa7:91c8:: with SMTP id z8mr39777810pfa.110.1556185068439; Thu, 25 Apr 2019 02:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556185068; cv=none; d=google.com; s=arc-20160816; b=trUBGVhCNsCWP/d1YwjhJgpqRwrW3iBUq9NeiF29aE7y7HPxj0N3GSpHqko3GKMG4D R0+7za7swuzbQWBU6i9qsfCK7x12eVNOdH7f5DquBEKyXAJAA1hgbHcYvM88HBa4KnN8 +eDfGa7VCJz2QXFhteJrsyMTXtQa7C5Ab8bFF5W4l8WdhTckwyRZ6KA40UA/WbTKbQl2 tzVHDSVzVcZuhRB36pnsVjEho4LfWckJvj0wD80Qv9cQE/4zMGxSx4yzAANriah3q98B X38aN3XWutalAanqGCafX3TYzOa7oBzJsCXf1GJQ46Wlj1y2G/xB34F7YQUX59hisky6 G/5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=L4GNjjOM4WJx7rmvuMNCY3RTw8Tm7bDS0tz59trmNv8=; b=xJciX97/iLpMfG3Korr2yjhDxaQDMqvoLQLBDxkRuEMzRYchIl8UkJCrvjHnSz+gFv WhxHhNc8y7cKYGNczXVYoc1j0nCkVJ8MVs8e7f0+VHn0FawKm/saNA/gJdmi+8SSDne6 RMujIrNE2FJjMlx5CWJcaiDSR3iRT0rXFCbYNNXUPgzvg2rSbsQrcH2u5QQESGZDpGSu KfpNfLbOZ1Yg8ouCZwSqKpkExiqLgbajTiBZQm7jDVRRZUmtTd8NLVKGnYeidFbILF5K 9te6ohtggSUyuRLvDr6d6f9ZgwnbQQPt5z2KetPyfVusxnl/WCwMdEO7SZZy49objoBJ Qcuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sfwhPozU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id p2si20120987pgk.326.2019.04.25.02.37.48; Thu, 25 Apr 2019 02:37:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sfwhPozU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728473AbfDYJhq (ORCPT + 30 others); Thu, 25 Apr 2019 05:37:46 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45944 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbfDYJhq (ORCPT ); Thu, 25 Apr 2019 05:37:46 -0400 Received: by mail-pl1-f195.google.com with SMTP id o5so6483026pls.12 for ; Thu, 25 Apr 2019 02:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L4GNjjOM4WJx7rmvuMNCY3RTw8Tm7bDS0tz59trmNv8=; b=sfwhPozUFwlvhfRzSk2gBZGNlxngNkNoU2Hi7rtQ2ZU+BP0zGbmaLgMjYm7KrG2+rL WeUcoGWHysCRgdnzg5ehAeFHL0j6ck8soVvlIo8eu/OSTTfHrIgcxlImewyBiYMUsKqk 8CbeV52uXVyGxcXM921Rs8PK68aKopjIvqie8BWZSQ1m5bhyrLeKLD9jAnTggOqHdOsG QWqQl3GECTQlAXIUurUeFLA0kLFcPXtIOKbQpBLhXaN/jTx2OmEVqpd99UvJPFQufBTR B+2yitrb5P5myYIXVZbNMEL2ccc63vz3oXQ/cvqNJaCCOpn4Nn8twWexVcPG593NaXHu i8+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L4GNjjOM4WJx7rmvuMNCY3RTw8Tm7bDS0tz59trmNv8=; b=hupFleDxu5HARsjDscn6xXbN0XOWwqyvdUKRnz/6RavsIEjd1OtHYw5+t48o9wTRGg Kdppqh43WScw43ofmmJxX3v6qncg/y3mHErN96PSikOZYSsXHcZppNjUWSAeXegfgskM kzdvJkgICBA4xWLvD0ikagUD2d8oMzsnhRTwyBIrS2K6+X0mwY67nFHj/9495UA/0MaA fPOKq5sZKkPQiXa6G/0KaX/yC1HK/N8cuEdZgUCEI4p5Ub+CKOwWAD9Cb+Mz2606O/mb 6YzinKOmeKTvlTU+aJZoywtZJn5a/PL/TYIUYmOqH1amIanXwTT/nocFwXIyYvDAeNev rE6g== X-Gm-Message-State: APjAAAXqH270BkFAlSLXsxOCXquZ3PVhesJ3Vfx1L+2p9SDlpm/6t4Gh J7DK3GDJDrkAYQs9P9wXJ/GQUjcZBqg= X-Received: by 2002:a17:902:694c:: with SMTP id k12mr37158913plt.149.1556185064948; Thu, 25 Apr 2019 02:37:44 -0700 (PDT) Received: from localhost ([122.166.139.136]) by smtp.gmail.com with ESMTPSA id h20sm57587289pfj.40.2019.04.25.02.37.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 02:37:44 -0700 (PDT) From: Viresh Kumar To: Ingo Molnar , Peter Zijlstra Cc: Viresh Kumar , Vincent Guittot , tkjos@google.com, Daniel Lezcano , quentin.perret@linaro.org, chris.redpath@arm.com, Dietmar.Eggemann@arm.com, linux-kernel@vger.kernel.org Subject: [RFC V2 0/2] sched/fair: Fallback to sched-idle CPU for better performance Date: Thu, 25 Apr 2019 15:07:38 +0530 Message-Id: X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Here is another attempt to get some benefit out of the sched-idle policy. The previous version [1] focused on getting better power numbers and this version tries to get better performance or lower response time for the tasks. The first patch is unchanged from v1 and accumulates information about sched-idle tasks per CPU. The second patch changes the way the target CPU is selected in the fast path. Currently, we target for an idle CPU in select_idle_sibling() to run the next task, but in case we don't find idle CPUs it is better to pick a CPU which will run the task the soonest, for performance reason. A CPU which isn't idle but has only SCHED_IDLE activity queued on it should be a good target based on this criteria as any normal fair task will most likely preempt the currently running SCHED_IDLE task immediately. In fact, choosing a SCHED_IDLE CPU shall give better results as it should be able to run the task sooner than an idle CPU (which requires to be woken up from an idle state). Basic testing is done with the help of rt-app currently to make sure the task is getting placed correctly. -- viresh Viresh Kumar (2): sched: Start tracking SCHED_IDLE tasks count in cfs_rq sched/fair: Fallback to sched-idle CPU if idle CPU isn't found kernel/sched/fair.c | 42 +++++++++++++++++++++++++++++++++--------- kernel/sched/sched.h | 2 ++ 2 files changed, 35 insertions(+), 9 deletions(-) -- 2.21.0.rc0.269.g1a574e7a288b [1] https://lore.kernel.org/lkml/cover.1543229820.git.viresh.kumar@linaro.org/