Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4112718imw; Tue, 12 Jul 2022 01:57:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sNJl+cjDeoIibigbUPJHchakXZaPWfzS22pL4J7LCBWjMsbmoj621lOW3dp2q2YdeFYS5N X-Received: by 2002:a17:902:b78c:b0:16b:f943:ae98 with SMTP id e12-20020a170902b78c00b0016bf943ae98mr23259873pls.102.1657616256901; Tue, 12 Jul 2022 01:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657616256; cv=none; d=google.com; s=arc-20160816; b=mKDNcgm9l/2zfTymgLLmOkqwbb31+XVrn7ULoTd79j5MBW0bWm3YOhQsWpmfNHovJa ModyrjLknoZEczni+eIYstxXV7vczwRFOq6np+XI25SMYniRcvz5fttzXYRuqwdgTdHY GBlKzHHJSJ5GcP+9JILh9FreYs4JAZ6ZQqPoDJWYeJ820ckKwms2+zdZF+lGuw5PTbqi pnj+DB80M7jrV6msDLkOQKOU9Qhi7XR2n3Azy1IJBDr7lcMvTr0Liw0H3h+f7CW+eIUp 5g3oLV+ad3zmIxA4F/vVzJELRy8ap/O+Zj04qehXThhKVM48PCGIkWthA3xPNtH4fIs1 RIig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9lB01uOqkHsSTj1k0Qc0PPFlLmv1AdfQPVQEj5smHQY=; b=SRcaNjGiF887T5e7k/q8AWvvDWlABrUlYgaVtYF4l8uhal2tnFSw0tUMUbD5jkJWoH N3MJeCVhbkYzr5d6suOaRGoECll8UUCHafzm73KDxyc53+1uz7Y77bH3f7Azq5Vl10W2 TJqL5bncv1+3My7dFMNaZsdQ3dPukslClOlF5weIYJIEQb2e3QgsEkDrRGVBt+NfXTNA YzcxwjRf4fuZy9G+yfQZP4KWHMfiaxf49cOFrJ4VZ7HQWSNOOvhvfgRFmDz7G6BSl/ou 7WW4OnrcB3XYtMH4NYTjaj4UIC+dzJh8ckU7YE+lKSXtb212WHybVbw0zI+kYSNjC2aL cQmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=aUeQeiOM; 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 nh11-20020a17090b364b00b001debd181bb9si11220187pjb.138.2022.07.12.01.57.24; Tue, 12 Jul 2022 01:57:36 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=aUeQeiOM; 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 S232630AbiGLIWi (ORCPT + 99 others); Tue, 12 Jul 2022 04:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232712AbiGLIWH (ORCPT ); Tue, 12 Jul 2022 04:22:07 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27899A2E55 for ; Tue, 12 Jul 2022 01:21:32 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id o18so6911627pgu.9 for ; Tue, 12 Jul 2022 01:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9lB01uOqkHsSTj1k0Qc0PPFlLmv1AdfQPVQEj5smHQY=; b=aUeQeiOM9gP+inZESDjpYXky41b/FYuMawY7u01ip7ODzNTdV/t/vaE7YQ+se4eEWj EDmjLVcymmkJyeBpBJXNliBohJnftQO8AVgwK89XlIIke+liNhlV2KwMQHPN6RLBO4tI vq0IRzUE8p1dEMY9Ikok5YFnl6acVkb8v3B2/+4DVSMWeaeTu34VvClXfmv6rvtyuBA6 9zoHjSoydFBvkGiyXvkCNQEzYFzmpjCKgf3E0sDrD5gIIjfRAUSQRAAZyPrdxu5Ca6We 7i6fSNvEkdrOWjkcwtx9MDv55Oe0oxgktnn1Z382Uvoanm809EfiwlGzwFp6JpZ9UTWe 81sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9lB01uOqkHsSTj1k0Qc0PPFlLmv1AdfQPVQEj5smHQY=; b=NbcVO4Yqw60T5Da1ZqGyMF6ovJ3IPKjrdD9KJ/59xDpIdjOjX1hbQMJLqAGRbd40z2 r0J76DC83SaAClgJ7uk1H06nypG0HccQsisFKAeFtZkY3m/I6kG+Q1qWf/HLzSYXvQfT KGnkQkaNtgRNr+NbK5epOxNuiUjcGgoIsZEJkJ5DU5fi4uF4/yK05Uat7GFA8g/KOVtJ SZhaSlP74SQEx5bJf7VN4oCXcFvZVnrumC4jaNGhYOJd8zLclo67ycWcPrMPj2JpuvGl AHdniz/hSdIw3Oti8PnGdktHsXolKoeVdcruSZYPvc4ZVhofBezsfUNOQnwNSXzeM0GW pj9g== X-Gm-Message-State: AJIora/rbKDRshscY/0LmTMvp5SICoSZLLh+QIcnojcn6UO0pmb4puGG 03gNMH+bBMFHDeuz+RtUoH5xYw== X-Received: by 2002:a05:6a00:993:b0:52a:dd93:f02d with SMTP id u19-20020a056a00099300b0052add93f02dmr5122263pfg.12.1657614091466; Tue, 12 Jul 2022 01:21:31 -0700 (PDT) Received: from C02DV8HUMD6R.bytedance.net ([139.177.225.234]) by smtp.gmail.com with ESMTPSA id s13-20020aa78bcd000000b0050dc762816dsm6114428pfd.71.2022.07.12.01.21.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jul 2022 01:21:31 -0700 (PDT) From: Abel Wu To: Peter Zijlstra , Mel Gorman , Vincent Guittot Cc: Josh Don , Chen Yu , linux-kernel@vger.kernel.org, Abel Wu Subject: [PATCH 5/5] sched/fair: remove useless check in select_idle_core Date: Tue, 12 Jul 2022 16:20:36 +0800 Message-Id: <20220712082036.5130-6-wuyun.abel@bytedance.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220712082036.5130-1-wuyun.abel@bytedance.com> References: <20220712082036.5130-1-wuyun.abel@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 The function only gets called when sds->has_idle_cores is true which can be possible only when sched_smt_present is enabled. This change also aligns select_idle_core with select_idle_smt that the caller do the check if necessary. 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 e4cf000604fc..7c47621ccd40 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6310,9 +6310,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); - for_each_cpu(cpu, cpu_smt_mask(core)) { if (!available_idle_cpu(cpu)) { idle = false; -- 2.31.1