Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1046872iob; Fri, 13 May 2022 20:59:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzry5PM5sMUAW/P3KT+z7ieUMvH4cCV4E6o2oRKrBH45Qa2/tBNdue3CQCvqGJXlskEonKq X-Received: by 2002:a05:600c:48b:b0:394:2ee9:5847 with SMTP id d11-20020a05600c048b00b003942ee95847mr18312275wme.117.1652500791846; Fri, 13 May 2022 20:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652500791; cv=none; d=google.com; s=arc-20160816; b=BzF+3Xpj18S465uEenWyjj+/gnmMvql9IGIdgWd4EnQgbpoh7nUolhcPMsxP41Q7Z1 Eg6r0GzKHWMBxInzXCvC7b0fddN2nmyVfQHPhTQmRmahsTdoA5UAe6Kg9GwyVQpD7Bau S4BOytW+U6VMXk3xOnSlk6JJ1RHB05aglq8yEnqwmm5SANLKZv5JefOa62mCos2O5TIH O1yxmQBSidIW8mYgH1MFHpZnP5lckFrd53v6Urvl+XMEdBjPmXODHdU5fSEp+qClYSJX X661mnV+kN0fXPhs4L2O0xafkH4TTCiebdjnC5zIn+vL6hzHcI+pfH9pyXf72Q6VnGPY rzvw== 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=CBEzmRBLEvu1OIGGjZyKAzu7uEsgINSqgz+46jI9Iz4=; b=RkZAN3W2SUG2J3BVLgNRarektSP2JtmhP6/pydrNgt37frgZB5dC+EXalze4GTv15p b2K5gITABBrCQSG/Krn+0DZW5LCZvww5awV8HfjYszBFEVEEVHSbCeW7DrcXK4f2d9g7 iDluu/NAQo4RBistcGR/3dkbO6+GZl8aT0KvR82A+5cJTrZ50X7LMSFCQd5z2C4qtCME ZUp59HuAbDxklZV1AKILFw3+yc+t2Pkh2TxQ5tdjtYuOQSdPNDPy3PstSQWh+l9tCQkP ZtS7TEaVD3TfoVnkidpaF4cH1mmBu6JrMQ4lzz5qHLt2WJYAMJzul5V5qhlxJ9dO9ISY RDcA== 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 m14-20020a056000024e00b0020ad72e36d7si3413039wrz.103.2022.05.13.20.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:59:51 -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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B521C49F5EE; Fri, 13 May 2022 17:31:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379519AbiEMLDb (ORCPT + 99 others); Fri, 13 May 2022 07:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350219AbiEMLDW (ORCPT ); Fri, 13 May 2022 07:03:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 321AF2A1FF2 for ; Fri, 13 May 2022 04:03:21 -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 0B47B143D; Fri, 13 May 2022 04:03:21 -0700 (PDT) Received: from bogus (unknown [10.57.65.38]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E60B33F5A1; Fri, 13 May 2022 04:03:18 -0700 (PDT) Date: Fri, 13 May 2022 12:03:12 +0100 From: Sudeep Holla To: Dietmar Eggemann Cc: Qing Wang , Greg Kroah-Hartman , "Rafael J . Wysocki" , Sudeep Holla , Vincent Guittot , Morten Rasmussen , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] arch_topology: Use llc_id instead of package_id Message-ID: <20220513110312.wy6g5avs7ngkmhfu@bogus> References: <20220513083400.343706-1-dietmar.eggemann@arm.com> <20220513090330.z25fwthekn4rjkwq@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 Fri, May 13, 2022 at 12:42:00PM +0200, Dietmar Eggemann wrote: > On 13/05/2022 11:03, Sudeep Holla wrote: > > On Fri, May 13, 2022 at 10:34:00AM +0200, Dietmar Eggemann wrote: > > [...] > > >> @@ -527,7 +528,8 @@ static int __init parse_core(struct device_node *core, int package_id, > >> return -EINVAL; > >> } > >> > >> - cpu_topology[cpu].package_id = package_id; > >> + cpu_topology[cpu].package_id = 0; > > > > While the above looks good and matches with what I am attempting to do > > as well ... > > > >> + cpu_topology[cpu].llc_id = llc_id; > > > > This looks wrong for simple reason that this is derived incorrectly from > > the cpu-map while there is no guarantee that it matches the last level > > cache ID on the system as we didn't parse the cache topology for this. > > So I disagree with this change as it might conflict with the actual and > > correct llc_id. > > It might not match the LLC, that's true. Something we have already today > in Android for DynamIQ clusters with big/Little. People using 1. level > clusters to group CPUs according to uArch. Not sure if that is the correct representation of h/w cluster on those platforms, but if they want to misguide OS with the f/w(DT in this case) well that's their choice. The main point is we need to get the exact h/w topology information and then we can decide how to present the below masks as required by the scheduler for its sched domains. > My point is we manage to get: > > SMT - cpu_smt_mask() > CLS - cpu_clustergroup_mask() > MC - cpu_coregroup_mask() > DIE - cpu_cpu_mask() > > covered in ACPI with the cpu_topology[] structure and if we want CLS on > DT we have to save cluster_id for the 2. level (DT) cluster. > I am not sure on the above point. Even with ACPI PPTT we are just setting cluster_id based on first or leaf level of the clusters ignoring the nesting ATM. And that's exactly what I am trying to get with this series[1] > And that's why I proposed to (ab)use llc_id to form the MC mask. > Sure, it is already supported IIUC by cpu_coregroup_mask in arch_topology.c We just need to make sure llc_id is set correctly in case of DT. Now if you are saying llc_sibling is not what you need but something else, then we may need to add that new mask and update cpu_coregroup_mask to choose that based on certain condition which I believe is bit complicated. > I'm not currently aware of another solution to get CLS somehow elegantly > into a DT system. Will grouping of CPUs into cluster they belong not good enough for CLS ? I thought that should suffice based on what we have in cpu_clustergroup_mask (i.e. cluster sibling mask) -- Regards, Sudeep