Re: [PATCH 1/5] x86/smpboot: Add the missing description of possible_cpus

2018-03-21 Thread Dou Liyang
At 03/21/2018 05:34 PM, Dou Liyang wrote: Hi Peter, At 03/21/2018 05:08 PM, Peter Zijlstra wrote: On Wed, Mar 21, 2018 at 01:33:24PM +0800, Dou Liyang wrote: How about: possible_cpus=    [s390,x86_64] Set the number of possible CPUs which     are determined by the ACPI tables MADT or

Re: [RFC PATCH] x86/acpi: Prevent x2apic id -1 from being accounted

2018-04-08 Thread Dou Liyang
is invalid, we should prevent it from being accounted > This fixes a bug that Purley platform displays too many possible cpu Signed-off-by: Li RongQing Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Dou Liyang --- arch/x86/include/asm/apic.h | 4 ++-- arch/x86/kernel/acpi/

Re: [PATCH] genirq: only scan the present CPUs

2018-04-08 Thread Dou Liyang
Hi Peter, At 04/06/2018 05:05 PM, Peter Zijlstra wrote: On Fri, Apr 06, 2018 at 11:02:28AM +0200, Peter Zijlstra wrote: On Fri, Apr 06, 2018 at 04:42:14PM +0800, Dou Liyang wrote: Hi Thomas, Peter, At 04/03/2018 07:23 PM, Peter Zijlstra wrote: On Tue, Apr 03, 2018 at 12:25:56PM +0200

Re: 答复: [RFC PATCH] x86/acpi: Prevent x2apic id -1 from being accounted

2018-04-09 Thread Dou Liyang
RongQing, At 04/09/2018 02:38 PM, Li,Rongqing wrote: -邮件原件- 发件人: Dou Liyang [mailto:douly.f...@cn.fujitsu.com] 发送时间: 2018年4月9日 13:38 收件人: Li,Rongqing ; linux-kernel@vger.kernel.org; t...@linutronix.de; mi...@redhat.com; h...@zytor.com; jgr...@suse.com; x...@kernel.org; pet

Re: 答复: 答复: [RFC PATCH] x86/acpi: Prevent x2apic id -1 from being accounted

2018-04-09 Thread Dou Liyang
if id is larger than 0x7fff, this is wrong and if local_apic_id is invalid, we should prevent it from being accounted This fixes a bug that Purley platform displays too many possible cpu Signed-off-by: Li RongQing Suggested-by:: Dou Liyang

irqdesc: Why the "__ref" is needed in __irq_alloc_descs() ?

2018-03-08 Thread Dou Liyang
Hi Maintainers, I have a question about "__ref" in Linux kernel. When I looked into the __irq_alloc_descs(), I found it tagged a "__ref" mark, but I didn't find that it referenced code or data from init section. So, I confuse why the "__ref" is needed in __irq_alloc_descs()? any other reasons?

Re: [PATCH V3 0/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-03-13 Thread Dou Liyang
Hi All, At 03/13/2018 05:35 PM, Rafael J. Wysocki wrote: On Tue, Mar 13, 2018 at 9:39 AM, Artem Bityutskiy wrote: On Tue, 2018-03-13 at 16:35 +0800, Ming Lei wrote: Then looks this issue need to fix by making possible CPU count accurate because there are other resources allocated according to

Re: [PATCH V3 0/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-03-13 Thread Dou Liyang
Hi Rafael, Thank you so much for your reply. At 03/13/2018 05:25 PM, Rafael J. Wysocki wrote: On Tue, Mar 13, 2018 at 4:11 AM, Dou Liyang wrote: Hi Thomas, At 03/09/2018 11:08 PM, Thomas Gleixner wrote: [...] I'm not sure if there is a clear indicator whether physcial hotpl

Re: [PATCH V3 0/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-03-13 Thread Dou Liyang
Hi Artem, At 03/14/2018 11:29 AM, Dou Liyang wrote: Hi All, At 03/13/2018 05:35 PM, Rafael J. Wysocki wrote: On Tue, Mar 13, 2018 at 9:39 AM, Artem Bityutskiy wrote: On Tue, 2018-03-13 at 16:35 +0800, Ming Lei wrote: Then looks this issue need to fix by making possible CPU count accurate

Re: [PATCH V3 0/4] genirq/affinity: irq vector spread among online CPUs as far as possible

2018-03-14 Thread Dou Liyang
Hi Artern, At 03/14/2018 05:07 PM, Artem Bityutskiy wrote: On Wed, 2018-03-14 at 12:11 +0800, Dou Liyang wrote: At 03/13/2018 05:35 PM, Rafael J. Wysocki wrote: On Tue, Mar 13, 2018 at 9:39 AM, Artem Bityutskiy Longer term, yeah, I agree. Kernel's notion of possible CPU count shou

[RFC PATCH] ACPI / processor: Get accurate possible CPU count

2018-03-14 Thread Dou Liyang
possible CPU count from the number of Local APIC entries in ACPI MADT. It doesn't consider with the ACPI namespace and reports unrealistically high numbers. Depth-first search the namespace tree, check and collect the correct CPUs and update the possible map Signed-off-by: Dou Liyang --- dr

[RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure

2018-11-28 Thread Dou Liyang
which allows to expand this in the future without touching all the functions ever again, just modify the data irq_affinity_desc structure. Reported-by: Kashyap Desai Reported-by: Sumit Saxena Suggested-by: Thomas Gleixner Signed-off-by: Dou Liyang --- Changelog: v2 --> v3 - Crea

Re: [RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure

2018-11-29 Thread Dou Liyang
Hi Bjorn, on 2018/11/29 4:00, Bjorn Helgaas wrote: [+cc linux-pci] Since you mention reports, are there URLs to mailing list archives you can include? OK, I will add it: https://marc.info/?l=linux-kernel&m=153543887027997&w=2 - entry = alloc_msi_entry(&dev->dev, nvec, masks); + e

Re: [RFC PATCH v3] genirq/affinity: Create and transfer more irq desc info by a new structure

2018-11-29 Thread Dou Liyang
Hi Thomas, On 2018/11/29 6:03, Thomas Gleixner wrote: + affi_desc = kcalloc(nvec, sizeof(*affi_desc), GFP_KERNEL); Why do you want to do that separate allocation here? Just let I thought the irq_create_affinity_desc() also can be called by other functions which may convert cp

[PATCH 3/3] irq/affinity: Fix a possible breakage

2018-12-04 Thread Dou Liyang
In case of irq_default_affinity != cpu_possible_mask, setting the affinity for the pre/post vectors to irq_default_affinity is a breakage. Just set the pre/post vectors to cpu_possible_mask and be done with it. Suggested-by: Thomas Gleixner Signed-off-by: Dou Liyang --- kernel/irq/affinity.c

[PATCH 2/3] irq/affinity: Add is_managed into struct irq_affinity_desc

2018-12-04 Thread Dou Liyang
y should be mapped as unmanaged interrupts. So, only transfering the irq affinity assignments is not enough. Add a new bit "is_managed" to convey the info in irq_affinity_desc and use it in alloc_descs(). Reported-by: Kashyap Desai Reported-by: Sumit Saxena Signed-off-by: Dou Liyang

[PATCH 1/3] genirq/core: Add a new interrupt affinity descriptor

2018-12-04 Thread Dou Liyang
spreading managed flags. Suggested-by: Thomas Gleixner Suggested-by: Bjorn Helgaas Signed-off-by: Dou Liyang --- drivers/pci/msi.c | 9 - include/linux/interrupt.h | 14 -- include/linux/irq.h | 6 -- include/linux/irqdomain.h | 6 -- include/linux/msi.h

[PATCH 0/3] irq/core: Fix and expand the irq affinity descriptor

2018-12-04 Thread Dou Liyang
is_managed : 1; | | }; | | | +--+ [1]:https://marc.info/?l=linux-kernel&m=153543887027997&w=2 Dou Liyang (3): genirq/affinity: Add a new interrupt affinity descriptor irq/

[RFC PATCH v2] gen/irq: Change the way to differentiate between managed and unmanaged interrupts by bitmap

2018-11-09 Thread Dou Liyang
can't both seting the affinity mask and the managed flag. So, decouple the managed flag from the affinity mask, add a new bitmap to differentiate between managed and unmanaged interrupts. Reported-by: Kashyap Desai Reported-by: Sumit Saxena Suggested-by: Thomas Gleixner Signed-off

Re: [PATCH 0/1] Remove the check of duplicate processors

2018-05-28 Thread Dou Liyang
Hi Rafael, At 05/28/2018 04:40 PM, Rafael J. Wysocki wrote: Can you please resend the patch with the above information in the changelog of it? Yes, I resend the patch right now. That would make it easier to review and discuss it. Also I think that we need some sort of a check against dup

[RESEND RFC PATCH] acpi/processor: Remove the check of duplicate processors

2018-05-28 Thread Dou Liyang
failedsuccess the others processor(ID=89) hot-add failed failed So, Remove the check code. Signed-off-by: Dou Liyang Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 126 -

[PATCH] x86/vector: Fix the args of vector_alloc tracepoint

2018-05-31 Thread Dou Liyang
The vector_alloc tracepont reversed the reserved and ret aggs, that made the trace print wrong. Exchange them. Signed-off-by: Dou Liyang --- arch/x86/include/asm/trace/irq_vectors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/trace/irq_vectors.h b

[PATCH 0/1] Remove the check of duplicate processors

2018-05-17 Thread Dou Liyang
case: Before the patch, After the patch the first processor(ID=89) hot-addfailedsuccess the others processor(ID=89) hot-add failedfailed So, What's your idea about

[RFC PATCH 1/1] acpi/processor: Remove the check of duplicate processors

2018-05-17 Thread Dou Liyang
f the duplicate processor, the others can be ignored). So, Remove the check code. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 126 -- include/linux/acpi.h | 3 - 2 files changed, 129 deletions(-) diff --git a/drivers

Re: [PATCH 3/3] irq/affinity: Fix a possible breakage

2018-12-11 Thread Dou Liyang
Hi tglx, on 2018/12/5 16:28, Thomas Gleixner wrote: On Tue, 4 Dec 2018, Dou Liyang wrote: In case of irq_default_affinity != cpu_possible_mask, setting the affinity for the pre/post vectors to irq_default_affinity is a breakage. Why so? All interrupts which are not managed get te default

Re: [PATCH v3 2/2] irq/matrix: Spread managed interrupts on allocation

2018-09-18 Thread Dou Liyang
Dear Thomas, On 2018/9/17 23:32, Thomas Gleixner wrote: [...] I think it's still worthwhile to do that, but the changelog needs a major overhaul as right now it's outright misleading. I'll just amend it with something along the above lines, unless someone disagrees. Yeah, Yes, right, I was wr

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-16 Thread Dou Liyang
At 07/13/2018 07:30 PM, Pavel Tatashin wrote: On Fri, Jul 13, 2018 at 3:24 AM Dou Liyang wrote: At 07/12/2018 08:04 AM, Pavel Tatashin wrote: During boot tsc is calibrated twice: once in tsc_early_delay_calibrate(), and the second time in tsc_init(). Rename tsc_early_delay_calibrate

Re: [PATCH v13 13/18] x86/tsc: calibrate tsc only once

2018-07-17 Thread Dou Liyang
At 07/16/2018 09:35 PM, Pavel Tatashin wrote: [...] v13 has xen patches, so xen timestamps work early as well now. Oops, yes, my mistake. I will test the patchset with Thomas's kvm patch for you. Thanks, dou Thank you, Pavel

Re: [PATCH 4/5] acpi/processor: Fix the return value of acpi_processor_ids_walk()

2018-05-22 Thread Dou Liyang
At 05/22/2018 09:47 AM, Dou Liyang wrote: At 05/19/2018 11:06 PM, Thomas Gleixner wrote: On Tue, 20 Mar 2018, Dou Liyang wrote: ACPI driver should make sure all the processor IDs in their ACPI Namespace are unique for CPU hotplug. the driver performs a depth-first walk of the namespace

[PATCH v2] x86/idt: Simplify the idt_setup_apic_and_irq_gates()

2018-05-22 Thread Dou Liyang
set at the first step. Simplify the second step, make it just work for APIC=y. Signed-off-by: Dou Liyang --- arch/x86/kernel/idt.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index 2c3a1b4294eb..74383a3780dc 100644 --- a

Re: [tip:x86/apic 1/2] arch/x86/kernel/apic/apic.c:1507:2: error: 'i' undeclared

2018-02-28 Thread Dou Liyang
*/ early_per_cpu(x86_cpu_to_logical_apicid, cpu) = logical_smp_processor_id(); Thanks, dou arch/x86/kernel/apic/apic.c:1507:2: note: each undeclared identifier is reported only once for each function it appears in vim +/i +1507 arch/x86/kernel/apic/apic.c 2066f4d6 arch/x86/kernel/a

[PATCH v5 0/3] Make setup_local_APIC() clear

2018-02-28 Thread Dou Liyang
This is a tiny cleanup patchset for setup_local_APIC(). Dou Liyang (3): x86/apic: Move pending intr check code into it's own function x86/apic: Replace common tools with new ones x86/apic: Drop the logical_smp_processor_id() arch/x86/include/asm/smp.h | 10 - arch/x86/kernel

[PATCH v5 2/3] x86/apic: Replace common tools with new ones

2018-02-28 Thread Dou Liyang
The pending interrupt check code is old, update the following. -Replace for-if pair with for_each_set_bit() -Replace printk() with pr_err() Also merge the printk's code in one line and make curly braces balanced Suggested-by: Andy Shevchenko Signed-off-by: Dou Liyang Reviewed-by:

[PATCH v5 3/3] x86/apic: Drop the logical_smp_processor_id()

2018-02-28 Thread Dou Liyang
The logical_smp_processor_id() which is only called in setup_local_APIC() on x86_32 system looks redundant. Drop it, then directly use GET_APIC_LOGICAL_ID() marco and more suitable variable name for readability Signed-off-by: Dou Liyang --- arch/x86/include/asm/smp.h | 10 -- arch/x86

[PATCH v5 1/3] x86/apic: Move pending intr check code into it's own function

2018-02-28 Thread Dou Liyang
the pending interrupt check code is mixed with the local APIC setup code, that looks messy. Extract the related code, move it into a new function named apic_pending_intr_clear(). Signed-off-by: Dou Liyang Reviewed-by: Andy Shevchenko --- changelog: v4 --> v5: - Fix undeclared '

[PATCH] x86/processor: Remove two legacy function declaration

2018-04-03 Thread Dou Liyang
the early_trap_init() and cpu_set_gdt() have been abandoned, so remove them. Signed-off-by: Dou Liyang --- arch/x86/include/asm/processor.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index b0ccd4847a58..3ef3221107c3

Re: [PATCH v9 0/5] x86/KASLR: Add parameter kaslr_boot_mem=nn[KMG]@ss[KMG]

2018-03-28 Thread Dou Liyang
Hi Ingo, Kees, Baoquan and Chao At 03/12/2018 06:57 PM, Ingo Molnar wrote: [...] So there's apparently a mis-design here: - KASLR needs to be done very early on during bootup: - it's not realistic to expect KASLR to be done with a booted up kernel, because pointers to various KASLR-ed

Re: recent patch "x86/acpi: Prevent X2APIC id 0xffffffff from being accounted"

2018-04-27 Thread Dou Liyang
Hi Jan, At 04/27/2018 03:21 PM, Jan Beulich wrote: Hello, I've just stumbled across this commit, and I'm wondering if that's actually correct (I too have at least one system where such IDs are reported in MADT): For offline/absent CPUs, the firmware may not know the APIC IDs The MADT table is

Re: recent patch "x86/acpi: Prevent X2APIC id 0xffffffff from being accounted"

2018-05-01 Thread Dou Liyang
At 04/27/2018 08:09 PM, Jan Beulich wrote: On 27.04.18 at 10:32, wrote: At 04/27/2018 03:21 PM, Jan Beulich wrote: I've just stumbled across this commit, and I'm wondering if that's actually correct (I too have at least one system where such IDs are reported in MADT): For offline/absent CPUs

Re: recent patch "x86/acpi: Prevent X2APIC id 0xffffffff from being accounted"

2018-05-02 Thread Dou Liyang
Hi Jan, At 05/02/2018 02:39 PM, Jan Beulich wrote: On 02.05.18 at 03:56, wrote: At 04/27/2018 08:09 PM, Jan Beulich wrote: I'm afraid I don't understand: Limiting the number of disabled CPUs is certainly desirable when those can never be used, but why would you want to do this when they might

Re: WARNING and PANIC in irq_matrix_free

2018-06-04 Thread Dou Liyang
Hi Thomas, Sorry to ask the questions at this series, my mailbox was kicked out of the mailing list a few days ago, and didn't receive the e-mail. please see below At 05/29/2018 04:09 AM, Thomas Gleixner wrote: On Mon, 28 May 2018, Song Liu wrote: This doesn't fix the issue with bnxt. Here is

Re: WARNING and PANIC in irq_matrix_free

2018-06-04 Thread Dou Liyang
Hi Thomas, At 06/04/2018 07:17 PM, Thomas Gleixner wrote: On Mon, 4 Jun 2018, Dou Liyang wrote: Here, why didn't we avoid this cleanup by diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index a75de0792942..0cc59646755f 100644 --- a/arch/x86/kernel/apic/vec

Re: [patch 2/8] genirq/generic_pending: Do not lose pending affinity update

2018-06-05 Thread Dou Liyang
Hi Thomas, At 06/04/2018 11:33 PM, Thomas Gleixner wrote: The generic pending interrupt mechanism moves interrupts from the interrupt handler on the original target CPU to the new destination CPU. This is required for x86 and ia64 due to the way the interrupt delivery and acknowledge works if th

Re: [patch 3/8] x86/apic: Provide apic_ack_irq()

2018-06-05 Thread Dou Liyang
Hi Thomas, At 06/04/2018 11:33 PM, Thomas Gleixner wrote: apic_ack_edge() is explicitely for handling interrupt affinity cleanup when interrupt remapping is not available or disable. Remapped interrupts and also some of the platform specific special interrupts, e.g. UV, invoke ack_APIC_irq() di

Re: [patch 3/8] x86/apic: Provide apic_ack_irq()

2018-06-05 Thread Dou Liyang
Hi Thomas, At 06/05/2018 07:41 PM, Thomas Gleixner wrote: On Tue, 5 Jun 2018, Dou Liyang wrote: +{ + if (unlikely(irqd_is_setaffinity_pending(irqd))) Affinity pending is also judged in + irq_move_irq(irqd); If we can remove the if(...) statement here That requires

Re: [patch 3/8] x86/apic: Provide apic_ack_irq()

2018-06-06 Thread Dou Liyang
Hi Thomas, At 06/06/2018 04:04 PM, Thomas Gleixner wrote: On Wed, 6 Jun 2018, Dou Liyang wrote: Hi Thomas, At 06/05/2018 07:41 PM, Thomas Gleixner wrote: On Tue, 5 Jun 2018, Dou Liyang wrote: +{ + if (unlikely(irqd_is_setaffinity_pending(irqd))) Affinity pending is also judged in

[PATCH] x86/vector: Remove the macro VECTOR_OFFSET_START

2018-04-24 Thread Dou Liyang
Now, Linux uses matrix allocator for vector assignment, the original assignment code which used VECTOR_OFFSET_START has been removed. So remove the stale macro as well Signed-off-by: Dou Liyang --- arch/x86/include/asm/irq_vectors.h | 5 - 1 file changed, 5 deletions(-) diff --git a/arch

[PATCH] x86/idt: Simplify the idt_setup_apic_and_irq_gates()

2018-04-25 Thread Dou Liyang
mplex. Remove the code of the X86_LOCAL_APIC=n case to simplify it. Signed-off-by: Dou Liyang --- arch/x86/kernel/idt.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index 2c3a1b4294eb..8b4174890706 100644 --- a/arc

[PATCH] x86/vector: Remove the unused macro FPU_IRQ

2018-04-25 Thread Dou Liyang
The macro FPU_IRQ has never been used since v3.10, So remove it. Signed-off-by: Dou Liyang --- arch/x86/include/asm/irq_vectors.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 57003074bd7a..548d90bbf919 100644

[RFC PATCH] irq/affinity: Mark the pre/post vectors as regular interrupts

2018-09-12 Thread Dou Liyang
From: Dou Liyang As Kashyap and Sumit reported, in MSI/-x subsystem, the pre/post vectors may be used to some extra reply queues for performance. the best way to map the pre/post vectors is map them to the local numa node. But, current Linux can't do that, because The pre and post ve

Re: [PATCH] sched/core: Fix compiling warring in smp=n case

2018-09-13 Thread Dou Liyang
At 08/10/2018 10:35 AM, Dou Liyang wrote: When compiling kernel with SMP disabled, the build warns with: kernel/sched/core.c: In function ‘update_rq_clock_task’: kernel/sched/core.c:139:17: warning: unused variable ‘irq_delta’ [-Wunused-variable] s64 steal = 0, irq_delta = 0; Fix this

[PATCH 2/2] irq/matrix: Spread managed interrupts on allocation

2018-09-07 Thread Dou Liyang
From: Dou Liyang Linux has spread out the non managed interrupt across the possible target CPUs to avoid vector space exhaustion. But, the same situation may happen on the managed interrupts. Spread managed interrupt on allocation as well. Fixes: a0c9259dc4e1("irq/matrix: Spread interrup

[PATCH 1/2] irq/matrix: Split out the CPU finding code into a helper

2018-09-07 Thread Dou Liyang
From: Dou Liyang Linux finds the CPU which has the lowest vector allocation count to spread out the non managed interrupt across the possible target CPUs. This common CPU finding code will also be used in managed case, So Split it out into a helper for preparation. Signed-off-by: Dou Liyang

Re: [RFC PATCH] irq/affinity: Mark the pre/post vectors as regular interrupts

2018-09-20 Thread Dou Liyang
Hi Kashyap, On 2018/9/20 16:39, Kashyap Desai worte: Dou - Do you want me to test your patch or shall I wait for next version ? I'm sorry, please wait for the next version. Thanks, dou

[PATCH v2 1/2] irq/matrix: Split out the CPU finding code into a helper

2018-09-08 Thread Dou Liyang
From: Dou Liyang Linux finds the CPU which has the lowest vector allocation count to spread out the non managed interrupt across the possible target CPUs. This common CPU finding code will also be used in managed case, So Split it out into a helper for preparation. Signed-off-by: Dou Liyang

[PATCH v2 2/2] irq/matrix: Spread managed interrupts on allocation

2018-09-08 Thread Dou Liyang
From: Dou Liyang Linux has spread out the non managed interrupt across the possible target CPUs to avoid vector space exhaustion. But, the same situation may happen on the managed interrupts. Spread managed interrupt on allocation as well. Fixes: a0c9259dc4e1("irq/matrix: Spread interrup

[PATCH v3 2/2] irq/matrix: Spread managed interrupts on allocation

2018-09-08 Thread Dou Liyang
From: Dou Liyang Linux has spread out the non managed interrupt across the possible target CPUs to avoid vector space exhaustion. But, the same situation may happen on the managed interrupts. Spread managed interrupt on allocation as well. Note: also change the return value for the empty

[PATCH v3 1/2] irq/matrix: Split out the CPU finding code into a helper

2018-09-08 Thread Dou Liyang
From: Dou Liyang Linux finds the CPU which has the lowest vector allocation count to spread out the non managed interrupt across the possible target CPUs. This common CPU finding code will also be used in managed case, So Split it out into a helper for preparation. Signed-off-by: Dou Liyang

Re: [PATCH 4/5] acpi/processor: Fix the return value of acpi_processor_ids_walk()

2018-05-21 Thread Dou Liyang
At 05/19/2018 11:06 PM, Thomas Gleixner wrote: On Tue, 20 Mar 2018, Dou Liyang wrote: ACPI driver should make sure all the processor IDs in their ACPI Namespace are unique for CPU hotplug. the driver performs a depth-first walk of the namespace tree and calls the acpi_processor_ids_walk

Re: [PATCH] x86/idt: Simplify the idt_setup_apic_and_irq_gates()

2018-05-21 Thread Dou Liyang
Hi Thomas, At 05/19/2018 08:32 PM, Thomas Gleixner wrote: On Thu, 26 Apr 2018, Dou Liyang wrote: The vectors between FIRST_SYSTEM_VECTOR and NR_VECTORS are special IRQ vectors used by the SMP architecture. But, if X86_LOCAL_APIC=n, it will not be used, and the FIRST_SYSTEM_VECTOR is equal to

[RESEND PATCH] x86/boot/KASLR: Extend movable_node option for KASLR

2018-04-02 Thread Dou Liyang
t kernel to be randomized in the home node by adding a parameter. this parameter sets up the boundaries between the home nodes and other nodes. Reported-by: Chao Fan Signed-off-by: Dou Liyang Reviewed-by: Kees Cook --- Changelog: -Rewrite the commit log and document. Documentation/admin-gu

Re: [ACPI / processor] d619c81e24: WARNING:at_include/linux/cpumask.h:#cpumask_test_cpu

2018-03-18 Thread Dou Liyang
ux/commits/Dou-Liyang/ACPI-processor-Get-accurate-possible-CPU-count/20180316-140349 in testcase: boot on test machine: qemu-system-x86_64 -enable-kvm -cpu host -smp 2 -m 1G caused below changes (please refer to attached dmesg/kmsg for entire log

[PATCH] x86/vector: Merge the allocate_vector() into assign_vector_locked()

2018-05-11 Thread Dou Liyang
x27;s pointless. Merge the two function to avoid this situation and make the code simplify. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/vector.c | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vec

Re: [RFC PATCH] ACPI / processor: Get accurate possible CPU count

2018-03-14 Thread Dou Liyang
Hi Andy, At 03/15/2018 01:24 AM, Andy Shevchenko wrote: On Wed, Mar 14, 2018 at 12:28 PM, Dou Liyang wrote: +static void __init acpi_update_possible_map(void) +{ + unsigned int cpu, nr = 0; + + if (nr_cpu_ids <= nr_unique_ids) + ret

[RFC PATCH v2] ACPI / processor: Fix possible CPUs map

2018-03-14 Thread Dou Liyang
Depth-first search the namespace tree, check and collect the correct CPUs and update the possible map. Signed-off-by: Dou Liyang --- Changelog v1 --> v2: -Optimize the code by Andy Shevchenko's suggestion -modify the changelog drivers/acpi/acpi_processor.c | 21 + 1

Re: [RFC PATCH v2] ACPI / processor: Fix possible CPUs map

2018-03-15 Thread Dou Liyang
Hi Thomas, At 03/15/2018 09:45 PM, Thomas Gleixner wrote: [...] I tested this on a machine which claims to have gazillion of hotplugable CPUs: I really appreciate your test. smpboot: Allowing 152 CPUs, 120 hotplug CPUs setup_percpu: NR_CPUS:512 nr_cpumask_bits:512 nr_cpu_id

Re: linux-next: build warning after merge of the tip tree

2018-03-15 Thread Dou Liyang
Hi Stephen, At 03/16/2018 01:37 PM, Stephen Rothwell wrote: Hi all, After merging the tip tree, yesterday's linux-next build (x86_64 allnoconfig) produced this warning: kernel/cpu.c:129:13: warning: 'cpuhp_is_ap_state' defined but not used [-Wunused-function] static bool cpuhp_is_ap_state(e

Re: linux-next: build warning after merge of the tip tree

2018-03-15 Thread Dou Liyang
Hi Stephen, At 03/16/2018 01:52 PM, Dou Liyang wrote: Hi Stephen, At 03/16/2018 01:37 PM, Stephen Rothwell wrote: Hi all, After merging the tip tree, yesterday's linux-next build (x86_64 allnoconfig) produced this warning: kernel/cpu.c:129:13: warning: 'cpuhp_is_ap_state'

[PATCH] kernel/cpu: Move cpuhp_is_atomic_state() into #ifdef CONFIG_SMP

2018-03-15 Thread Dou Liyang
by: Stephen Rothwell Signed-off-by: Dou Liyang --- kernel/cpu.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a1860d42aacf..db7ec7572348 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -126,15 +126,6 @@ struct cpuhp_step {

Re: [PATCH] kernel/cpu: Move cpuhp_is_atomic_state() into #ifdef CONFIG_SMP

2018-03-16 Thread Dou Liyang
At 03/16/2018 03:59 PM, Thomas Gleixner wrote: On Fri, 16 Mar 2018, Dou Liyang wrote: Commit 17a2f1ced028 ("cpu/hotplug: Merge cpuhp_bp_states and cpuhp_ap_states") removed the last use of cpuhp_is_atomic_state() in common case, that caused Kernel produced a warning: 'cp

Re: [RESEND PATCH] x86/boot/KASLR: Extend movable_node option for KASLR

2018-04-18 Thread Dou Liyang
t physical NUMA Node hotplug, and we can't get memory hotplug info from ACPI SRAT earlier now(If we can do that, we even can remove the 'movable_node' option). So, IMO, extend movable_node to replace the misuse of 'mem' option. Thought? Thanks, dou At 04/

[PATCH v2] x86/apic: Fix two typos in comments

2017-01-05 Thread Dou Liyang
s/ID/IDs/ s/inr_logical_cpuidi/nr_logical_cpuids/ s/generic_processor_info()/__generic_processor_info()/ 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

Re: [PATCH] x86/apic: Fix two typos in comments

2017-01-05 Thread Dou Liyang
Hi, Ingo At 01/05/2017 04:15 PM, Ingo Molnar wrote: * Dou Liyang wrote: s/inr_logical_cpuidi/nr_logical_cpuids/ s/generic_processor_info()/__generic_processor_info()/ Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH v8 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-07-19 Thread Dou Liyang
s step 4. This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled processors at boot time via an additional acpi namespace walk for processors. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/ia64/kernel/ac

[PATCH v8 3/7] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-07-19 Thread Dou Liyang
<-> apicid mapping is established at local apic registeration time. But non-present or disabled cpus are ignored. In this patch, we establish all possible cpuid <-> apicid mapping when registering local apic. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-

[PATCH v8 2/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-07-19 Thread Dou Liyang
27; apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch finished s

[PATCH v8 6/7] Provide the mechanism to validate processors in the ACPI tables

2016-07-19 Thread Dou Liyang
both of them as being unreasonable; The function will record the unique or duplicate processor IDs. The duplicate processor IDs such as 89 are regarded as the unreasonable IDS which mean that the processor objects in question are not valid. Signed-off-by: D

[PATCH v8 4/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-07-19 Thread Dou Liyang
control if disabled processors are ignored. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 5 +++- drivers/acpi/processor_core.c | 57 +++ 2 files changed, 40

[PATCH v8 1/7] x86, memhp, numa: Online memory-less nodes at boot time.

2016-07-19 Thread Dou Liyang
hen cpus on these memory-less nodes try to allocate memory from local node, it will automatically fall back to the proper zones in the zonelists. Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/x86/mm/numa.c | 27 +-- 1 file changed, 13 insertions(+), 14 deletio

[PATCH v8 7/7] Provide the interface to validate the proc_id which they give

2016-07-19 Thread Dou Liyang
establish all possible cpuid <-> nodeid mapping, we will use the proc_id from ACPI table. We do validation when we get the proc_id. If the result is true, we will stop the mapping. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 16 drivers/acpi/proce

[PATCH v8 0/7] Make cpuid <-> nodeid mapping persistent

2016-07-19 Thread Dou Liyang
emory-less nodes so that memory allocator will fall back to proper nodes automatically. Change log v1 -> v2: 1. Split code movement and actual changes. Add patch 1. 2. Synchronize best near online node record when node hotplug happens. In patch 2. 3. Fix some comment. Dou Liyang (2)

[PATCH v9 2/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-07-25 Thread Dou Liyang
27; apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch finished s

[PATCH v9 4/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-07-25 Thread Dou Liyang
control if disabled processors are ignored. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 5 +++- drivers/acpi/processor_core.c | 57 +++ 2 files changed, 40

[PATCH v9 3/7] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-07-25 Thread Dou Liyang
<-> apicid mapping is established at local apic registeration time. But non-present or disabled cpus are ignored. In this patch, we establish all possible cpuid <-> apicid mapping when registering local apic. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-

[PATCH v9 7/7] acpi: Provide the interface to validate the proc_id

2016-07-25 Thread Dou Liyang
. When we establish all possible cpuid <-> nodeid mapping to handle the cpu hotplugs, we will use the proc_id from ACPI table. We do validation when we get the proc_id. If the result is true, we will stop the mapping. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 16 ++

[PATCH v9 6/7] acpi: Provide the mechanism to validate processors in the ACPI tables

2016-07-25 Thread Dou Liyang
mark both of them as being unreasonable; The function will record the unique or duplicate processor IDs. The duplicate processor IDs such as 89 are regarded as the unreasonable IDs which mean that the processor objects in question are not valid. Signed-off-by: Dou Liyang --- drivers

[PATCH v9 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-07-25 Thread Dou Liyang
s step 4. This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled processors at boot time via an additional acpi namespace walk for processors. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/ia64/kernel/ac

[PATCH v9 0/7] Make cpuid <-> nodeid mapping persistent

2016-07-25 Thread Dou Liyang
before per cpu areas were initialized. Change log v2 -> v3: 1. Online memory-less nodes at boot time to map cpus of memory-less nodes. 2. Build zonelists for memory-less nodes so that memory allocator will fall back to proper nodes automatically. Change log v1 -> v2: 1. Split code movem

[PATCH v9 1/7] x86, memhp, numa: Online memory-less nodes at boot time.

2016-07-25 Thread Dou Liyang
As a result, when cpus on these memory-less nodes try to allocate memory from local node, it will automatically fall back to the proper zones in the zonelists. Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/x86/mm/numa.c | 27 +-- 1 file changed, 13 insert

Re: [PATCH v9 0/7] Make cpuid <-> nodeid mapping persistent

2016-07-25 Thread Dou Liyang
在 2016年07月26日 07:20, Andrew Morton 写道: On Mon, 25 Jul 2016 16:35:42 +0800 Dou Liyang wrote: [Problem] cpuid <-> nodeid mapping is firstly established at boot time. And workqueue caches the mapping in wq_numa_possible_cpumask in wq_numa_init() at boot time. When doing node online/o

[PATCH v10 0/7] Make cpuid <-> nodeid mapping persistent

2016-07-25 Thread Dou Liyang
g v2 -> v3: 1. Online memory-less nodes at boot time to map cpus of memory-less nodes. 2. Build zonelists for memory-less nodes so that memory allocator will fall back to proper nodes automatically. Change log v1 -> v2: 1. Split code movement and actual changes. Add patch 1. 2. Synchr

[PATCH v10 3/7] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-07-25 Thread Dou Liyang
<-> apicid mapping is established at local apic registeration time. But non-present or disabled cpus are ignored. In this patch, we establish all possible cpuid <-> apicid mapping when registering local apic. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-

[PATCH v10 1/7] x86, memhp, numa: Online memory-less nodes at boot time.

2016-07-25 Thread Dou Liyang
As a result, when cpus on these memory-less nodes try to allocate memory from local node, it will automatically fall back to the proper zones in the zonelists. Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/x86/mm/numa.c | 27 +-- 1 file changed, 13 insert

[PATCH v10 7/7] acpi: Provide the interface to validate the proc_id

2016-07-25 Thread Dou Liyang
. When we establish all possible cpuid <-> nodeid mapping to handle the cpu hotplugs, we will use the proc_id from ACPI table. We do validation when we get the proc_id. If the result is true, we will stop the mapping. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 16 ++

[PATCH v10 6/7] acpi: Provide the mechanism to validate processors in the ACPI tables

2016-07-25 Thread Dou Liyang
mark both of them as being unreasonable; The function will record the unique or duplicate processor IDs. The duplicate processor IDs such as 89 are regarded as the unreasonable IDs which mean that the processor objects in question are not valid. Signed-off-by: Dou Liyang --- drivers

[PATCH v10 4/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-07-25 Thread Dou Liyang
control if disabled processors are ignored. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 5 +++- drivers/acpi/processor_core.c | 57 +++ 2 files changed, 40

[PATCH v10 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-07-25 Thread Dou Liyang
s step 4. This patch set the persistent cpuid <-> nodeid mapping for all enabled/disabled processors at boot time via an additional acpi namespace walk for processors. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/ia64/kernel/ac

[PATCH v10 2/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-07-25 Thread Dou Liyang
27; apicid. This is also done by introducing an extra parameter to these apis to let the caller control if disabled cpus are ignored. 4. Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch finished s

Re: [PATCH v9 0/7] Make cpuid <-> nodeid mapping persistent

2016-07-26 Thread Dou Liyang
Hi, RJ 在 2016年07月26日 19:53, Rafael J. Wysocki 写道: On Tuesday, July 26, 2016 11:59:38 AM Dou Liyang wrote: 在 2016年07月26日 07:20, Andrew Morton 写道: On Mon, 25 Jul 2016 16:35:42 +0800 Dou Liyang wrote: [Problem] cpuid <-> nodeid mapping is firstly established at boot time. And wor

Re: [tip:x86/apic] x86/acpi: Introduce persistent storage for cpuid <-> apicid mapping

2016-10-06 Thread Dou Liyang
Hi Yinghai, At 10/06/2016 12:53 PM, Yinghai Lu wrote: On Wed, Oct 5, 2016 at 7:04 AM, Thomas Gleixner wrote: @@ -176,6 +177,11 @@ static int acpi_register_lapic(int id, u return -EINVAL; } +if (!enabled && (id == disabled_id)) { +++disabled_cpus; +return -EIN

<    1   2   3   4   5   6   >