RE: [PATCH] ARC: Adjust cpuinfo for non-continuous cpu ids

2016-10-19 Thread Noam Camus
> From: Vineet Gupta [mailto:vineet.gup...@synopsys.com] 
> Sent: Tuesday, October 18, 2016 8:49 PM

>>
>> num_possible_cpus() returns how many CPUs may be present on system.
>> However we want the highest possible CPU number.
>
>Highest possible number "Detected" at boot ? Can you explain a bit more !

While trying to provide explanation I decided to "rethink" on this patch.
Its effect is not visible to you due to another "local" patch I use which 
justify this patch.
I need to reconsider both patches (maybe I will even remove both of them).

Thanks for the feedback.
Noam 


RE: [PATCH] ARC: Adjust cpuinfo for non-continuous cpu ids

2016-10-19 Thread Noam Camus
> From: Vineet Gupta [mailto:vineet.gup...@synopsys.com] 
> Sent: Tuesday, October 18, 2016 8:49 PM

>>
>> num_possible_cpus() returns how many CPUs may be present on system.
>> However we want the highest possible CPU number.
>
>Highest possible number "Detected" at boot ? Can you explain a bit more !

While trying to provide explanation I decided to "rethink" on this patch.
Its effect is not visible to you due to another "local" patch I use which 
justify this patch.
I need to reconsider both patches (maybe I will even remove both of them).

Thanks for the feedback.
Noam 


Re: [PATCH] ARC: Adjust cpuinfo for non-continuous cpu ids

2016-10-18 Thread Vineet Gupta
On 10/18/2016 06:47 AM, Noam Camus wrote:
> From: Noam Camus 
>
> num_possible_cpus() returns how many CPUs may be present on system.
> However we want the highest possible CPU number.

Highest possible number "Detected" at boot ? Can you explain a bit more !

> This may be differ in a sparsed possible CPUs map.
>
> Signed-off-by: Noam Camus 
> Acked-by: Vineet Gupta 
> ---
>  arch/arc/kernel/setup.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
> index f52a0d0..d13ce84 100644
> --- a/arch/arc/kernel/setup.c
> +++ b/arch/arc/kernel/setup.c
> @@ -506,7 +506,7 @@ static void *c_start(struct seq_file *m, loff_t *pos)
>* way to pass it w/o having to kmalloc/free a 2 byte string.
>* Encode cpu-id as 0xFF, which is decoded by show routine.
>*/
> - return *pos < num_possible_cpus() ? cpu_to_ptr(*pos) : NULL;
> + return *pos < nr_cpu_ids ? cpu_to_ptr(*pos) : NULL;

My only concern is that for smaller systems - say if I build with NR_CPUS = 4, 
and
there are only 2 cpus present, then /proc/cpuinfo needs to print the fact. And a
quick test with ur patch says that is the case - so how does this help you. Do u
use nr_cpus cmdline toggle ?

[ARCLinux]# cat /proc/cpuinfo

IDENTITY: ARCVER [0x51] ARCNUM [0x0] CHIPID [ 0x0]
processor [0]: ARC HS38 R2.0 (ARCv2 ISA)
...
...
processor [2]: Offline

processor [3]: Offline


-Vineet

>  }
>  
>  static void *c_next(struct seq_file *m, void *v, loff_t *pos)



Re: [PATCH] ARC: Adjust cpuinfo for non-continuous cpu ids

2016-10-18 Thread Vineet Gupta
On 10/18/2016 06:47 AM, Noam Camus wrote:
> From: Noam Camus 
>
> num_possible_cpus() returns how many CPUs may be present on system.
> However we want the highest possible CPU number.

Highest possible number "Detected" at boot ? Can you explain a bit more !

> This may be differ in a sparsed possible CPUs map.
>
> Signed-off-by: Noam Camus 
> Acked-by: Vineet Gupta 
> ---
>  arch/arc/kernel/setup.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
> index f52a0d0..d13ce84 100644
> --- a/arch/arc/kernel/setup.c
> +++ b/arch/arc/kernel/setup.c
> @@ -506,7 +506,7 @@ static void *c_start(struct seq_file *m, loff_t *pos)
>* way to pass it w/o having to kmalloc/free a 2 byte string.
>* Encode cpu-id as 0xFF, which is decoded by show routine.
>*/
> - return *pos < num_possible_cpus() ? cpu_to_ptr(*pos) : NULL;
> + return *pos < nr_cpu_ids ? cpu_to_ptr(*pos) : NULL;

My only concern is that for smaller systems - say if I build with NR_CPUS = 4, 
and
there are only 2 cpus present, then /proc/cpuinfo needs to print the fact. And a
quick test with ur patch says that is the case - so how does this help you. Do u
use nr_cpus cmdline toggle ?

[ARCLinux]# cat /proc/cpuinfo

IDENTITY: ARCVER [0x51] ARCNUM [0x0] CHIPID [ 0x0]
processor [0]: ARC HS38 R2.0 (ARCv2 ISA)
...
...
processor [2]: Offline

processor [3]: Offline


-Vineet

>  }
>  
>  static void *c_next(struct seq_file *m, void *v, loff_t *pos)



[PATCH] ARC: Adjust cpuinfo for non-continuous cpu ids

2016-10-18 Thread Noam Camus
From: Noam Camus 

num_possible_cpus() returns how many CPUs may be present on system.
However we want the highest possible CPU number.
This may be differ in a sparsed possible CPUs map.

Signed-off-by: Noam Camus 
Acked-by: Vineet Gupta 
---
 arch/arc/kernel/setup.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index f52a0d0..d13ce84 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -506,7 +506,7 @@ static void *c_start(struct seq_file *m, loff_t *pos)
 * way to pass it w/o having to kmalloc/free a 2 byte string.
 * Encode cpu-id as 0xFF, which is decoded by show routine.
 */
-   return *pos < num_possible_cpus() ? cpu_to_ptr(*pos) : NULL;
+   return *pos < nr_cpu_ids ? cpu_to_ptr(*pos) : NULL;
 }
 
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
-- 
1.7.1



[PATCH] ARC: Adjust cpuinfo for non-continuous cpu ids

2016-10-18 Thread Noam Camus
From: Noam Camus 

num_possible_cpus() returns how many CPUs may be present on system.
However we want the highest possible CPU number.
This may be differ in a sparsed possible CPUs map.

Signed-off-by: Noam Camus 
Acked-by: Vineet Gupta 
---
 arch/arc/kernel/setup.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index f52a0d0..d13ce84 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -506,7 +506,7 @@ static void *c_start(struct seq_file *m, loff_t *pos)
 * way to pass it w/o having to kmalloc/free a 2 byte string.
 * Encode cpu-id as 0xFF, which is decoded by show routine.
 */
-   return *pos < num_possible_cpus() ? cpu_to_ptr(*pos) : NULL;
+   return *pos < nr_cpu_ids ? cpu_to_ptr(*pos) : NULL;
 }
 
 static void *c_next(struct seq_file *m, void *v, loff_t *pos)
-- 
1.7.1