Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2340528pxm; Thu, 24 Feb 2022 23:17:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4VYTjsM1BkbOIzrEkudejDZk86uttqnkTwbuk5u858Q+uQgNwApnBmJMATpKlaBZ0QkaP X-Received: by 2002:a65:6842:0:b0:375:983d:7e5b with SMTP id q2-20020a656842000000b00375983d7e5bmr3909494pgt.496.1645773436464; Thu, 24 Feb 2022 23:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645773436; cv=none; d=google.com; s=arc-20160816; b=yRAqhvMJ2xXt1WABE2umP6sjHWgAgDnATcTHP6nhPIXmU5zGWMHPQTzJQs1I+F6TRr L3iAGRE+BC7nFquWlbeJPTr9S8dMMNIcXASXB1V54BxVdPb0WtfroLfrLabLeTYXdkVX +bRzSSp7zTS3onqaKifJHfB39Pqm4na3jsBuhmqMHh3g+UD/gjYPZ5aCD1HGEM9j0eTr YXKTUIgEv8jfreYX0fZKeNiRzZl08DZjIgn8bsw4/jyOyS0AatjN1meSnb7Jux2keu4k 4+X3KWi7BiWrU/XhlhtTDMUw4cMTpLEtVvgQxx0arTfsFmTLN0rmzOaaMw6PPNkbLkBT yZAg== 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:dkim-signature; bh=zk9ju3IwH90PgmNQ/LV04l8j72tFlZyGQOmOzfhIN8Y=; b=Wh127SmrGlvqDPsbPCEFAuUtogSPgh0Hk65a3ID/7OhOJ4An6iKKEurHo6Hkqmh0uM 9/N4iC37UJKagEz0lbjbeU0S6OyntbvFaLQ1Bd+jgaL0JCBVELLgklBhgmlRkg+/2GPm +ng/Vr5f0WYt/l7SCBJTUEO57vBA61raebsDVpTuFa32l8culGScFcgehrQof09QypsP NxDWAh6bNGE/WHyOivjA8h3a/JdRX3yVf0yEZAysu4jngrFj99UZxnyhMjn6uHjugHMQ rSamufS3pdCpkadjnoTk79UYOaLFO/DFEnfMRF9mwdKXK3Bqjqo4BOVHSX5Dt5kClQ8K i0ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=DNbvqQi3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a17090274ca00b0014fdc65ff4fsi1097728plt.127.2022.02.24.23.16.49; Thu, 24 Feb 2022 23:17:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=DNbvqQi3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237911AbiBYGqz (ORCPT + 99 others); Fri, 25 Feb 2022 01:46:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237852AbiBYGqx (ORCPT ); Fri, 25 Feb 2022 01:46:53 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 548952763F1 for ; Thu, 24 Feb 2022 22:46:22 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id i21so3890624pfd.13 for ; Thu, 24 Feb 2022 22:46:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=zk9ju3IwH90PgmNQ/LV04l8j72tFlZyGQOmOzfhIN8Y=; b=DNbvqQi3bNkqD6OmYy6vwEwPxOOenY2ZwlWsXadaqpdZPrtlkh4UVpZbAGRrdWZS6E E2SCDcxIAdfAdZFE5wUTILR+yMWQzUPod1ndTJDBiQzxUeH/g4mDxZUxSReEYkevNLnY 9PY1MuWtEZHPa9kaxPfnrfrJ5aFWWBm1tcbfftImjCWfuArxgopTI5GvP9BVQoQX6uSe PwrqXfYopkBX000+olDcW6aQIbeUhkRZveE84FOOGp087xzeirAMu6NMEGBRkA1AeMOH XgIT3RAud3r+vWm9RmxKLjKWyd45AxthZCtACzB0Zvv3KjA30vwOHfVZ9SoZVlt6OdHG wg0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=zk9ju3IwH90PgmNQ/LV04l8j72tFlZyGQOmOzfhIN8Y=; b=HRjyrmZtR4pUBgyjqRwwogT9P5Hpt5S5fBgVz07XweMZZXQAqqFxVOQWK6brfzH47s IEtVJZSAc1HfhvS//t4DCy75ut4EDaQN9PiwgOdIV20MjRNUB0d6RXOkCjm6T2/I1orv 7jWszXfaHuLXIDsxW/82Nvj5WhWysxCfzZkOIk7vugW9/lHSjsGlnxlhHnXnx1W1Ruej EkpgGm9nsc/lNangRnBCDTOqW+pSk4GUSbTqyTVBRFya+l9me7vLdEEQSfHjn2aIeZ5f rcVEU+BxI62ngnfbycu693CEsexf4obRS2ni1AgW/9mkPlLVZSMYL1H6mwIw+z1a0J7X y8JQ== X-Gm-Message-State: AOAM533fu6ce68LmHu/i3w1ecwk9Sl/Umx+O7bEYKtcDkBsLiP+khcnk /8MFyGrknp+RmK5PnFgyQ07/jA== X-Received: by 2002:a63:fb44:0:b0:372:9ec8:745a with SMTP id w4-20020a63fb44000000b003729ec8745amr5083383pgj.551.1645771581797; Thu, 24 Feb 2022 22:46:21 -0800 (PST) Received: from [10.94.58.189] ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id lr11-20020a17090b4b8b00b001bc4098fa78sm1270055pjb.24.2022.02.24.22.46.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Feb 2022 22:46:21 -0800 (PST) Message-ID: <9fe00f72-4e2e-38ff-d64a-4ae41e683316@bytedance.com> Date: Fri, 25 Feb 2022 14:46:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [RFC PATCH 0/5] introduce sched-idle balancing Content-Language: en-US To: Peter Zijlstra Cc: Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Steven Rostedt , Vincent Guittot , linux-kernel@vger.kernel.org References: <20220217154403.6497-1-wuyun.abel@bytedance.com> From: Abel Wu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 2/24/22 11:20 PM, Peter Zijlstra Wrote: > On Thu, Feb 17, 2022 at 11:43:56PM +0800, Abel Wu wrote: >> Current load balancing is mainly based on cpu capacity >> and task util, which makes sense in the POV of overall >> throughput. While there still might be some improvement >> can be done by reducing number of overloaded cfs rqs if >> sched-idle or idle rq exists. > > I'm much confused, there is an explicit new-idle balancer and a periodic > idle balancer already there. The two balancers are triggered on the rqs that have no tasks on them, and load_balance() seems don't show a preference for non-idle tasks so there might be possibility that only idle tasks are pulled during load balance while overloaded rqs (rq->cfs.h_nr_running > 1) exist. As a result the normal tasks, mostly latency-critical ones in our case, on that overloaded rq still suffer waiting for each other. I observed this through perf sched. IOW the main difference from the POV of load_balance() between the latency-critical tasks and the idle ones is load. The sched-idle balancer is triggered on the sched-idle rqs periodically and the newly-idle ones. It does a 'fast' pull of non-idle tasks from the overloaded rqs to the sched-idle/idle ones to let the non-idle tasks make full use of cpu resources. The sched-idle balancer only focuses on non-idle tasks' performance, so it can introduce overall load imbalance, and that's why I put it before load_balance(). Best Regards, Abel