Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp358157iob; Wed, 18 May 2022 03:53:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1kluJGVlDUwCXdE13He8mK4AC7wKlMApW4DfAasK+jCw/asL2WHZY5BpyRKQ18m09ldfY X-Received: by 2002:a05:6a00:ad2:b0:4f1:2734:a3d9 with SMTP id c18-20020a056a000ad200b004f12734a3d9mr27182066pfl.61.1652871205764; Wed, 18 May 2022 03:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652871205; cv=none; d=google.com; s=arc-20160816; b=Fu85NdAh7I/2JUI8puS3efexqHf5GyJlkW4vVx+F7OaFvwHa33ywiJPYX6sFLSvcwY 6WXhbqDx5psYWXycKJ2/6ydkGsol/7DKukKJXCnL9zu2m/pvMba0I5ZMgk/vjYXaYXvS Zv9yf4mxvwFz+GIQXysscghAPKKsyoUcb6oiBhwDm/ykp/NvOOxJjFMFYHqoZpL+NU+z Qs1455TwKNBc9NcGQFsxj6Bg2pPF2cb9ROJ4BFmDhn78VWBNxzBmlqI6DGGIy51tCiqO 85ZDbyIzMEJeCzGFyRHod23I0Z1/nV7ZuX3cLmZEuKSK26dlzYuUcguKLGMjc+esrrNR ZLuQ== 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=nMf2Yur0bI4Lp8FECc1AGrjLj35Sgs1jqj9KQdPf0Hc=; b=HylqQ9/9Gxam4ylDyXkJwuMMD06dF5osKGl8jweT+ygWy6M02eWj7hdUWr3uqyyRLv 9AF8p9qmFfHAVsISCRh+QlknZ1QFZzBrOCoRBT18SmoGCMmplLhwvzoUnUf8nE02M/AW hZRRnWfgYjEIvTlpkzU6zGXEj2Dz2SYsV8LtaQtS4nB86OLpRw2aPMiFAVbeW8udvBPx zutsXEwC5ydplqxJYJpmJLZKVfHtMfv/pK5ZtZyRENKmnlp21/+ZBVGmJtp7rMx3pUYy kODovD6oLRTIZK8DD+meqauO075iQ8aOlI2IvBOK1wz/MY6nkHnLL0zrOOxMqtxjZs/t i6cA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id g7-20020a63b147000000b003c23ed20448si2237378pgp.387.2022.05.18.03.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 03:53:25 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC64847050; Wed, 18 May 2022 03:44:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235192AbiERKnx (ORCPT + 99 others); Wed, 18 May 2022 06:43:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235187AbiERKnt (ORCPT ); Wed, 18 May 2022 06:43:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 497B745799 for ; Wed, 18 May 2022 03:43:48 -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 150DA23A; Wed, 18 May 2022 03:43:48 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 054583F718; Wed, 18 May 2022 03:43:46 -0700 (PDT) Date: Wed, 18 May 2022 11:43:44 +0100 From: Sudeep Holla To: Dietmar Eggemann Cc: Qing Wang , Greg Kroah-Hartman , "Rafael J . Wysocki" , Vincent Guittot , Morten Rasmussen , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] arch_topology: Use llc_id instead of package_id Message-ID: <20220518104344.wh5thzaw2zg4f6jq@bogus> References: <20220513083400.343706-1-dietmar.eggemann@arm.com> <20220513090330.z25fwthekn4rjkwq@bogus> <20220513110312.wy6g5avs7ngkmhfu@bogus> <634a4b8c-84d2-51a9-ef54-33b81683c849@arm.com> <20220516103524.35swlxp2367baxx6@bogus> <20220517105718.tvpmj2xxb2qj3bev@bogus> 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 Wed, May 18, 2022 at 12:23:35PM +0200, Dietmar Eggemann wrote: > On 17/05/2022 12:57, Sudeep Holla wrote: [...] > > Ah OK, but if LLC sibling masks are updated, cpu_coregroup_mask() takes > > care of it IIUC, right ? > > Yes. That's the: > > 691 if (cpu_topology[cpu].llc_id != -1) { > 692 if (cpumask_subset(&cpu_topology[cpu].llc_sibling, core_mask)) > 693 core_mask = &cpu_topology[cpu].llc_sibling; > 694 } > > condition in cpu_coregroup_mask(). > Correct, I am referring that. > > > > Agreed. But we are not changing any topology masks as per sched domain > > requirements as they get exposed to the userspace as is. > > I see. Your requirement is valid information under > /sys/devices/system/cpu/cpuX/{topology, cache} for userspace. > > I'm not sure that we can get core_siblings_list and package_cpus_list > correctly setup. > > With your patch we have now: > > root@juno:/sys/devices/system/cpu/cpu0/topology# cat core_siblings_list > 0-5 > root@juno:/sys/devices/system/cpu/cpu0/topology# cat package_cpus_list > 0-5 > > Before we had [0,3-5] for both. > Correct and that was pure wrong for a single socket system. It must cover all the CPUs. Tools like lscpu reports them as 2 socket system which is wrong. There were reports for that but no one really chased it up to get it fixed. So assumed it is not so important but still it is wrong. ACPI platforms cared and wanted it fixed with ACPI PPTT since the PPTT support. So check the difference without my patches on Juno in DT and ACPI boot. We should get same output for both. > > I'm afraid we can have 2 different mask here because of: > > 72 define_siblings_read_func(core_siblings, core_cpumask); > ^^^^^^^^^^^^ > 88 define_siblings_read_func(package_cpus, core_cpumask); > ^^^^^^^^^^^^ > Yes even I got confused and the Documentation revealed one is deprecated or obsolete(Documentation/ABI/stable/sysfs-devices-system-cpu) 74 What: /sys/devices/system/cpu/cpuX/topology/package_cpus 75 Description: internal kernel map of the CPUs sharing the same physical_package_id. 76 (deprecated name: "core_siblings"). 77 Values: hexadecimal bitmask. 78 79 What: /sys/devices/system/cpu/cpuX/topology/package_cpus_list 80 Description: human-readable list of CPUs sharing the same physical_package_id. 81 The format is like 0-3, 8-11, 14,17. 82 (deprecated name: "core_siblings_list") 83 Values: decimal list. > [...] > > > Understood and on Juno if we get llc_siblings right, the sched domains > > must be sorted correctly ? > > Yes, then it should do exactly what ACPI is leading us to on this !NUMA > Kunpeng920 example. > Cool. > >> Coming back to the original request (the support of Armv9 L2 complexes > >> in Android) from Qing on systems like QC SM8450: > >> > >> .---------------. > >> CPU |0 1 2 3 4 5 6 7| > >> +---------------+ > >> uarch |l l l l m m m b| (so called tri-gear: little, medium, big) > >> +---------------+ > >> L2 | | | | | | | > >> +---------------+ > >> L3 |<-- -->| > >> +---------------+ > >> |<-- cluster -->| > >> +---------------+ > >> |<-- DSU -->| > >> '---------------' > >> > >> This still wouldn't be possible. We know that Phantom Domain (grouping > >> after uarch) is not supported in mainline but heavily used in Android > >> (legacy deps). > >> > > > > Correct, unless you convince to get a suitable notion of *whatever* > > phantom domains represent into the DT bindings, they don't exist. > > If someone wants to support this config, they must first represent that > > in the firmware so that OS can infer information from the same. > > OK, we don't support Phantom domains via 1. level Cluster in cpu-map > anymore. We already explicitly informed the Android community. But I'm > sure people will only discover this if something breaks on their > platforms and they are able to detect this. > Again if it was working just by cache with their own phantom domains that are not upstream, then nothing is broken. At-least I see that we have now fixed and aligned DT with ACPI. While I understand your concern, I see this as main issue and not sched domains which may or may not be using topology info incorrectly. > >> If we say we only support L2 sharing (asymmetric here since only CPU0-3 > >> have it !!!) and we don't support Phantom then your approach will work > >> for such systems. > > > > Thanks, as I said what is *Phantom* domain ;) ? Can you point me to the > > DT or ACPI binding for the same ? Just kidding, I know they don't exist. > > They do ;-) 1. level Clusters ... but they are used for uArch > boundaries, not for LLC boundaries. That's the existing issue in DT, > topology information has 2 sources: (1) cpu-map and (2) cache info. > Sure, they can fix or add more optimisation on top of what I have sent[1] > > Anyways, I understand your concern that llc_sibling must go with my set > > of topology changes which I agree. Is that the only concern ? > > Cool. Let me review your v2 first ;-) Thanks. -- Regards, Sudeep [1] https://lore.kernel.org/lkml/20220518093325.2070336-1-sudeep.holla@arm.com