Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp722845pxm; Fri, 25 Feb 2022 18:20:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7NT0ZDCw16HzQBhXI6J2q+G4eYXto759aXrKpeDZ6jFyrK96l3BAxugHEW7ZSRLi3ZBDx X-Received: by 2002:a17:902:f693:b0:14f:da72:3acc with SMTP id l19-20020a170902f69300b0014fda723accmr10000053plg.15.1645842039783; Fri, 25 Feb 2022 18:20:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645842039; cv=none; d=google.com; s=arc-20160816; b=kJpDS7ZGMAp96UOEPSY0MGgLNAgHrPmyGNpjrdcwgpyGevY2piTw9lc047L9WI6NMA YmouawZY8H5fLyOHT3AFNbN7l8VML0QR1BuCLQp3YQ8UgU2LwFbvZq05ieCJy8bZD7Zb Rg6wsxffaRr8hG4tALiF2uhEDZdQUMFVG2/fmJLBOIaWHWVS+kuj1oiTcl/zyS+2A+VN 4xvaDgHb0Ar+BFd0iI72UVhk3CHbylSOnbAywJJ58oe3fqadQ+58vakZla4ivgoBt76L YrSoygELE2Vbvy+qEMIrI+AcSAsGYet4vnv85aEhwR1fdbKTYheVw0utXd29hgWvIJK1 y8HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QlHbAj9RrieryzK6X4dfpMcrboYIb/l+Y5vjOM0ABOE=; b=o5LMLUCrumTl0mL35hh9tV4EPPi/OeazIcdCRdAosoyc1ku5UJmCLKO71H4/t00iyj /qk0D9suFeHsaUMJfWgbDTxTHUF1HNLggXkjgNTCYnnczvHf2W09l8j3j3cCthf8N6FK 0u9ZtD3uLJxdxQ2IU61xhukh0pgc+j1qcUuHkDmnWjkE12GC6/LDRCFcoFpUYinvD8Hn CE7eAXXJZmn9UeqRzwNT6iTDWJ7esS+xGhXJx756bhStj+na8P7waMBLK8xsXcMUxwWy Ab97+T1ILmB4lg5lO60XGaZGJg4x1qlCVD8B8LKAHi4FIvStWgJ0IVzKyX/j2DuRXoRk VlcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yaF6E6EG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j7-20020a170903028700b001513a3bfea2si2389948plr.292.2022.02.25.18.20.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 18:20:39 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yaF6E6EG; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5463540919; Fri, 25 Feb 2022 17:52:28 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232003AbiBYNPv (ORCPT + 99 others); Fri, 25 Feb 2022 08:15:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231822AbiBYNPu (ORCPT ); Fri, 25 Feb 2022 08:15:50 -0500 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 649C41F983C for ; Fri, 25 Feb 2022 05:15:17 -0800 (PST) Received: by mail-lj1-x231.google.com with SMTP id r20so7405770ljj.1 for ; Fri, 25 Feb 2022 05:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QlHbAj9RrieryzK6X4dfpMcrboYIb/l+Y5vjOM0ABOE=; b=yaF6E6EGqUddMLTCj4JN8VxQJsH3Z6y6vCtUvxANVE224r5SedlOVPKrPRVw92s01b GSu79T/ENkP5XLcN8n7syXBdFIaSJUbZoIxf6Z9xIT/pZjo/72bIsQoPEzr30yIMo7/U EtCK1DZzstm6wmRdhk1ZSfV/q0p/2ioosWyolzI80P1WRlRKffgbLduhJ3QnE422k7w6 VRckoWmWdkaCOghfs0bsKSq8HcEMyW44+AOwXTEcJH/mL9CcaDm81vOONOP6Z65H/6os vWHrsVRYj3XxJkmDmuK134tXL/i7Vf6koOQxSUccOWPIpvL1s0gSYuYw3XrJqc++Qw/o 8jfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QlHbAj9RrieryzK6X4dfpMcrboYIb/l+Y5vjOM0ABOE=; b=K29peIgnXFYCSW6OttSZY+mJo/n/f2typ23C4Z8Kr+Nu3c4eJlQKnRfDXZsKib0VQp SGCdF6/DsBKwkrHxWXuJVOEix4OElpo9LL7WSgfMX8ltGiu14iyezETzEgvrZzFjBQbD wOn+4b0YypAIa2WGqvbCmfFbhCSnbqHper9g/y1I2WtgFO+WhKsD6YjJxjYgZlLlU5ro UDIRYa6ZK4EyHYoYTnELshQOobe6USi90f1CenrAnb1wEsRyHZZFMLYPvf1+x0M4uOXd nYaHZY4MQozYjLj7YoQQf9t+PC7A/Eg7xfEoOPHT6Vmb0GnuekGXTGdu6uMiqE9y8wPp XZyw== X-Gm-Message-State: AOAM531RAzoLwAV8ufIU8IBYYElQ0ct0he84V2ynUydMqcdHp5v+Mgjn oTByhZ2TA+6Hm3W7J4ZVqiGITN38keSrxK3QZGG0Zw== X-Received: by 2002:a05:651c:32d:b0:246:1293:854e with SMTP id b13-20020a05651c032d00b002461293854emr5391704ljp.365.1645794915674; Fri, 25 Feb 2022 05:15:15 -0800 (PST) MIME-Version: 1.0 References: <20220217154403.6497-1-wuyun.abel@bytedance.com> <9fe00f72-4e2e-38ff-d64a-4ae41e683316@bytedance.com> In-Reply-To: From: Vincent Guittot Date: Fri, 25 Feb 2022 14:15:04 +0100 Message-ID: Subject: Re: [RFC PATCH 0/5] introduce sched-idle balancing To: Abel Wu Cc: Peter Zijlstra , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Ingo Molnar , Juri Lelli , Mel Gorman , Steven Rostedt , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Fri, 25 Feb 2022 at 11:46, Abel Wu wrote: > > On 2/25/22 4:29 PM, Vincent Guittot Wrote: > > On Fri, 25 Feb 2022 at 07:46, Abel Wu wrote: > >> > >> 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 > > > > The load balance will happen at the idle pace if a sched_idle task is > > running on the cpu so you will have an ILB on each cpu that run a > > sched-idle task > > I'm afraid I don't quite follow you, since sched-idle balancer doesn't > touch the ILB part, can you elaborate on this? Thanks. I was referring to your sentence " The two balancers are triggered on the rqs that have no tasks on them". When there is only sched-idle tasks on a rq, the load_balance behave like the Idle Load Balance when there is no task i.e. as often > > > > >> 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 > > > > There is a LB_MIN feature (disable by default) that filters task with > > very low load ( < 16) which includes sched-idle task which has a max > > load of 3 but we could easily change this like if !sched_idle_cpus then LB can migrate only cfs tasks otherwise can migrate sched_idle task as well. Instead of creating another side channel > > This feature might not that friendly to the situation that only > sched-idle tasks are running in the system. And this situation > can last more than half a day in our co-location systems in which > the training/batch tasks are placed under idle groups or directly > assigned to SCHED_IDLE. > > > > >> 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(). > > > > According to the very low weight of a sched-idle task, I don't expect > > much imbalance because of sched-idle tasks. But this also depends of > > the number of sched-idle task. > > > > > >> > >> Best Regards, > >> Abel