Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3478157iog; Mon, 27 Jun 2022 17:30:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sIY8xiJE0s+U1rPgstjKsyqsACElPa4I4MO+astIEJ3zZ0aO/qtT6PNms7T39+ImEiftVS X-Received: by 2002:a17:907:2bd2:b0:726:3100:7997 with SMTP id gv18-20020a1709072bd200b0072631007997mr15155320ejc.341.1656376229391; Mon, 27 Jun 2022 17:30:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656376229; cv=none; d=google.com; s=arc-20160816; b=U1dvoOdSib4Q9eqIUU/ceWbVpSsmVsL8BG1AkcMPu8kL3wfNjyiwhwhRI2xIoavjV8 ohnkUrpJza9AK6/b0sordWuGIwkU0+KKrAU5nFNpQKm9L8jEHhm4wcT08J9d2gd78MAd 4/WQ/rsNBz2pbkc1i1gjmy3nTDq/pmOQ9fPggd4stNNqL6ljR23umlJdWXtT1FPXnW9m 6wyL5MDyJi3PhLToQpwSh0y10e+Nel52WSnjSXvdDHs03OLYiL26FFMaHKHeBfz1l6ha /QAwTS+Oee/n6EOSuZ4dfvshrwd/cllUl0LJXSev12rYisetz6s7THcNNXqY1Atj3PgI FHbw== 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=kDH8nCKE+Rk+mLLCcRc/EY/phPcC3Vah5J9OCcFx0Hc=; b=WHlkZ9sgnzpCWxRTk9cRvYDBu6ekki69qs9F2o2hCBGis/Zqipa/bBClYdMGy09y8Q fZKm5buy2YMiSFci9rh9HIe1hEK0Xzf0cAC2MXO+1N9AOqX9vChVfcwiaDM4Ql4AL4w0 9eu+jb7hdRndN3YI0USpTWrLz6zv1INflHEjn/4uvRpObpMxFm5GV1XxlGtaWDCz3T3s 9rqaOkdiEPScApkUk2EoshjRz95vTG4nOv72XXYclGGAh9vfJ65Uc/bhAvWG4TOBaWL3 EEque3obExUZblOpa26o9q3/+TRxk8PyG5XA1z7q6BW7qtfdJVh/PZTOqa+rPO7NlSx6 PQNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=I2H7+Img; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a170906a08e00b007103c7570ecsi12733796ejy.188.2022.06.27.17.30.04; Mon, 27 Jun 2022 17:30:29 -0700 (PDT) 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=@google.com header.s=20210112 header.b=I2H7+Img; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242210AbiF0XnF (ORCPT + 99 others); Mon, 27 Jun 2022 19:43:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242290AbiF0XnC (ORCPT ); Mon, 27 Jun 2022 19:43:02 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E041D9 for ; Mon, 27 Jun 2022 16:43:01 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-31780ad7535so100576107b3.8 for ; Mon, 27 Jun 2022 16:43:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kDH8nCKE+Rk+mLLCcRc/EY/phPcC3Vah5J9OCcFx0Hc=; b=I2H7+Imgyei3TLEIV0b8EayiG3a6fOGNwNzhw7YUzdJsrJx5Sa+Xv5+nANIRZOzhK1 PiNsAMtuoeRxW826kqYTKzhANa8gUBX2PWFtRA/S8KrjDylzzxI2RZbd9hm+GYiOGYBP ntmm7PUaEsiIBcwR3N+5qVU3IYOP/O7ghGb3gJtKWJh+lZV+aYhfuYWaUZaGyMwiqE1K bWM6NACMYDOgLeDlqLzqFo71nOQ8Wz1MkkOtnsgiQ+9/YXq8y7rw7SHZ9ygmrkFLelKj TGVR32SR6IlTZnrcyeqdELcHrpS36icVuAhgUmrQfXXYjZlWR0/N95pZVilY+gR1Mjg2 Miig== 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=kDH8nCKE+Rk+mLLCcRc/EY/phPcC3Vah5J9OCcFx0Hc=; b=OmSGyJ7rmCsmtVgOZ6m2Mun1eTDeanry9ke5WGXnv5B71ya5N2GmqcvDJyELexjkgN QmWMJflQDJ33Gy3cE4my2SPZ9cryrJpCja+LVk3dDxy5V0Hq7TZwYL1bq93yU7fsPUcY +jPKlB97EuN94bTwqSPMdXA1ylDAfT+VQix1tdlr7y1eHTDDwK/ZSlkzZQ+ztFifHFaU y/QnOW8H0DsbFPmw/XBJ8HEGgMkovysabY36LL62lzhBUAsG4AOb8TMmPrwaLo0RzOI3 cqTQ/iFTeBwRgFsLIJaoahGxBv2bVOMtP+C2gQacHYtZ7kfZvFsSQhxu2QMXYBdtEq0w gwJA== X-Gm-Message-State: AJIora/gQAoL6JQGXd+5qTWEt2/seXNJFvNVzGl9o84jSA5t9jdsJdtZ 9EDqrjkrOJ4PWGkK8F1bnZmpMkLVW8mrjO/h58dc7A== X-Received: by 2002:a81:19ca:0:b0:31b:732c:15e9 with SMTP id 193-20020a8119ca000000b0031b732c15e9mr17210855ywz.167.1656373380221; Mon, 27 Jun 2022 16:43:00 -0700 (PDT) MIME-Version: 1.0 References: <20220619120451.95251-1-wuyun.abel@bytedance.com> <20220619120451.95251-5-wuyun.abel@bytedance.com> In-Reply-To: <20220619120451.95251-5-wuyun.abel@bytedance.com> From: Josh Don Date: Mon, 27 Jun 2022 16:42:49 -0700 Message-ID: Subject: Re: [PATCH v4 4/7] sched/fair: remove useless check in select_idle_core To: Abel Wu Cc: Peter Zijlstra , Mel Gorman , Vincent Guittot , Chen Yu , Tim Chen , K Prateek Nayak , "Gautham R . Shenoy" , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 On Sun, Jun 19, 2022 at 5:05 AM Abel Wu wrote: > > The function only gets called when sds->has_idle_cores is true which can > be possible only when sched_smt_present is enabled. > > Signed-off-by: Abel Wu > --- > kernel/sched/fair.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index aba1dad19574..1cc86e76e38e 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -6256,9 +6256,6 @@ static int select_idle_core(struct task_struct *p, int core, struct cpumask *cpu > bool idle = true; > int cpu; > > - if (!static_branch_likely(&sched_smt_present)) > - return __select_idle_cpu(core, p); > - The static branch is basically free; although you're right that we currently don't take !smt_present branch direction here, it doesn't seem harmful to leave this check in case assumptions change about when we call select_idle_core(). > for_each_cpu(cpu, cpu_smt_mask(core)) { > if (!available_idle_cpu(cpu)) { > idle = false; > -- > 2.31.1 >