Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp62310pxw; Fri, 8 Apr 2022 00:43:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywCTysYDqm91W1kF8FsGyJ4g9+kVg9ITVFOTkbS/qgJikpEVDgxLIkAt2HKt3x6HvpT6Ba X-Received: by 2002:a17:902:f550:b0:158:2835:52dc with SMTP id h16-20020a170902f55000b00158283552dcmr401065plf.2.1649403819826; Fri, 08 Apr 2022 00:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649403819; cv=none; d=google.com; s=arc-20160816; b=uZPqpFEFOVcd7/xNO3hGledhKWdI/147WWvxI6CCkMNMT1oiL9f3FwXKnQ7gGyJ3lI 1d5MD4qckYP5L6xRlSaLUhfIka5rTFlncHmNHnU5cash0Ot56THAR1IS8hYHmU1X9yRh eueGGc9VO/k2000uxa3SNeH4N5CyF4l3j7oPslxxv0AU6F8glxd2Eg55mv3MKdyFBsCO koYAVyNygm05CcvTf5F/RkQQP7Kct3Yo/EZk4nqMt9+iIkbDDSD+UCHIaOKS6hf9A52Q kj7666TEcYoia6j8xfrwOlL1sGjl84Zo9y+Sotb59o8nlMm7tc/fq8/y0loMFkSWbIy8 qXzA== 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=WnXHR5gRI6b51YG8ylhL5jPW3yJr07fqNZU/XZSig0k=; b=efmmaAIWMWHLwystnKvAPZvs/CjSkhNRD1oPlsoqzzxwB5EYH7yIXgPikhxa0TcZXA qvsqG7vTd3SmKpBhLATBz4hQnCg5Vpz8SfK9aFF6X14ge2qfY/9Q5Us2LGYx2kOuxXuU S1W6wVitN4Nyyal6SoTXnd4eOf1gJo5r1ZHBkNqcLnTEl7HiYelHxncoLNlzezOWu4HV xx3kGmnNdxfoceyJGztGwmbwbt9SkvrTb/tqlFlhd9/6geXqKrP2YXT8p46/bHyuf2Pi Jp9q7IdLwr1viYlX6d2nTc63BzCYKdMIDaVM9F+Xme9j+MFGw7gZ2bcWs16Fmt2ESJdV rSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAcufFck; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w189-20020a6382c6000000b003816043ee23si556504pgd.24.2022.04.08.00.43.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 00:43:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAcufFck; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 E547121D06F; Fri, 8 Apr 2022 00:17:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229454AbiDHHTS (ORCPT + 99 others); Fri, 8 Apr 2022 03:19:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbiDHHTN (ORCPT ); Fri, 8 Apr 2022 03:19:13 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEC823B030 for ; Fri, 8 Apr 2022 00:17:10 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-2e5e9025c20so86129877b3.7 for ; Fri, 08 Apr 2022 00:17:10 -0700 (PDT) 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=WnXHR5gRI6b51YG8ylhL5jPW3yJr07fqNZU/XZSig0k=; b=AAcufFck/yBeQrNDVHVsf6MMXMwxY/5jmF3Dbk5qpkEevFCsvQ0Rnx1Na0EgbHbSUc JkF3Kuxtsyw7el5+5FmrRG8MRzoOQRIgXOkIX9wbfxwldbd5/fofZ3qJOtq5Bvf+rUcj pyA9S1Uwz8r+Xs2IrAbQTlRWIKm48N30FEYHDVr0Ffi1tAW6OCZI0VmKNV+kVIbltH+v N9jNUtwFkn5P+f9YbgUH6LAeJ9R+UqzccxI9r97GuomTEMkbEzUqODWr9IzqaoWRpShG JhLiSh9CLZ2lJAKWYhN+sBzvoQt+KqDIgBpNoh+qenG9R5TKfzfy/QB6LfyTjxrKTFIf OlGg== 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=WnXHR5gRI6b51YG8ylhL5jPW3yJr07fqNZU/XZSig0k=; b=pYr2jcqHEzY78NGit1VN0Qs3jlHMeGP8B986ch1GBnsB+7WNbY7MDVgw9xgT83RmYV xFkJ4Ijv7baWTvC2Ydy0JNvXNx9n2Jtw7F65xXfiVItcrc0zpupV61JnWhpTanjA6WDS xD7aDXsbw2RBp04VbZH5ESPrSxCycpbN3U04C3ecesaZA1p68hGjHZ+5LVB9fh41j4+Q eeHnms7O15qIcIk4JkUHRcN73Az5tcfUrqstcVQuhtJCeSk5OoEVH3i/b1U7gbyAYl/d 0BdpKIIKrU2Hid/wVcLZpbb1GZfzWgTRtV7jrlDvpSTHFJouvUuEQgNHfrq/BFCuy2az wyiQ== X-Gm-Message-State: AOAM531418ies+ldYhxVm1qNRsdbryc0DRdo+4VINlyGD325QTckzSS8 jH6Bt4+BwNc4P4R8nLcgva5ZXvaZwau4bATq4MNn4A== X-Received: by 2002:a81:1985:0:b0:2eb:6021:12c4 with SMTP id 127-20020a811985000000b002eb602112c4mr14872505ywz.248.1649402229982; Fri, 08 Apr 2022 00:17:09 -0700 (PDT) MIME-Version: 1.0 References: <20220407021729.16655-1-zhouchengming@bytedance.com> <20220407021729.16655-2-zhouchengming@bytedance.com> In-Reply-To: From: Vincent Guittot Date: Fri, 8 Apr 2022 09:16:58 +0200 Message-ID: Subject: Re: [PATCH 2/2] sched/fair: Delete useless condition in tg_unthrottle_up() To: Benjamin Segall Cc: Chengming Zhou , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com, songmuchun@bytedance.com 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, URIBL_BLOCKED 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 Thu, 7 Apr 2022 at 23:00, Benjamin Segall wrote: > > Chengming Zhou writes: > > > Fully decayed cfs_rq is impossible to have queued entities, > > the first condition "!cfs_rq_is_decayed(cfs_rq)" is enough > > to cover. > > In particular, cfs_rq->load.weight is part of cfs_rq_is_decayed. Testing cfs_rq->load.weight is the key point because nothing prevent to add a task with null load Reviewed-by: Vincent Guittot > > Reviewed-by: Ben Segall > > > > > Signed-off-by: Chengming Zhou > > --- > > kernel/sched/fair.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > > index e6fa5d1141b4..17c13c38b1c2 100644 > > --- a/kernel/sched/fair.c > > +++ b/kernel/sched/fair.c > > @@ -4850,7 +4850,7 @@ static int tg_unthrottle_up(struct task_group *tg, void *data) > > cfs_rq->throttled_clock_task; > > > > /* Add cfs_rq with load or one or more already running entities to the list */ > > - if (!cfs_rq_is_decayed(cfs_rq) || cfs_rq->nr_running) > > + if (!cfs_rq_is_decayed(cfs_rq)) > > list_add_leaf_cfs_rq(cfs_rq); > > }