Received: by 2002:a19:771d:0:0:0:0:0 with SMTP id s29csp1279303lfc; Wed, 1 Jun 2022 14:02:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPIUH0n8Wc38JLzovJiJ68uKnfCsyWS1gNM/JuuBWTC2wfH/QJbKvtegvDVjUQP9KxMdRK X-Received: by 2002:aa7:88c2:0:b0:518:dca4:5b07 with SMTP id k2-20020aa788c2000000b00518dca45b07mr40482459pff.41.1654117327148; Wed, 01 Jun 2022 14:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654117327; cv=none; d=google.com; s=arc-20160816; b=azWMesiENkkMMa9rct1T8PvLa5AkDwCwY4Ts+ul5wBYSUwVNpUXCGbDfZ1506M01tt do++hfmQ4xgHEW1bZB2/ReHVWOes7uVyabSJK34TwiRIKwhnaZ/sC046vxVQ92AnZ7Wp wy508tCYFha1CSD0bszu7RzVL6hHN8sChGPaiviBTzDbz4wYBoSSCPwVWkYJciiyVp7O k2Vn85qmlYJWkqrp7gp/877MT2AoP4zvQt8qPs1scD7kjfePoEVVpFEomPKSjWGGSS7B rW1vOEjt0DaibUepI37fnSvhQbzvacjB1NwZUQgRx1Bib09YfUBGqdK91WJe8X50bdTv USag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:reply-to:dkim-signature; bh=/3TFHPDS/Psbk4AS6KoK5nXO/Qj1s0kWFsftf23bfkE=; b=JulcLBOLXLZegdfe3xEGycErxXY7BPpF/PZ60IS1oUEDF7ASTMpMVwPwlBneaw9YAm nzZ+84tO8OI614XIwn9TpHw2L7qN34lFxhtW24MYgwQzP+DJ7BXJHMlCQVGfqKk3ykNS EUUov3ct4QFRLWxsMx2DtZTSmkqlBpW2k4aIfrvL7gHNs2cGA+lZtmHzb6SnKcIxvF0W k5E6hOEeR0iNqkFjyDZieOD9WNclTL2DXg8QY2PqP14NQCpHAAGdV635nb48OLtB6q1S igU5XC6eByKsVcOe7gv4nGOsBO4tpDn1IJah6LV0jEjS6W7QVf3/BqIqhs6MimvqfZBY VFsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=b9GpTysL; 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=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lx12-20020a17090b4b0c00b001ce45fbb2f6si8347374pjb.180.2022.06.01.14.02.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 14:02:07 -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=@redhat.com header.s=mimecast20190719 header.b=b9GpTysL; 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=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C354522C4B9; Wed, 1 Jun 2022 13:07:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349454AbiFADlG (ORCPT + 99 others); Tue, 31 May 2022 23:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240631AbiFADlB (ORCPT ); Tue, 31 May 2022 23:41:01 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 55EB99CC8E for ; Tue, 31 May 2022 20:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654054859; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/3TFHPDS/Psbk4AS6KoK5nXO/Qj1s0kWFsftf23bfkE=; b=b9GpTysLsNljVSuMvmfvudV21iW5tlVInbjtx4BIwM4u/Ervnvz5Pyr+hkIF2EnfMS9Obe FSJVxPQDXy1CBEgTimRRemWz9UyeIdzMBt1fZsmO1njr6vdOcM4dVbAnvWLF+3N2Y8S5o0 N2NL/dE4dWxoh2UMWmIGJw0Mi/UpCMc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-250-IE20Dqp_Mq6dex4EbkNGhw-1; Tue, 31 May 2022 23:40:52 -0400 X-MC-Unique: IE20Dqp_Mq6dex4EbkNGhw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2263D3C0D850; Wed, 1 Jun 2022 03:40:52 +0000 (UTC) Received: from [10.72.12.91] (ovpn-12-91.pek2.redhat.com [10.72.12.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CD10E8287E; Wed, 1 Jun 2022 03:40:46 +0000 (UTC) Reply-To: Gavin Shan Subject: Re: [PATCH v3 12/16] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found To: Sudeep Holla , linux-kernel@vger.kernel.org Cc: Atish Patra , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Rob Herring References: <20220525081416.3306043-1-sudeep.holla@arm.com> <20220525081416.3306043-2-sudeep.holla@arm.com> <20220525081416.3306043-3-sudeep.holla@arm.com> <20220525081416.3306043-4-sudeep.holla@arm.com> <20220525081416.3306043-5-sudeep.holla@arm.com> <20220525081416.3306043-6-sudeep.holla@arm.com> <20220525081416.3306043-7-sudeep.holla@arm.com> <20220525081416.3306043-8-sudeep.holla@arm.com> <20220525081416.3306043-9-sudeep.holla@arm.com> <20220525081416.3306043-10-sudeep.holla@arm.com> <20220525081416.3306043-11-sudeep.holla@arm.com> <20220525081416.3306043-12-sudeep.holla@arm.com> <20220525081416.3306043-13-sudeep.holla@arm.com> From: Gavin Shan Message-ID: <6270a109-85b8-b2d2-d32f-6e24be84448b@redhat.com> Date: Wed, 1 Jun 2022 11:40:43 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <20220525081416.3306043-13-sudeep.holla@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 5/25/22 4:14 PM, Sudeep Holla wrote: > There is no point in looping through all the CPU's physical package > identifier to check if it is valid or not once a CPU which is outside > the topology(i.e. outlier CPU) is found. > > Let us just break out of the loop early in such case. > > Signed-off-by: Sudeep Holla > --- > drivers/base/arch_topology.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > Reviewed-by: Gavin Shan > diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c > index f73a5e669e42..6ae450ca68bb 100644 > --- a/drivers/base/arch_topology.c > +++ b/drivers/base/arch_topology.c > @@ -637,8 +637,10 @@ static int __init parse_dt_topology(void) > * only mark cores described in the DT as possible. > */ > for_each_possible_cpu(cpu) > - if (cpu_topology[cpu].package_id < 0) > + if (cpu_topology[cpu].package_id < 0) { > ret = -EINVAL; > + break; > + } > > out_map: > of_node_put(map); >