Re: [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-03-01 Thread Dou Liyang

Hi Ingo,

At 03/01/2017 05:10 PM, Ingo Molnar wrote:


* Dou Liyang  wrote:


Current warning message regarded the "nr_cpu_ids - 1" as the limit
number of the CPUs. It may be confused us, for example:
we have two CPUs, nr_cpu_ids = 2, but the warning message may
indicate that we just have 1 CPU, which likes that:
Only 1 processors supported.Processor 2/0x2 and the rest
are ignored.

Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
And the warning message can be like that:
APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
and the rest are ignored.

Signed-off-by: Dou Liyang 


The patch is correct, but the title is wrong (it's 'apic', not 'acpi'), plus the
changelog is unreadable. Furthermore the changelog does not declare the changing
of the return code to -EINVAL ...

I fixed all that in the commit below, but please be more careful in the future.



Got it! I see, I will be more careful. :)

Thanks,
Liyang.


Thanks,

Ingo

===>

From bb3f0a52630c84807fca9bdd76ac2f5dcec82689 Mon Sep 17 00:00:00 2001

From: Dou Liyang 
Date: Tue, 28 Feb 2017 13:50:52 +0800
Subject: [PATCH] x86/apic: Fix a warning message in logical CPU IDs allocation

The current warning message in allocate_logical_cpuid() is somewhat confusing:

  Only 1 processors supported.Processor 2/0x2 and the rest are ignored.

As it might imply that there's only one CPU in the system - while what we ran
into here is a kernel limitation.

Fix the warning message to clarify all that:

  APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2 and the rest 
are ignored.

( Also update the error return from -1 to -EINVAL, which is the more
  canonical return value. )

Signed-off-by: Dou Liyang 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: b...@alien8.de
Cc: nicsta...@gmail.com
Cc: wanpeng...@hotmail.com
Link: 
http://lkml.kernel.org/r/1488261052-25753-1-git-send-email-douly.f...@cn.fujitsu.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 4261b3282ad9..11088b86e5c7 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)

/* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) {
-   WARN_ONCE(1, "Only %d processors supported."
+   WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 "Processor %d/0x%x and the rest are ignored.\n",
-nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-   return -1;
+nr_cpu_ids, nr_logical_cpuids, apicid);
+   return -EINVAL;
}

cpuid_to_apicid[nr_logical_cpuids] = apicid;








Re: [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-03-01 Thread Dou Liyang

Hi Ingo,

At 03/01/2017 05:10 PM, Ingo Molnar wrote:


* Dou Liyang  wrote:


Current warning message regarded the "nr_cpu_ids - 1" as the limit
number of the CPUs. It may be confused us, for example:
we have two CPUs, nr_cpu_ids = 2, but the warning message may
indicate that we just have 1 CPU, which likes that:
Only 1 processors supported.Processor 2/0x2 and the rest
are ignored.

Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
And the warning message can be like that:
APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
and the rest are ignored.

Signed-off-by: Dou Liyang 


The patch is correct, but the title is wrong (it's 'apic', not 'acpi'), plus the
changelog is unreadable. Furthermore the changelog does not declare the changing
of the return code to -EINVAL ...

I fixed all that in the commit below, but please be more careful in the future.



Got it! I see, I will be more careful. :)

Thanks,
Liyang.


Thanks,

Ingo

===>

From bb3f0a52630c84807fca9bdd76ac2f5dcec82689 Mon Sep 17 00:00:00 2001

From: Dou Liyang 
Date: Tue, 28 Feb 2017 13:50:52 +0800
Subject: [PATCH] x86/apic: Fix a warning message in logical CPU IDs allocation

The current warning message in allocate_logical_cpuid() is somewhat confusing:

  Only 1 processors supported.Processor 2/0x2 and the rest are ignored.

As it might imply that there's only one CPU in the system - while what we ran
into here is a kernel limitation.

Fix the warning message to clarify all that:

  APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2 and the rest 
are ignored.

( Also update the error return from -1 to -EINVAL, which is the more
  canonical return value. )

Signed-off-by: Dou Liyang 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: b...@alien8.de
Cc: nicsta...@gmail.com
Cc: wanpeng...@hotmail.com
Link: 
http://lkml.kernel.org/r/1488261052-25753-1-git-send-email-douly.f...@cn.fujitsu.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 4261b3282ad9..11088b86e5c7 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)

/* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) {
-   WARN_ONCE(1, "Only %d processors supported."
+   WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 "Processor %d/0x%x and the rest are ignored.\n",
-nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-   return -1;
+nr_cpu_ids, nr_logical_cpuids, apicid);
+   return -EINVAL;
}

cpuid_to_apicid[nr_logical_cpuids] = apicid;








Re: [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-03-01 Thread Ingo Molnar

* Dou Liyang  wrote:

> Current warning message regarded the "nr_cpu_ids - 1" as the limit
> number of the CPUs. It may be confused us, for example:
> we have two CPUs, nr_cpu_ids = 2, but the warning message may
> indicate that we just have 1 CPU, which likes that:
> Only 1 processors supported.Processor 2/0x2 and the rest
> are ignored.
> 
> Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
> And the warning message can be like that:
> APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
> and the rest are ignored.
> 
> Signed-off-by: Dou Liyang 

The patch is correct, but the title is wrong (it's 'apic', not 'acpi'), plus 
the 
changelog is unreadable. Furthermore the changelog does not declare the 
changing 
of the return code to -EINVAL ...

I fixed all that in the commit below, but please be more careful in the future.

Thanks,

Ingo

===>
>From bb3f0a52630c84807fca9bdd76ac2f5dcec82689 Mon Sep 17 00:00:00 2001
From: Dou Liyang 
Date: Tue, 28 Feb 2017 13:50:52 +0800
Subject: [PATCH] x86/apic: Fix a warning message in logical CPU IDs allocation

The current warning message in allocate_logical_cpuid() is somewhat confusing:

  Only 1 processors supported.Processor 2/0x2 and the rest are ignored.

As it might imply that there's only one CPU in the system - while what we ran
into here is a kernel limitation.

Fix the warning message to clarify all that:

  APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2 and the rest 
are ignored.

( Also update the error return from -1 to -EINVAL, which is the more
  canonical return value. )

Signed-off-by: Dou Liyang 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: b...@alien8.de
Cc: nicsta...@gmail.com
Cc: wanpeng...@hotmail.com
Link: 
http://lkml.kernel.org/r/1488261052-25753-1-git-send-email-douly.f...@cn.fujitsu.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 4261b3282ad9..11088b86e5c7 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)
 
/* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) {
-   WARN_ONCE(1, "Only %d processors supported."
+   WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 "Processor %d/0x%x and the rest are ignored.\n",
-nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-   return -1;
+nr_cpu_ids, nr_logical_cpuids, apicid);
+   return -EINVAL;
}
 
cpuid_to_apicid[nr_logical_cpuids] = apicid;


Re: [PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-03-01 Thread Ingo Molnar

* Dou Liyang  wrote:

> Current warning message regarded the "nr_cpu_ids - 1" as the limit
> number of the CPUs. It may be confused us, for example:
> we have two CPUs, nr_cpu_ids = 2, but the warning message may
> indicate that we just have 1 CPU, which likes that:
> Only 1 processors supported.Processor 2/0x2 and the rest
> are ignored.
> 
> Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
> And the warning message can be like that:
> APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
> and the rest are ignored.
> 
> Signed-off-by: Dou Liyang 

The patch is correct, but the title is wrong (it's 'apic', not 'acpi'), plus 
the 
changelog is unreadable. Furthermore the changelog does not declare the 
changing 
of the return code to -EINVAL ...

I fixed all that in the commit below, but please be more careful in the future.

Thanks,

Ingo

===>
>From bb3f0a52630c84807fca9bdd76ac2f5dcec82689 Mon Sep 17 00:00:00 2001
From: Dou Liyang 
Date: Tue, 28 Feb 2017 13:50:52 +0800
Subject: [PATCH] x86/apic: Fix a warning message in logical CPU IDs allocation

The current warning message in allocate_logical_cpuid() is somewhat confusing:

  Only 1 processors supported.Processor 2/0x2 and the rest are ignored.

As it might imply that there's only one CPU in the system - while what we ran
into here is a kernel limitation.

Fix the warning message to clarify all that:

  APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2 and the rest 
are ignored.

( Also update the error return from -1 to -EINVAL, which is the more
  canonical return value. )

Signed-off-by: Dou Liyang 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: b...@alien8.de
Cc: nicsta...@gmail.com
Cc: wanpeng...@hotmail.com
Link: 
http://lkml.kernel.org/r/1488261052-25753-1-git-send-email-douly.f...@cn.fujitsu.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 4261b3282ad9..11088b86e5c7 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)
 
/* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) {
-   WARN_ONCE(1, "Only %d processors supported."
+   WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 "Processor %d/0x%x and the rest are ignored.\n",
-nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-   return -1;
+nr_cpu_ids, nr_logical_cpuids, apicid);
+   return -EINVAL;
}
 
cpuid_to_apicid[nr_logical_cpuids] = apicid;


[PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-02-27 Thread Dou Liyang
Current warning message regarded the "nr_cpu_ids - 1" as the limit
number of the CPUs. It may be confused us, for example:
we have two CPUs, nr_cpu_ids = 2, but the warning message may
indicate that we just have 1 CPU, which likes that:
Only 1 processors supported.Processor 2/0x2 and the rest
are ignored.

Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
And the warning message can be like that:
APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
and the rest are ignored.

Signed-off-by: Dou Liyang 
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 8567c85..fcdd15e 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)
 
/* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) {
-   WARN_ONCE(1, "Only %d processors supported."
+   WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 "Processor %d/0x%x and the rest are ignored.\n",
-nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-   return -1;
+nr_cpu_ids, nr_logical_cpuids, apicid);
+   return -EINVAL;
}
 
cpuid_to_apicid[nr_logical_cpuids] = apicid;
-- 
2.5.5





[PATCH] x86/acpi: Fix a warning message in logical CPU IDs allocation

2017-02-27 Thread Dou Liyang
Current warning message regarded the "nr_cpu_ids - 1" as the limit
number of the CPUs. It may be confused us, for example:
we have two CPUs, nr_cpu_ids = 2, but the warning message may
indicate that we just have 1 CPU, which likes that:
Only 1 processors supported.Processor 2/0x2 and the rest
are ignored.

Fix the warning message, replace "nr_cpu_ids - 1" with "nr_cpu_ids".
And the warning message can be like that:
APIC: NR_CPUS/possible_cpus limit of 2 reached. Processor 2/0x2
and the rest are ignored.

Signed-off-by: Dou Liyang 
---
 arch/x86/kernel/apic/apic.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 8567c85..fcdd15e 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2062,10 +2062,10 @@ static int allocate_logical_cpuid(int apicid)
 
/* Allocate a new cpuid. */
if (nr_logical_cpuids >= nr_cpu_ids) {
-   WARN_ONCE(1, "Only %d processors supported."
+   WARN_ONCE(1, "APIC: NR_CPUS/possible_cpus limit of %i reached. "
 "Processor %d/0x%x and the rest are ignored.\n",
-nr_cpu_ids - 1, nr_logical_cpuids, apicid);
-   return -1;
+nr_cpu_ids, nr_logical_cpuids, apicid);
+   return -EINVAL;
}
 
cpuid_to_apicid[nr_logical_cpuids] = apicid;
-- 
2.5.5