All of lore.kernel.org
 help / color / mirror / Atom feed
From: thunder.leizhen@huawei.com (Leizhen (ThunderTown))
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/4] Documentation: arm64/arm: dt bindings for numa.
Date: Mon, 31 Aug 2015 10:53:04 +0800	[thread overview]
Message-ID: <55E3C190.30407@huawei.com> (raw)
In-Reply-To: <CAFpQJXWO0xT0kxWf09L_XcAOXm1Lov8i2U2BQzk-x0TStj7vBg@mail.gmail.com>



On 2015/8/29 22:56, Ganapatrao Kulkarni wrote:
> Hi Thunder,
> 
> On Sat, Aug 29, 2015 at 3:16 PM, Leizhen (ThunderTown)
> <thunder.leizhen@huawei.com> wrote:
>>
>>
>> On 2015/8/28 22:02, Rob Herring wrote:
>>> +benh
>>>
>>> On Fri, Aug 28, 2015 at 7:32 AM, Mark Rutland <mark.rutland@arm.com> wrote:
>>>> Hi,
>>>>
>>>> On Fri, Aug 14, 2015 at 05:39:32PM +0100, Ganapatrao Kulkarni wrote:
>>>>> DT bindings for numa map for memory, cores and IOs using
>>>>> arm,associativity device node property.
>>>>
>>>> Given this is just a copy of ibm,associativity, I'm not sure I see much
>>>> point in renaming the properties.
>>>
>>> So just keep the ibm? I'm okay with that. That would help move to
>>> common code. Alternatively, we could drop the vendor prefix and have
>>> common code just check for both.
>>>
>>
>> Hi all,
>>
>> Why not copy the method of ACPI numa? There only three elements should be configured:
>> 1) a cpu belong to which node
>> 2) a memory block belong to which node
>> 3) the distance of each two nodes
>>
>> The devicetree nodes of numa can be like below:
>> / {
>>         ...
>>
>>         numa-nodes-info {
>>                 node-name: node-description {
>>                         mem-ranges = <...>;
>>                         cpus-list = <...>;
>>                 };
>>
>>                 nodes-distance {
>>                         distance-list = <...>;
>>                 };
>>         };
>>
>>         ...
>> };
>>
> some what similar to what your are proposing is already implemented in
> my v2 patchset.
> https://lwn.net/Articles/623920/
> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/305164.html

Sorry, I have not read your old version patchsets before.

The basic ideas are consistent, but details are different. I think your v2 patchset may meet some problem:

-------------------------
+- cpu-map:	This property defines the association of range of processors
+		(range of cpu ids) and the proximity domain to which
+		the processor belongs.

+		cpu-map = <0 7 0>,
+			  <8 15 1>;
-------------------------

1.
I am not sure the cpu ids is logical cpu-ids in Linux or the sequence number of the CPU dt-nodes in dts.
The former case: logical cpu-id is allocated by Linux, we can not ensure that cpu0 is the first CPU dt-node.
The latter case: depend on Linux strictly parse CPU dt-nodes follow the sequence in dts.

2. You should put most codes into /drivers/of/, because it can be shared with other ARCHs which base upon devicetree.

Here is my detailed example:
Examples:
/ {
	#address-cells = <2>;
	#size-cells = <2>;

	memory at 0 {
		device_type = "memory";
		reg = <0x0 0x00000000 0x0 0x40000000>,
		      <0x1 0x00000000 0x1 0x00000000>,
		      <0x2 0x00000000 0x0 0x40000000>,
		      <0x2 0x80000000 0x0 0x40000000>;
	};

	CPU0: cpu at 10000 {
		device_type = "cpu";
		reg = <0x10000>;
		...
	};

	numa-nodes-info {
		node0: cluster0 {
			mem-ranges = <0x0 0x00000000 0x1 0x00000000>;
			cpus-list = <&CPU0 &CPU1>;
		};

		node1: cluster1 {
			mem-ranges = <0x1 0x00000000 0x1 0x00000000>;
			cpus-list = <&CPU2>;
		};

		node2: cluster2 {
			mem-ranges = <0x2 0x00000000 0x1 0x00000000>;
			cpus-list = <&CPU3 &CPU4 &CPU5>;
		};

		nodes-distance {
			distance-list = <&node0 &node1 15>, <&node1 &node2 18>;
		};
	};

> we have went to associativity property based implementation to keep it
> more generic.
> i do have both acpi(using linaro/hanjun's patches) and associativity
> based implementations on our internal tree
> and tested on thunderx platform.
> i do see issue in creating numa mapping using ACPI for IOs(for
> example, i am not able to create numa mapping for ITS which is on each
> node, using ACPI tables),  since ACPI spec (tables SRAT and SLIT)
> talks only about processor and memory.
> however associativity is generic and you can apply on any dt node.
>> Sorry, I don't think xxx,associativity is a good method, it's hard to config, and it
>> seems hardware-dependent. Especially, when we want to support memory hot-add, it's too hard.
>> Because xxx,associativity have no obvious information about it. Like powerpc, it use another
>> property: "/ibm,dynamic-reconfiguration-memory".
>>
>> I spend almost a whole month to implement of_numa(configured by dt-nodes), base upon my opinion
>> mentioned above. If somebody are interested in it, I can send my patchset to show it.
>>
>> Regards,
>> Thunder.
>>
> thanks
> ganapat
> 
> .
> 

WARNING: multiple messages have this Message-ID (diff)
From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: Ganapatrao Kulkarni <gpkulkarni@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Will Deacon <Will.Deacon@arm.com>,
	Pawel Moll <Pawel.Moll@arm.com>,
	"al.stone@linaro.org" <al.stone@linaro.org>,
	Prasun Kapoor <Prasun.Kapoor@caviumnetworks.com>,
	Catalin Marinas <Catalin.Marinas@arm.com>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"steve.capper@linaro.org" <steve.capper@linaro.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"msalter@redhat.com" <msalter@redhat.com>,
	"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>,
	"rfranz@cavium.com" <rfranz@cavium.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	han
Subject: Re: [PATCH v5 2/4] Documentation: arm64/arm: dt bindings for numa.
Date: Mon, 31 Aug 2015 10:53:04 +0800	[thread overview]
Message-ID: <55E3C190.30407@huawei.com> (raw)
In-Reply-To: <CAFpQJXWO0xT0kxWf09L_XcAOXm1Lov8i2U2BQzk-x0TStj7vBg@mail.gmail.com>



On 2015/8/29 22:56, Ganapatrao Kulkarni wrote:
> Hi Thunder,
> 
> On Sat, Aug 29, 2015 at 3:16 PM, Leizhen (ThunderTown)
> <thunder.leizhen@huawei.com> wrote:
>>
>>
>> On 2015/8/28 22:02, Rob Herring wrote:
>>> +benh
>>>
>>> On Fri, Aug 28, 2015 at 7:32 AM, Mark Rutland <mark.rutland@arm.com> wrote:
>>>> Hi,
>>>>
>>>> On Fri, Aug 14, 2015 at 05:39:32PM +0100, Ganapatrao Kulkarni wrote:
>>>>> DT bindings for numa map for memory, cores and IOs using
>>>>> arm,associativity device node property.
>>>>
>>>> Given this is just a copy of ibm,associativity, I'm not sure I see much
>>>> point in renaming the properties.
>>>
>>> So just keep the ibm? I'm okay with that. That would help move to
>>> common code. Alternatively, we could drop the vendor prefix and have
>>> common code just check for both.
>>>
>>
>> Hi all,
>>
>> Why not copy the method of ACPI numa? There only three elements should be configured:
>> 1) a cpu belong to which node
>> 2) a memory block belong to which node
>> 3) the distance of each two nodes
>>
>> The devicetree nodes of numa can be like below:
>> / {
>>         ...
>>
>>         numa-nodes-info {
>>                 node-name: node-description {
>>                         mem-ranges = <...>;
>>                         cpus-list = <...>;
>>                 };
>>
>>                 nodes-distance {
>>                         distance-list = <...>;
>>                 };
>>         };
>>
>>         ...
>> };
>>
> some what similar to what your are proposing is already implemented in
> my v2 patchset.
> https://lwn.net/Articles/623920/
> http://lists.infradead.org/pipermail/linux-arm-kernel/2014-November/305164.html

Sorry, I have not read your old version patchsets before.

The basic ideas are consistent, but details are different. I think your v2 patchset may meet some problem:

-------------------------
+- cpu-map:	This property defines the association of range of processors
+		(range of cpu ids) and the proximity domain to which
+		the processor belongs.

+		cpu-map = <0 7 0>,
+			  <8 15 1>;
-------------------------

1.
I am not sure the cpu ids is logical cpu-ids in Linux or the sequence number of the CPU dt-nodes in dts.
The former case: logical cpu-id is allocated by Linux, we can not ensure that cpu0 is the first CPU dt-node.
The latter case: depend on Linux strictly parse CPU dt-nodes follow the sequence in dts.

2. You should put most codes into /drivers/of/, because it can be shared with other ARCHs which base upon devicetree.

Here is my detailed example:
Examples:
/ {
	#address-cells = <2>;
	#size-cells = <2>;

	memory@0 {
		device_type = "memory";
		reg = <0x0 0x00000000 0x0 0x40000000>,
		      <0x1 0x00000000 0x1 0x00000000>,
		      <0x2 0x00000000 0x0 0x40000000>,
		      <0x2 0x80000000 0x0 0x40000000>;
	};

	CPU0: cpu@10000 {
		device_type = "cpu";
		reg = <0x10000>;
		...
	};

	numa-nodes-info {
		node0: cluster0 {
			mem-ranges = <0x0 0x00000000 0x1 0x00000000>;
			cpus-list = <&CPU0 &CPU1>;
		};

		node1: cluster1 {
			mem-ranges = <0x1 0x00000000 0x1 0x00000000>;
			cpus-list = <&CPU2>;
		};

		node2: cluster2 {
			mem-ranges = <0x2 0x00000000 0x1 0x00000000>;
			cpus-list = <&CPU3 &CPU4 &CPU5>;
		};

		nodes-distance {
			distance-list = <&node0 &node1 15>, <&node1 &node2 18>;
		};
	};

> we have went to associativity property based implementation to keep it
> more generic.
> i do have both acpi(using linaro/hanjun's patches) and associativity
> based implementations on our internal tree
> and tested on thunderx platform.
> i do see issue in creating numa mapping using ACPI for IOs(for
> example, i am not able to create numa mapping for ITS which is on each
> node, using ACPI tables),  since ACPI spec (tables SRAT and SLIT)
> talks only about processor and memory.
> however associativity is generic and you can apply on any dt node.
>> Sorry, I don't think xxx,associativity is a good method, it's hard to config, and it
>> seems hardware-dependent. Especially, when we want to support memory hot-add, it's too hard.
>> Because xxx,associativity have no obvious information about it. Like powerpc, it use another
>> property: "/ibm,dynamic-reconfiguration-memory".
>>
>> I spend almost a whole month to implement of_numa(configured by dt-nodes), base upon my opinion
>> mentioned above. If somebody are interested in it, I can send my patchset to show it.
>>
>> Regards,
>> Thunder.
>>
> thanks
> ganapat
> 
> .
> 

  reply	other threads:[~2015-08-31  2:53 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-14 16:39 [PATCH v5 0/8] arm64, numa: Add numa support for arm64 platforms Ganapatrao Kulkarni
2015-08-14 16:39 ` Ganapatrao Kulkarni
2015-08-14 16:39 ` [PATCH v5 1/4] arm64, numa: adding " Ganapatrao Kulkarni
2015-08-14 16:39   ` Ganapatrao Kulkarni
2015-09-03  9:52   ` Ganapatrao Kulkarni
2015-09-03  9:52     ` Ganapatrao Kulkarni
2015-09-03 10:13     ` Will Deacon
2015-09-03 10:13       ` Will Deacon
2015-09-29  8:43       ` Ganapatrao Kulkarni
2015-09-29  8:43         ` Ganapatrao Kulkarni
2015-10-05  5:24   ` Ganapatrao Kulkarni
2015-10-05  5:24     ` Ganapatrao Kulkarni
2015-08-14 16:39 ` [PATCH v5 2/4] Documentation: arm64/arm: dt bindings for numa Ganapatrao Kulkarni
2015-08-14 16:39   ` Ganapatrao Kulkarni
2015-08-22 15:06   ` Robert Richter
2015-08-22 15:06     ` Robert Richter
2015-08-23 21:49   ` Rob Herring
2015-08-23 21:49     ` Rob Herring
2015-08-28 11:32   ` Matthias Brugger
2015-08-28 11:32     ` Matthias Brugger
2015-08-28 12:32   ` Mark Rutland
2015-08-28 12:32     ` Mark Rutland
2015-08-28 14:02     ` Rob Herring
2015-08-28 14:02       ` Rob Herring
2015-08-28 21:37       ` Benjamin Herrenschmidt
2015-08-28 21:37         ` Benjamin Herrenschmidt
2015-09-02 17:11         ` Ganapatrao Kulkarni
2015-09-02 17:11           ` Ganapatrao Kulkarni
2015-08-29  9:46       ` Leizhen (ThunderTown)
2015-08-29  9:46         ` Leizhen (ThunderTown)
2015-08-29 10:37         ` Benjamin Herrenschmidt
2015-08-29 10:37           ` Benjamin Herrenschmidt
2015-08-31  1:46           ` Leizhen (ThunderTown)
2015-08-31  1:46             ` Leizhen (ThunderTown)
2015-08-29 14:56         ` Ganapatrao Kulkarni
2015-08-29 14:56           ` Ganapatrao Kulkarni
2015-08-31  2:53           ` Leizhen (ThunderTown) [this message]
2015-08-31  2:53             ` Leizhen (ThunderTown)
2015-09-08 13:27           ` Hanjun Guo
2015-09-08 13:27             ` Hanjun Guo
2015-09-08 16:27             ` Ganapatrao Kulkarni
2015-09-08 16:27               ` Ganapatrao Kulkarni
2015-09-11  3:53               ` Ganapatrao Kulkarni
2015-09-11  3:53                 ` Ganapatrao Kulkarni
2015-09-11  6:43                 ` Leizhen (ThunderTown)
2015-09-11  6:43                   ` Leizhen (ThunderTown)
2015-09-29  8:35     ` Ganapatrao Kulkarni
2015-09-29  8:38       ` Ganapatrao Kulkarni
2015-09-29  8:38         ` Ganapatrao Kulkarni
2015-09-29  9:42         ` Benjamin Herrenschmidt
2015-09-29  9:42           ` Benjamin Herrenschmidt
2015-09-30  0:28         ` Benjamin Herrenschmidt
2015-09-30  0:28           ` Benjamin Herrenschmidt
2015-09-30 10:19           ` Ganapatrao Kulkarni
2015-09-30 10:19             ` Ganapatrao Kulkarni
2015-09-30 10:53         ` Mark Rutland
2015-09-30 10:53           ` Mark Rutland
2015-09-30 17:50           ` Ganapatrao Kulkarni
2015-09-30 17:50             ` Ganapatrao Kulkarni
2015-10-01  1:05             ` Benjamin Herrenschmidt
2015-10-01  1:05               ` Benjamin Herrenschmidt
2015-10-01  5:11               ` Ganapatrao Kulkarni
2015-10-01  5:25                 ` Ganapatrao Kulkarni
2015-10-01  5:25                   ` Ganapatrao Kulkarni
2015-10-01  7:17                 ` Benjamin Herrenschmidt
2015-10-01  7:17                   ` Benjamin Herrenschmidt
2015-10-01 11:36                 ` Ganapatrao Kulkarni
2015-10-01 11:36                   ` Ganapatrao Kulkarni
2015-10-13 16:47                   ` Mark Rutland
2015-10-13 16:47                     ` Mark Rutland
2015-10-13 17:07                     ` Ganapatrao Kulkarni
2015-10-13 17:07                       ` Ganapatrao Kulkarni
2015-10-14 13:21                     ` Hanjun Guo
2015-10-14 13:21                       ` Hanjun Guo
2015-08-14 16:39 ` [PATCH v5 3/4] arm64, numa, dt: adding dt based numa support using dt node property arm, associativity Ganapatrao Kulkarni
2015-08-14 16:39   ` Ganapatrao Kulkarni
2015-10-09 15:18   ` Catalin Marinas
2015-10-09 15:18     ` Catalin Marinas
2015-10-09 16:51     ` Ganapatrao Kulkarni
2015-10-09 16:51       ` Ganapatrao Kulkarni
2015-08-14 16:39 ` [PATCH v5 4/4] arm64, dt, thunderx: Add initial dts for Cavium Thunder SoC in 2 Node topology Ganapatrao Kulkarni
2015-08-14 16:39   ` Ganapatrao Kulkarni
2015-08-18  6:16   ` Jisheng Zhang
2015-08-18  6:16     ` Jisheng Zhang
2015-08-14 16:44 ` [PATCH v5 0/8] arm64, numa: Add numa support for arm64 platforms Ganapatrao Kulkarni
2015-08-14 16:44   ` Ganapatrao Kulkarni
2015-08-20  6:50   ` Ganapatrao Kulkarni
2015-08-20  6:50     ` Ganapatrao Kulkarni
2015-08-28 14:31 ` Matthias Brugger
2015-08-28 14:31   ` Matthias Brugger
2015-08-28 14:59   ` Ganapatrao Kulkarni
2015-08-28 14:59     ` Ganapatrao Kulkarni
2015-08-28 15:36     ` Matthias Brugger
2015-08-28 15:36       ` Matthias Brugger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E3C190.30407@huawei.com \
    --to=thunder.leizhen@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.