Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp768278pxp; Fri, 11 Mar 2022 14:36:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJydtcmqhgU13cw2yb/mpO9z0HynI5dcJJ3Lq+rDFoow/XfagBfKVZQaEIFK+357LA0sLqaG X-Received: by 2002:a17:90b:4a92:b0:1bf:2a03:987c with SMTP id lp18-20020a17090b4a9200b001bf2a03987cmr12823895pjb.186.1647038214278; Fri, 11 Mar 2022 14:36:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647038214; cv=none; d=google.com; s=arc-20160816; b=EQXF4fQpR2w3sB8jyJL8YN/i28tJ1ZC0bnxLlM81tjnEsAS+U2BqyAHqKEulJGyHCG tX22xiknslDFaH3xl5UBcJsi2GtA1XdDMegGh4rn/1Ph1oQ4NN1pt5Z0wyRlmitVySoR tV1hCYyvoxi9+IMetJHkuJ9SlPzKs+HY/66hYTuwq0kkwQyUzdhrA0L9ysTiJqUpwl5T xp3xPpv0AugyxMvpncXLI+XZ3v0Cl2X3gv+3L8nky8XVWXisSmj8nX7n/cKqhTCougdh GbJR/MENk/G9RYdzUE1qONrfFOPwC//KBMsRQ40vSKcoxWwdaqtbFcxPykf6kesj0Tgj jeAQ== 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:dkim-signature; bh=vZE/E1yBtweQiBf4QxRUsUJDn0xX2Xkh/fwqViDIbpI=; b=eyFHI2W9WGlNLeEVagKnbNp5aROFENdG6sHxcNMXWooHflBEvobTVTdfLZ2ylt8Q+M m9GQpa3jbFOhWjprvO/LHc1TRQ5tFVbEcRRTkkfM4P8zS15whs3JnSTKCnkAM9+C4Ptk IWfMDX2cjaOamanEygylq8yw+C3AqT7MDRdouFywlCgys5lyZsfXXUjYQ7g8AvxsEpwl hiuK1sz5cBOQVEUkgdYVxu7CMaEOF5mLY9d6DxRA+Fwl7+c3qujWSZ666n+BaOQWaj1d Nlh86Oqfc8w84TovKwBcLWJhggvwyhoyEgH1duYHgC+hk3vTB9ibChew/FFKAgUcnKbF rtWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Av4soCHN; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a70-20020a639049000000b00380dcee5f35si5747797pge.199.2022.03.11.14.36.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:36:54 -0800 (PST) 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=@infradead.org header.s=desiato.20200630 header.b=Av4soCHN; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BB8D624FE54; Fri, 11 Mar 2022 13:42:20 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348200AbiCKL0Y (ORCPT + 99 others); Fri, 11 Mar 2022 06:26:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbiCKL0X (ORCPT ); Fri, 11 Mar 2022 06:26:23 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF36FD30 for ; Fri, 11 Mar 2022 03:25:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vZE/E1yBtweQiBf4QxRUsUJDn0xX2Xkh/fwqViDIbpI=; b=Av4soCHNkoKtyXt0Z3LEdsRAMP yXb+QGl7U3nz8nVP8zK9a4Jnd4CSf5TDrlASKTvWJuSSddWB/mXTxDa5WacCsiMjreVbdJE8/ZRvu QjyG28IeentB/04NBMCn1PwV8aO4am2cua8jHb/rxAloUBukMuPssudFU6dZWQRLZiff8xoG8lad5 O24CCz/aVUx66GSwLjYg7xhaLJSvHDO2/nID7EA3V5o+XnAY1bJ18mejQ2HSIFaiAojKMJ13XZAIY JZHhwNvpGTIxI1iA6FFFQzkRFI/txOOoF8Rc1Pojh3KrcdbCbr7NmwwHXwfUdQHBF3nZJL3a4qOZU uUTPXcbw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSdOA-00HQPJ-2t; Fri, 11 Mar 2022 11:24:54 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 165EE3001C0; Fri, 11 Mar 2022 12:24:51 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BCA812C5BAC25; Fri, 11 Mar 2022 12:24:51 +0100 (CET) Date: Fri, 11 Mar 2022 12:24:51 +0100 From: Peter Zijlstra To: Qing Wang Cc: Catalin Marinas , Will Deacon , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched: topology: make cache topology separate from cpu topology Message-ID: References: <1646917125-20038-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1646917125-20038-1-git-send-email-wangqing@vivo.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 Thu, Mar 10, 2022 at 04:58:44AM -0800, Qing Wang wrote: > From: Wang Qing > > Some architectures(e.g. ARM64), caches are implemented below: > cluster: ****** cluster 0 ***** ****** cluster 1 ***** > core: 0 1 2 3 4 5 6 7 > cache(Leveln): **cache0** **cache1** **cache2** **cache3** > sd_llc_id(current): 0 0 0 0 4 4 4 4 > sd_llc_id(should be): 0 0 2 2 4 4 6 6 > > Caches and cpus have different topology, this causes cpus_share_cache() > return the wrong value, which will affect the CPU load balance. > > Cache topology should be separated with CPU topology, it can be obtained > from "next-level-cache" in DTS preferentially. If your clusters do not have cache, then you're currently setting SD_SHARE_PKG_RESOURCES wrong, if they do, things are correct. If you want to represent L2, use the new fangled cluster level or something, that's what it's there for. That is, you can represent the above like: DIE: 0-7 MC: 0-3, 4-7 CLS: 0-1,1-2, 4-5,6-7 But if there is cache at MC, LLC is what it is.