Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4429713rdh; Wed, 29 Nov 2023 00:56:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwEU9ilXCP9crnlPiEnl4+YaH3nZ7qPqjQxhu/buo1gZ8WdLiIKskgp3m8kN6t0Qi63Mkw X-Received: by 2002:a17:90b:4a03:b0:285:8407:615b with SMTP id kk3-20020a17090b4a0300b002858407615bmr20829378pjb.0.1701248198371; Wed, 29 Nov 2023 00:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701248198; cv=none; d=google.com; s=arc-20160816; b=gQpLozuwxzWZR+78JlMDbi5tBf8xsGL3SkwOj5F9edXrY3ZgGL0h+Y9BboEcHTVh+U NkfX3nc230RebK8xkOWa6qEkKpSFOXb0/fWw5hLcYWil4qtKTmECjlAJq1P7AzpCzQ1w 6uZXKFwbYdVwRES9TPvPPwQBfwuGS8ZxtlObu39YOCyIp2X2ruHMxDfJTEMOSM3KhRI9 jAtJCbX9CfoYgFZ/5EoewMYP8URQtA0VFZdBRJOBz6PbGtHl4KprETmgUn7S1p68pXUL 742ZfgFulrOlvaWnj28kFHJtvpFvmUt8YzFP9zzq3MLk1kJCm2yXVBTc6cl+GMasLZFS OeIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=JzddiWrd+qlEMReInwSex/A5ZhubfWueh7J1fVz15nw=; fh=GZeiI3TZhyOJNbZhS2F1/sO8hBYJ4mQiw7dZK75oWtI=; b=ldoB7z61AE2aWQM9F3NbSvVst8EmQfSbBvodQM6/QCQLQzShfcEF2+R9UaOFf9FznP lRf8DheMNorCYkPPFgtvp8/2gtwYUrEPHoLVB3v7qiif6KHcbkaMtqb5+qDTFNP6R4+I 3nYltDMzInDaSY/ZbyeHAZYnQ9QGh42SHYZ2Nzkt2RnuJ9lrL5LEJ7//I9hLZuFaj54v arJkuSi+7BhpoHh3UX4o0NJAfugWJxIebZRf+9Nald/y3xMRfnKDsXwOh1CWPm9Wil+C VKTb5iBaxYOt9yKgpauwST6QxOPHFv2C+A71tGW83tPFbiOI/ermGG4DgG14uoEOgVmj 4sGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id lw5-20020a17090b180500b00262e5a82047si932403pjb.44.2023.11.29.00.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:56:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 1D31E805FFC3; Wed, 29 Nov 2023 00:56:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232049AbjK2I4T (ORCPT + 99 others); Wed, 29 Nov 2023 03:56:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230172AbjK2I4Q (ORCPT ); Wed, 29 Nov 2023 03:56:16 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DD1DBD50 for ; Wed, 29 Nov 2023 00:56:22 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7E9022F4; Wed, 29 Nov 2023 00:57:09 -0800 (PST) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 840A73F6C4; Wed, 29 Nov 2023 00:56:20 -0800 (PST) Message-ID: Date: Wed, 29 Nov 2023 09:55:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] sched/fair: Use all little CPUs for CPU-bound workload Content-Language: en-US To: Pierre Gondois , linux-kernel@vger.kernel.org Cc: Qais Yousef , Vincent Guittot , Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider References: <20231124153323.3202444-1-pierre.gondois@arm.com> From: Dietmar Eggemann In-Reply-To: <20231124153323.3202444-1-pierre.gondois@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:56:35 -0800 (PST) On 24/11/2023 16:33, Pierre Gondois wrote: > Running n CPU-bound tasks on an n CPUs platform: > - with asymmetric CPU capacity > - not having SD_SHARE_PKG_RESOURCES flag set at the DIE nit: DIE is now called PKG on tip sched/core. f577cd57bfaa - sched/topology: Rename 'DIE' domain to 'PKG' (2023-10-12 Peter Zijlstra) > sched domain level (i.e. not DynamIQ systems) > might result in a task placement where two tasks run on a big CPU > and none on a little CPU. This placement could be more optimal by > using all CPUs. > > Testing platform: > Juno-r2: > - 2 big CPUs (1-2), maximum capacity of 1024 > - 4 little CPUs (0,3-5), maximum capacity of 383 > > Testing workload ([1]): > Spawn 6 CPU-bound tasks. During the first 100ms (step 1), each tasks > is affine to a CPU, except for: > - one little CPU which is left idle. > - one big CPU which has 2 tasks affine. > After the 100ms (step 2), remove the cpumask affinity. > > Before patch: > During step 2, the load balancer running from the idle CPU tags sched > domains as: > - little CPUs: 'group_has_spare'. Indeed, 3 CPU-bound tasks run on a > 4 CPUs sched-domain, and the idle CPU provides enough spare > capacity. What is meant by 'idle CPU provides enough spare capacity? I thought the task (util_avg ~ 512_ does not fit on the sched group [1,3-5] when we consider util_avg/capacity (383) The calculated imbalance of ~350 is too small for the task-size and that's why we need the 'shr_bound(util, env->sd->nr_balance_failed)' to let the task load-balance if nr_balance_failed = 2? [...] > Similar issue reported at: > https://lore.kernel.org/lkml/20230716014125.139577-1-qyousef@layalina.io/ > > v1: > https://lore.kernel.org/all/20231110125902.2152380-1-pierre.gondois@arm.com/ > > Suggested-by: Vincent Guittot > Signed-off-by: Pierre Gondois Even though this cures only classical big.LITTLE it might have a positive effect on today's Arm DynamIQ Android systems with Phantom SDs when running benchmarks like Geekbench. [...] Reviewed-by: Dietmar Eggemann