Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp39183lfv; Tue, 12 Apr 2022 16:22:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/ZHgZpo8ucguRAUh7zW3dDDkSOsAMO3w1xbggecFFwmWXHi/wjWrYw3iMRxniYwWeEogE X-Received: by 2002:a63:b14:0:b0:399:26d9:98d8 with SMTP id 20-20020a630b14000000b0039926d998d8mr32981234pgl.263.1649805722796; Tue, 12 Apr 2022 16:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649805722; cv=none; d=google.com; s=arc-20160816; b=VNO81Zte9UKV704aprrWTirc8O3BtZopcgxx/ChI0FX18f2Lpw3eGZzatdqMrF9BCx v4iYmyKBzytw8/5mLW0fddgkKV0K099UXNJdFnHHssyr/yXKofIZxlRWGzZaXtBe3NKP IQBeG0PsKbhPGGOVQ9bQSFBpHWFBcPTijL6AU54hxnoRiNhYq5BUGup4YHGlMdMafnMN kGGoCL2aYt6KpDUzu3Ge7/8aFxwOCGsij9DbDBZWlp9yrZ7VBtiXAB9jMhyqyQQyYwiD lKgHSWQY5b+JePMUG3TVZsrl6TUn6h0T0pjC6+BeiKqiS/63bKWXDA2UphYykXwiHt1N Aw+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=voS36mcsfs8H05ZFockhHxVuf7ePvEkU4r/oyTnCKMY=; b=n7M1eA0U0etuh32h5ZBH1exyD8qcCxMK7hkVyM6jde8+zKDoijZY2YRw0/ugZcZ0aA 46+vXbXK+otRE6YGrelntnrkgYRrHjyId1XfRL89xB4czTLulsfu8WOM1f65odxYgTIN qJgD+kSfkbGFm8B8wcy4F28k1Ik0y41vv9grBS4VFVWsxMOAPAKoODTFYOoDRQKmq0zM R+ktPd+YGawI9it2FsQ8nui3J6CrJkt5g0JXu3Z1hQkF6l/Im3Qa98JoPogleauhIucj L7oOG7IuCph7nMlawKchuepPdUfT4tY72KkLaZ2X+kAf4HZmzv1pqFvFMwjkuZmquNpl sYHA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j7-20020a056a00174700b004faa8ee4f05si13911945pfc.98.2022.04.12.16.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:22:02 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2DD8EA8ECF; Tue, 12 Apr 2022 14:13:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347346AbiDLKSO (ORCPT + 99 others); Tue, 12 Apr 2022 06:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356814AbiDLJzS (ORCPT ); Tue, 12 Apr 2022 05:55:18 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8B4ED11C08 for ; Tue, 12 Apr 2022 01:58:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9DAED1570; Tue, 12 Apr 2022 01:58:43 -0700 (PDT) Received: from bogus (unknown [10.57.41.152]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4EF7A3F5A1; Tue, 12 Apr 2022 01:58:42 -0700 (PDT) Date: Tue, 12 Apr 2022 09:58:39 +0100 From: Sudeep Holla To: Andy Shevchenko Cc: Qing Wang , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Linux Kernel Mailing List Subject: Re: [PATCH] arch_topology: Do not set llc_sibling if llc_id is invalid Message-ID: <20220412085839.hkpyookqdl6bcjbn@bogus> References: <1649644580-54626-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 Mon, Apr 11, 2022 at 06:07:45PM +0300, Andy Shevchenko wrote: > On Mon, Apr 11, 2022 at 12:10 PM Qing Wang wrote: > > > > From: Wang Qing > > > > When ACPI is not enabled, cpuid_topo->llc_id = cpu_topo->llc_id = -1, which > > will set llc_sibling 0xff(...), this is misleading. > > Shouldn't it be a Fixes tag then? > I thought about that. One the file has moved and lot of refactoring before the move after the code was first introduced. Since no one has seen any issues as the mask matches all the CPUs on a single chip SoC and this is not user visible, I didn't push for the fixes tag. Anyways the original commit introducing the feature is Commit 37c3ec2d810f ("arm64: topology: divorce MC scheduling domain from core_siblings") which was merged in v4.18 if I read git log correctly. I am happy to backport if needed. > > Don't set llc_sibling(default 0) if we don't know the cache topology. > > ... > > > - if (cpuid_topo->llc_id == cpu_topo->llc_id) { > > + if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { > > I'm wondering if more strict check is better here, i.e. > > if (cpu_topo->llc_id >= 0 && cpuid_topo->llc_id == > cpu_topo->llc_id) { > Yes I would agree. But I think Qing is just following other similar checks in the file. All such ids are initialised to -1 and are assigned only valid values >= 0. I am OK to keep it as is to keep it aligned with other similar checks. -- Regards, Sudeep