Received: by 10.213.65.68 with SMTP id h4csp1388imn; Thu, 15 Mar 2018 07:51:54 -0700 (PDT) X-Google-Smtp-Source: AG47ELvJo2+D8mkqpTRBisZn5wGD37vZUWPaObJo75KKkAYeU+Agc0IjYFeZ5VXIdgIGjzw9x+Lf X-Received: by 2002:a17:902:bf03:: with SMTP id bi3-v6mr8371565plb.343.1521125514876; Thu, 15 Mar 2018 07:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521125514; cv=none; d=google.com; s=arc-20160816; b=dM7obs3E5rFajLb7zxpMAmDUKptIlJgYbdjkujMSUKuG8hbkz4dl9DJAJYaj23gG98 uJhK+CWAvu3gJRxoGipuO3IGAeiacOE6n8b6ODeeDw9cBeofxToCmr7+FPqg6MID25v3 0i6wPaFyt2Oo0VWsk04Zu/FVKE4PXBCFFyueopbch/LDLaPCtyjGqz6r2rg/8fsZYB1Q ZDEZnM25jw2ZDdrQvS7GmnOq6CE+NPjvI2Y4SnskHAd028FYQ3QHrIW/lLiD9Vfxojwi nWjbGomxQpyQ1vEExgHbFwaSLNbdRL4uGw8s1NZjXoDfq4VssiMxDZ3aX+Q55RljFxh8 QCeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hg2RFXAAhMF2yA3nKt3rJBx8Ie563zucdSRclrXJSCE=; b=TFwz06AKZEVsRbTdz4o4T9OtOG0u5dlBQfdOeIKPEeaIKi+vX0N6tCJqYcQ0JOOVLG qAhSu5UuX+fmYftKKDRpxStV5UWzfFskbHFOKY7nrDkb+/+W4LCrKi51BgW/LmOxmvg3 EQ0yka5dE8ubwtsxMjt4j/mvKVLpXhxlEWD9ZyxrDo6A1KATWl2ffYlNY6WEUf1+KZPj FNrMYWllbTIdKwaXTuRBVfzhULfaW+z0s2CshYI/eNe4zV96IeaVeISqCVajvuVLKo9Y vjY63zKElutUbQnbHRicjodwRtJ4JSip4h7jLgtNS21Yvd3u1Mzt9KHPy/Xn8cEjEcBF VboA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1-v6si4031585plt.434.2018.03.15.07.51.39; Thu, 15 Mar 2018 07:51:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932404AbeCOOr0 (ORCPT + 99 others); Thu, 15 Mar 2018 10:47:26 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:39978 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619AbeCOOrY (ORCPT ); Thu, 15 Mar 2018 10:47:24 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1372A1435; Thu, 15 Mar 2018 07:47:24 -0700 (PDT) Received: from e105550-lin.cambridge.arm.com (e105550-lin.cambridge.arm.com [10.1.211.30]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 8D5513F487; Thu, 15 Mar 2018 07:47:22 -0700 (PDT) From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: valentin.schneider@arm.com, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, gaku.inami.xh@renesas.com, linux-kernel@vger.kernel.org, Morten Rasmussen Subject: [PATCHv2 0/7] sched/fair: Migrate 'misfit' tasks on asymmetric capacity systems Date: Thu, 15 Mar 2018 14:46:57 +0000 Message-Id: <1521125224-15434-1-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On asymmetric cpu capacity systems (e.g. Arm big.LITTLE) it is crucial for performance that cpu intensive tasks are aggressively migrated to high capacity cpus as soon as those become available. The capacity awareness tweaks already in the wake-up path can't handle this as such tasks might run or be runnable forever. If they happen to be placed on a low capacity cpu from the beginning they are stuck there forever while high capacity cpus may have become available in the meantime. To address this issue this patch set introduces a new "misfit" load-balancing scenario in periodic/nohz/newly idle balance which tweaks the load-balance conditions to ignore load per capacity in certain cases. Since misfit tasks are commonly running alone on a cpu, more aggressive active load-balancing is needed too. The fundamental idea of this patch set has been in Android kernels for a long time and is absolutely essential for consistent performance on asymmetric cpu capacity systems. The patches have been tested on: 1. Arm Juno (r0): 2+4 Cortex A57/A53 2. Hikey960: 4+4 Cortex A73/A53 Test case: Big cpus are always kept busy. Pin a shorter running sysbench tasks to big cpus, while creating a longer running set of unpinned sysbench tasks. REQUESTS=1000 BIGS="1 2" LITTLES="0 3 4 5" # Don't care about the score for those, just keep the bigs busy for i in $BIGS; do taskset -c $i sysbench --max-requests=$((REQUESTS / 4)) \ --test=cpu run &>/dev/null & done for i in $LITTLES; do sysbench --max-requests=$REQUESTS --test=cpu run \ | grep "total time:" & done wait Results: Single runs with completion time of each task Juno (tip) total time: 1.2608s total time: 1.2995s total time: 1.5954s total time: 1.7463s Juno (misfit) total time: 1.2575s total time: 1.3004s total time: 1.5860s total time: 1.5871s Hikey960 (tip) total time: 1.7431s total time: 2.2914s total time: 2.5976s total time: 1.7280s Hikey960 (misfit) total time: 1.7866s total time: 1.7513s total time: 1.6918s total time: 1.6965s 10 run summary (tracking longest running task for each run) Juno Hikey960 avg max avg max tip 1.7465 1.7469 2.5997 2.6131 misfit 1.6016 1.6192 1.8506 1.9666 Changelog: v2 - Removed redudant condition in static_key enablement. - Fixed logic flaw in patch #2 reported by Yi Yao - Dropped patch #4 as although the patch seems to make sense no benefit has been proven. - Dropped root_domain->overload renaming - Changed type of root_domain->overload to int - Wrapped accesses of rq->rd->overload with READ/WRITE_ONCE - v1 Tested-by: Gaku Inami Morten Rasmussen (3): sched: Add static_key for asymmetric cpu capacity optimizations sched/fair: Add group_misfit_task load-balance type sched/fair: Consider misfit tasks when load-balancing Valentin Schneider (4): sched/fair: Kick nohz balance if rq->misfit_task sched: Change root_domain->overload type to int sched: Wrap rq->rd->overload accesses with READ/WRITE_ONCE sched/fair: Set sd->overload when misfit kernel/sched/fair.c | 115 +++++++++++++++++++++++++++++++++++++++--------- kernel/sched/sched.h | 15 +++++-- kernel/sched/topology.c | 9 ++++ 3 files changed, 115 insertions(+), 24 deletions(-) -- 2.7.4