Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2479966imd; Fri, 2 Nov 2018 12:08:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5co2IAQx4TRPsYftKQMlbIXu/wV+4wDNUJFE6qhy19x+FVwbxnM+H1PUiQ9TModBnG/R3X4 X-Received: by 2002:a17:902:7c0c:: with SMTP id x12-v6mr4302263pll.172.1541185686271; Fri, 02 Nov 2018 12:08:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541185686; cv=none; d=google.com; s=arc-20160816; b=JzYM0HziOvUOap5ZWR4rjT4a9H7OslYOEftzyAbCW1ZF8Dzs9nbuOha8pdyd3Lkw64 R+1mE5AfNFE/p+ltNE4x1/iWoVHW99jVyfW3mXsQ8tCZkVQC51cAUtWKju3lncd9mzBP vOgeeo5RtF4tNhKoowof6XgXYZe1rsyf6sLz9W1bho0KL4romU2DloB5vi6rPD3exGBm b4j5/6kBfzSDsaMEKLS0lqN0pM+0AtPBZ02IT2Iz6JOg8fZt2EtsfN3eOz2FfKYGoFGF +7ZL8lycVBMDDlKWfZjGz6LH8Xk3JyiPodUc13/lCh6KnEyWKRLOAuzfxMDbiAx9KpdQ W++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:organization:subject:cc:to:from:date :content-transfer-encoding:mime-version; bh=fwDtpdFROdm96cui4xjH0c3Xku6WE8DbWcczcn/Z9+o=; b=UQBQrVg37SjYZ6aNQ42PRIUk7oYQwF867yzcReKH97vBWuBNmPnXvXcCUGQ+sa/REU Rg8qOcssa5umJ7JPmlQA2suT6QtnMS0cvMNYJe/HVSFKkEgK/Fci+1ivTxT45jMtFKgm Kz3+P7979x0BpzpGrcI7oatzIKnRnei8lZKfMhxDCKyxRtdSQsNIVkTeQD43BCZP1HFH tzU+x3QdNRezSK5uyONiQusxSRwzVjnaRprE+Kbbycmmab4fEEcNQw7FpA4cBXnVO/mm UVfk6vXdPzEdjk88xqDwTO3WPsgZXDzoa7YVXasOoXUqBAgPeXNxouHxonMDHJviOLzh 816Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15-v6si34550769pgj.566.2018.11.02.12.07.51; Fri, 02 Nov 2018 12:08:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726927AbeKCEPu (ORCPT + 99 others); Sat, 3 Nov 2018 00:15:50 -0400 Received: from mailgate-4.ics.forth.gr ([139.91.1.7]:30610 "EHLO mailgate-4.ics.forth.gr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725974AbeKCEPu (ORCPT ); Sat, 3 Nov 2018 00:15:50 -0400 X-Greylist: delayed 476 seconds by postgrey-1.27 at vger.kernel.org; Sat, 03 Nov 2018 00:15:49 EDT Received: from av1.ics.forth.gr (av3in.ics.forth.gr. [139.91.1.77]) by mailgate-4.ics.forth.gr (8.14.5/ICS-FORTH/V10-1.9-GATE-OUT) with ESMTP id wA2IwfNC069634; Fri, 2 Nov 2018 20:58:43 +0200 (EET) X-AuditID: 8b5b9d4d-91bff70000000e62-4c-5bdc9e60aae2 Received: from enigma.ics.forth.gr (webmail.ics.forth.gr [139.91.1.35]) by av1.ics.forth.gr (SMTP Outbound / FORTH / ICS) with SMTP id EA.36.03682.06E9CDB5; Fri, 2 Nov 2018 20:58:40 +0200 (EET) Received: from webmail.ics.forth.gr (localhost [127.0.0.1]) by enigma.ics.forth.gr (8.15.1//ICS-FORTH/V10.5.0C-EXTNULL-SSL-SASL) with ESMTP id wA2Iwd6q019465; Fri, 2 Nov 2018 20:58:39 +0200 X-ICS-AUTH-INFO: Authenticated user: at ics.forth.gr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 02 Nov 2018 20:58:39 +0200 From: Nick Kossifidis To: Atish Patra Cc: linux-riscv@lists.infradead.org, mark.rutland@arm.com, devicetree@vger.kernel.org, Damien.LeMoal@wdc.com, alankao@andestech.com, zong@andestech.com, anup@brainfault.org, palmer@sifive.com, linux-kernel@vger.kernel.org, hch@infradead.org, robh+dt@kernel.org, tglx@linutronix.de Subject: Re: [RFC 0/2] Add RISC-V cpu topology Organization: FORTH In-Reply-To: <1541113468-22097-1-git-send-email-atish.patra@wdc.com> References: <1541113468-22097-1-git-send-email-atish.patra@wdc.com> Message-ID: <866dedbc78ab4fa0e3b040697e112106@mailhost.ics.forth.gr> X-Sender: mick@mailhost.ics.forth.gr User-Agent: Roundcube Webmail/1.1.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRmVeSWpSXmKPExsXSHc2orJsw7060wb0+S4ttS1azWrR8eMdq sWjFdxaL1vZvTBbzj5xjtTg9YRGTxeVdc9gstn1uYbNYev0ik8XmCQtYLVr3HmG32LxpKrPF 85W9bA68HntOz2L2WDNvDaPH1N9nWDw2r9Dy2LSqk83j3blz7B6bl9R7XGq+zu7xeZOcR/uB bqYArigum5TUnMyy1CJ9uwSujKXvGlkL5ohWbJ6wmr2B8ZJAFyMnh4SAicSlRQeZuxi5OIQE jjBKdExZzArhHGSUaHs3mR2iylRi9t5ORhCbV0BQ4uTMJywgNrOAhcTUK/sZIWx5ieats5lB bBYBVYknmyeCxdkENCXmXzoIVM/BIQIUn7WIH2Q+s8AeJoldM5aD1QgL6Ek0bbjJCmLzCwhL fLp7EczmFHCRWHf8AliNkICzxLUnMDe4SHQvPs0IcZuKxIffD8DuFBVQlnhxYjrrBEahWUhO nYXk1FlITl3AyLyKUSCxzFgvM7lYLy2/qCRDL71oEyM47ub67mA8t8D+EKMAB6MSD69B5Z1o IdbEsuLK3EOMEhzMSiK8X1qBQrwpiZVVqUX58UWlOanFhxilOViUxHkPvwgPEhJITyxJzU5N LUgtgskycXBKNTAGZKhfbHuUk+v0OKB7Q/bPkvtfRI/Pn17A67NTJiNETP7fa2YLhfWzpEzF ZxTI+EWwcn9kbGhY3/5pZ27ShYxkw9gJM+88Wbkl0fb5X0OVmJkaOv9e7VvmV8GaE/2XKSLk SczHqstv9jg43V153u1Mm6RuyOXdV2tv3ly5JW5v1JW1Maty6jYpsRRnJBpqMRcVJwIA/dqV q7cCAAA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello All, Στις 2018-11-02 01:04, Atish Patra έγραψε: > This patch series adds the cpu topology for RISC-V. It contains > both the DT binding and actual source code. It has been tested on > QEMU & Unleashed board. > > The idea is based on cpu-map in ARM with changes related to how > we define SMT systems. The reason for adopting a similar approach > to ARM as I feel it provides a very clear way of defining the > topology compared to parsing cache nodes to figure out which cpus > share the same package or core. I am open to any other idea to > implement cpu-topology as well. > I was also about to start a discussion about CPU topology on RISC-V after the last swtools group meeting. The goal is to provide the scheduler with hints on how to distribute tasks more efficiently between harts, by populating the scheduling domain topology levels (https://elixir.bootlin.com/linux/v4.19/ident/sched_domain_topology_level). What we want to do is define cpu groups and assign them to scheduling domains with the appropriate SD_ flags (https://github.com/torvalds/linux/blob/master/include/linux/sched/topology.h#L16). So the cores that belong to a scheduling domain may share: CPU capacity (SD_SHARE_CPUCAPACITY / SD_ASYM_CPUCAPACITY) Package resources -e.g. caches, units etc- (SD_SHARE_PKG_RESOURCES) Power domain (SD_SHARE_POWERDOMAIN) In this context I believe using words like "core", "package", "socket" etc can be misleading. For example the sample topology you use on the documentation says that there are 4 cores that are part of a package, however "package" has a different meaning to the scheduler. Also we don't say anything in case they share a power domain or if they have the same capacity or not. This mapping deals only with cache hierarchy or other shared resources. How about defining a dt scheme to describe the scheduler domain topology levels instead ? e.g: 2 sets (or clusters if you prefer) of 2 SMT cores, each set with a different capacity and power domain: sched_topology { level0 { // SMT shared = "power", "capacity", "resources"; group0 { members = <&hart0>, <&hart1>; } group1 { members = <&hart2>, <&hart3>; } group2 { members = <&hart4>, <&hart5>; } group3 { members = <&hart6>, <&hart7>; } } level1 { // MC shared = "power", "capacity" group0 { members = <&hart0>, <&hart1>, <&hart2>, <&hart3>; } group1 { members = <&hart4>, <&hart5>, <&hart6>, <&hart7>; } } top_level { // A group with all harts in it shared = "" // There is nothing common for ALL harts, we could have capacity here } } Regards, Nick