Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1233720 > unrolled thread
| Started by | Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> |
|---|---|
| First post | 2015-09-27 20:30 +0200 |
| Last post | 2015-09-29 21:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-09-27 20:30 +0200
Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-09-28 19:30 +0200
Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-09-29 20:40 +0200
Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid Nishanth Aravamudan <nacc@linux.vnet.ibm.com> - 2015-09-28 19:40 +0200
Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> - 2015-09-29 21:30 +0200
| From | Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-09-27 20:30 +0200 |
| Subject | [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid |
| Message-ID | <qdoRX-6G6-9@gated-at.bofh.it> |
Once we have made the distinction between nid and chipid
create a 1:1 mapping between them. This makes compacting the
nids easy later.
No functionality change.
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
---
arch/powerpc/mm/numa.c | 36 +++++++++++++++++++++++++++++-------
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index f84ed2f..dd2073b 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -264,6 +264,17 @@ out:
return chipid;
}
+
+ /* Return the nid from associativity */
+static int associativity_to_nid(const __be32 *associativity)
+{
+ int nid;
+
+ nid = associativity_to_chipid(associativity);
+ return nid;
+}
+
+
/* Returns the chipid associated with the given device tree node,
* or -1 if not found.
*/
@@ -278,6 +289,17 @@ static int of_node_to_chipid_single(struct device_node *device)
return chipid;
}
+/*
+ * Returns nid from the chipid associated with given tree node
+ */
+static int of_node_to_nid_single(struct device_node *device)
+{
+ int nid;
+
+ nid = of_node_to_chipid_single(device);
+ return nid;
+}
+
/* Walk the device tree upwards, looking for an associativity id */
int of_node_to_nid(struct device_node *device)
{
@@ -286,7 +308,7 @@ int of_node_to_nid(struct device_node *device)
of_node_get(device);
while (device) {
- nid = of_node_to_chipid_single(device);
+ nid = of_node_to_nid_single(device);
if (nid != -1)
break;
@@ -498,7 +520,7 @@ static int of_get_assoc_arrays(struct device_node *memory,
}
/*
- * This is like of_node_to_chipid_single() for memory represented in the
+ * This is like of_node_to_nid_single() for memory represented in the
* ibm,dynamic-reconfiguration-memory node.
*/
static int of_drconf_to_nid_single(struct of_drconf_cell *drmem,
@@ -557,7 +579,7 @@ static int numa_setup_cpu(unsigned long lcpu)
goto out;
}
- nid = of_node_to_chipid_single(cpu);
+ nid = of_node_to_nid_single(cpu);
out_present:
if (nid < 0 || !node_online(nid))
@@ -754,7 +776,7 @@ static int __init parse_numa_properties(void)
cpu = of_get_cpu_node(i, NULL);
BUG_ON(!cpu);
- nid = of_node_to_chipid_single(cpu);
+ nid = of_node_to_nid_single(cpu);
of_node_put(cpu);
/*
@@ -796,7 +818,7 @@ new_range:
* have associativity properties. If none, then
* everything goes to default_nid.
*/
- nid = of_node_to_chipid_single(memory);
+ nid = of_node_to_nid_single(memory);
if (nid < 0)
nid = default_nid;
@@ -1119,7 +1141,7 @@ static int hot_add_node_scn_to_nid(unsigned long scn_addr)
if ((scn_addr < start) || (scn_addr >= (start + size)))
continue;
- nid = of_node_to_chipid_single(memory);
+ nid = of_node_to_nid_single(memory);
break;
}
@@ -1415,7 +1437,7 @@ int arch_update_cpu_topology(void)
/* Use associativity from first thread for all siblings */
vphn_get_associativity(cpu, associativity);
- new_nid = associativity_to_chipid(associativity);
+ new_nid = associativity_to_nid(associativity);
if (new_nid < 0 || !node_online(new_nid))
new_nid = first_online_node;
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Nishanth Aravamudan <nacc@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-09-28 19:30 +0200 |
| Subject | Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid |
| Message-ID | <qdKpt-62N-13@gated-at.bofh.it> |
| In reply to | #1233720 |
On 27.09.2015 [23:59:11 +0530], Raghavendra K T wrote:
> Once we have made the distinction between nid and chipid
> create a 1:1 mapping between them. This makes compacting the
> nids easy later.
Didn't the previous patch just do the opposite of...
> @@ -286,7 +308,7 @@ int of_node_to_nid(struct device_node *device)
>
> of_node_get(device);
> while (device) {
> - nid = of_node_to_chipid_single(device);
> + nid = of_node_to_nid_single(device);
> if (nid != -1)
> break;
>
> @@ -498,7 +520,7 @@ static int of_get_assoc_arrays(struct device_node *memory,
> }
>
> /*
> - * This is like of_node_to_chipid_single() for memory represented in the
> + * This is like of_node_to_nid_single() for memory represented in the
> * ibm,dynamic-reconfiguration-memory node.
> */
> static int of_drconf_to_nid_single(struct of_drconf_cell *drmem,
> @@ -557,7 +579,7 @@ static int numa_setup_cpu(unsigned long lcpu)
> goto out;
> }
>
> - nid = of_node_to_chipid_single(cpu);
> + nid = of_node_to_nid_single(cpu);
>
> out_present:
> if (nid < 0 || !node_online(nid))
> @@ -754,7 +776,7 @@ static int __init parse_numa_properties(void)
>
> cpu = of_get_cpu_node(i, NULL);
> BUG_ON(!cpu);
> - nid = of_node_to_chipid_single(cpu);
> + nid = of_node_to_nid_single(cpu);
> of_node_put(cpu);
>
> /*
> @@ -796,7 +818,7 @@ new_range:
> * have associativity properties. If none, then
> * everything goes to default_nid.
> */
> - nid = of_node_to_chipid_single(memory);
> + nid = of_node_to_nid_single(memory);
> if (nid < 0)
> nid = default_nid;
>
> @@ -1119,7 +1141,7 @@ static int hot_add_node_scn_to_nid(unsigned long scn_addr)
> if ((scn_addr < start) || (scn_addr >= (start + size)))
> continue;
>
> - nid = of_node_to_chipid_single(memory);
> + nid = of_node_to_nid_single(memory);
> break;
> }
>
> @@ -1415,7 +1437,7 @@ int arch_update_cpu_topology(void)
>
> /* Use associativity from first thread for all siblings */
> vphn_get_associativity(cpu, associativity);
> - new_nid = associativity_to_chipid(associativity);
> + new_nid = associativity_to_nid(associativity);
> if (new_nid < 0 || !node_online(new_nid))
> new_nid = first_online_node;
>
Why is this churn useful?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-09-29 20:40 +0200 |
| Subject | Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid |
| Message-ID | <qe7YK-6an-29@gated-at.bofh.it> |
| In reply to | #1234313 |
On 09/28/2015 10:58 PM, Nishanth Aravamudan wrote: > On 27.09.2015 [23:59:11 +0530], Raghavendra K T wrote: >> Once we have made the distinction between nid and chipid >> create a 1:1 mapping between them. This makes compacting the >> nids easy later. > > > Didn't the previous patch just do the opposite of... > As per my thoughts it was: 1. rename functions to say loud that it is chipid (and not nid) 2. and then assign nid = chipid so that we are clear that we made nid:chipid 1:1 mapping and compact nids later.. But again may be I should combine patch 2 and 3. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Nishanth Aravamudan <nacc@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-09-28 19:40 +0200 |
| Subject | Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid |
| Message-ID | <qdKz8-6dR-11@gated-at.bofh.it> |
| In reply to | #1233720 |
On 27.09.2015 [23:59:11 +0530], Raghavendra K T wrote:
> Once we have made the distinction between nid and chipid
> create a 1:1 mapping between them. This makes compacting the
> nids easy later.
>
> No functionality change.
>
> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
> ---
> arch/powerpc/mm/numa.c | 36 +++++++++++++++++++++++++++++-------
> 1 file changed, 29 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index f84ed2f..dd2073b 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -264,6 +264,17 @@ out:
> return chipid;
> }
>
> +
> + /* Return the nid from associativity */
> +static int associativity_to_nid(const __be32 *associativity)
> +{
> + int nid;
> +
> + nid = associativity_to_chipid(associativity);
> + return nid;
> +}
This is ultimately confusing. You are assigning the semantic return
value of a chipid to a nid -- is it a nid or a chipid? Shouldn't the
variable naming be consistent?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com> |
|---|---|
| Date | 2015-09-29 21:30 +0200 |
| Subject | Re: [PATCH RFC 3/5] powerpc:numa create 1:1 mappaing between chipid and nid |
| Message-ID | <qe8L7-7kd-11@gated-at.bofh.it> |
| In reply to | #1234317 |
On 09/28/2015 11:05 PM, Nishanth Aravamudan wrote:
> On 27.09.2015 [23:59:11 +0530], Raghavendra K T wrote:
>> Once we have made the distinction between nid and chipid
>> create a 1:1 mapping between them. This makes compacting the
>> nids easy later.
>>
>> No functionality change.
>>
>> Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/mm/numa.c | 36 +++++++++++++++++++++++++++++-------
>> 1 file changed, 29 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
>> index f84ed2f..dd2073b 100644
>> --- a/arch/powerpc/mm/numa.c
>> +++ b/arch/powerpc/mm/numa.c
>> @@ -264,6 +264,17 @@ out:
>> return chipid;
>> }
>>
>> +
>> + /* Return the nid from associativity */
>> +static int associativity_to_nid(const __be32 *associativity)
>> +{
>> + int nid;
>> +
>> + nid = associativity_to_chipid(associativity);
>> + return nid;
>> +}
>
> This is ultimately confusing. You are assigning the semantic return
> value of a chipid to a nid -- is it a nid or a chipid? Shouldn't the
> variable naming be consistent?
>
:( yes. will come up with some consistent naming.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web