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

2016-07-19 Thread Dou Liyang
在 2016年07月20日 02:53, Tejun Heo 写道: On Tue, Jul 19, 2016 at 03:28:08PM +0800, Dou Liyang wrote: When we want to identify whether the proc_id is unreasonable or not, we can call the "acpi_processor_validate_proc_id" function. It will search in the duplicate IDs. If we find the proc

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

2016-07-19 Thread Dou Liyang
在 2016年07月20日 04:06, Rafael J. Wysocki 写道: On Tuesday, July 19, 2016 03:28:06 PM Dou Liyang wrote: From: Gu Zheng The whole patch-set aims at making cpuid <-> nodeid mapping persistent. So that, when node online/offline happens, cache based on cpuid <-> nodeid mapp

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

2016-07-19 Thread Dou Liyang
在 2016年07月20日 02:50, Tejun Heo 写道: Hello, On Tue, Jul 19, 2016 at 03:28:02PM +0800, Dou Liyang wrote: In this series of patches, we are going to construct cpu <-> node mapping for all possible cpus at boot time, which is a 1-1 mapping. It means the 1-1 mapping means that each cpu is

Re: [x86-tip] strange nr_cpus= boot regression

2016-09-26 Thread Dou Liyang
AM, Thomas Gleixner wrote: CC'ed: Dou Liyang On Mon, 26 Sep 2016, Mike Galbraith wrote: I've encountered a strange regression in tip, symptom is that if you boot with nr_cpus=nr_you_have, what actually boots is nr_you_have/2. Do not pass nr_cpus=, and all is well. What's the n

Re: [PATCH] x86: Put the num_processors++ code in a more suitable position

2016-09-06 Thread Dou Liyang
Hi David, At 09/07/2016 05:23 AM, David Rientjes wrote: On Tue, 6 Sep 2016, Dou Liyang wrote: This is a code optimization. Not sure that it's optimization, it's just for correctness. Yes, I see. I will improve it in next version. Thanks, Dou If checking the topology pack

[PATCH v2] x86: Put the num_processors++ code in a more suitable position

2016-09-06 Thread Dou Liyang
processors incorrect. Just put the num_processors++ code in the more suitable position. it makes sure that the num-processors will not conflict with the disabled_cpus. Signed-off-by: Dou Liyang Acked-by: David Rientjes --- arch/x86/kernel/apic/apic.c | 4 +++- 1 file changed, 3 insertions(+), 1

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

2016-09-13 Thread Dou Liyang
Ping... At 09/02/2016 02:57 PM, Dou Liyang wrote: Ping... At 08/25/2016 04:35 PM, Dou Liyang wrote: [Summary] Use ACPI tables: MADT, DSDT. 1. Create cpuid in order based on Local Apic ID in MADT(apicid). 2. Obtain the nodeid by the proc_id in DSDT. 3. Make the cpuid <-> nodeid m

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

2016-09-01 Thread Dou Liyang
Ping... At 08/25/2016 04:35 PM, Dou Liyang wrote: [Summary] Use ACPI tables: MADT, DSDT. 1. Create cpuid in order based on Local Apic ID in MADT(apicid). 2. Obtain the nodeid by the proc_id in DSDT. 3. Make the cpuid <-> nodeid mapping persistent. The mapping relations: proc_id i

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

2016-08-08 Thread Dou Liyang
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. Synchronize best near online node record when node hotplug happens. In patch 2. 3. Fix some comment. Dou Liyang (2):

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

2016-08-08 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 v11 2/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-08-08 Thread Dou Liyang
Establish all possible cpuid <-> nodeid mapping. This is done via an additional acpi namespace walk for processors. This patch finished step 1. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/apic.c | 18 +

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

2016-08-08 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 v11 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-08-08 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 v11 4/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-08-08 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 v11 7/7] acpi: Provide the interface to validate the proc_id

2016-08-08 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 v11 3/7] x86, acpi, cpu-hotplug: Introduce cpuid_to_apicid[] array to store persistent cpuid <-> apicid mapping.

2016-08-08 Thread Dou Liyang
apic. Signed-off-by: Gu Zheng Signed-off-by: Tang Chen Signed-off-by: Zhu Guihua Signed-off-by: Dou Liyang --- arch/x86/include/asm/mpspec.h | 1 + arch/x86/kernel/acpi/boot.c | 7 + arch/x86/kernel/apic/apic.c | 61 --- 3 files changed, 60 i

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

2016-08-25 Thread Dou Liyang
reas 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 movement and actual changes

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

2016-08-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 v12 2/7] x86, acpi, cpu-hotplug: Enable acpi to register all possible cpus at boot time.

2016-08-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 v12 1/7] x86, memhp, numa: Online memory-less nodes at boot time.

2016-08-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 v12 6/7] acpi: Provide the mechanism to validate processors in the ACPI tables

2016-08-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 v12 5/7] x86, acpi, cpu-hotplug: Set persistent cpuid <-> nodeid mapping when booting.

2016-08-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 v12 7/7] acpi: Provide the interface to validate the proc_id

2016-08-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 v12 4/7] x86, acpi, cpu-hotplug: Enable MADT APIs to return disabled apicid.

2016-08-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 | 60 +++ 2 files changed, 42

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

2016-08-25 Thread Dou Liyang
Hi tglx, At 08/25/2016 04:35 PM, Dou Liyang wrote: arch/x86/kernel/apic/apic.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index cea4fc1..e5612a9 100644 --- a/arch/x86/kernel/apic/apic.c +++ b

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

2016-08-25 Thread Dou Liyang
35 PM, Dou Liyang wrote: [Summary] Use ACPI tables: MADT, DSDT. 1. Create cpuid in order based on Local Apic ID in MADT(apicid). 2. Obtain the nodeid by the proc_id in DSDT. 3. Make the cpuid <-> nodeid mapping persistent. The mapping relations: proc_id in DSDT <--> Processor

Re: [PATCH 06/11] s390/topology: Remove the unused parent_node() macro

2017-08-16 Thread Dou Liyang
Hi Heiko, At 07/27/2017 04:19 PM, Heiko Carstens wrote: On Wed, Jul 26, 2017 at 09:34:31PM +0800, Dou Liyang wrote: Commit a7be6e5a7f8d ("mm: drop useless local parameters of __register_one_node()") removes the last user of parent_node(). The parent_node() macro in S390 p

Re: [patch 19/55] genirq: Provide irq_fixup_move_pending()

2017-06-19 Thread Dou Liyang
Hi Thomas, At 06/20/2017 07:37 AM, Thomas Gleixner wrote: [...] +/** + * irq_fixup_move_pending - Cleanup irq move pending from a dying CPU + * @desc: Interrupt descpriptor to clean up + * @force_clear: If set clear the move pending bit unconditionally. + *

[PATCH v2] mm: Drop useless local parameters of __register_one_node()

2017-06-20 Thread Dou Liyang
Cc: Michal Hocko Cc: isimatu.yasu...@jp.fujitsu.com Signed-off-by: Dou Liyang Acked-by: David Rientjes --- V1 --> V2: Rebase it on git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm drivers/base/node.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/driv

[PATCH] x86/apic: Make init_legacy_irqs() __init

2017-06-21 Thread Dou Liyang
This function is only called by arch_early_irq_init() which is an `initialization' function, So mark it __init as well. In addition mark it inline for the X86_IO_APIC=n case. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 dele

[PATCH 2/2] x86/apic: Make arch_init_msi/htirq_domain __init

2017-06-21 Thread Dou Liyang
These two functions are only called by arch_early_irq_init() which is an `initialization' function, So mark them __init as well. Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/htirq.c | 2 +- arch/x86/kernel/apic/msi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --

[RFC PATCH v4 05/12] x86/ioapic: Refactor the delay logic in timer_irq_works()

2017-05-26 Thread Dou Liyang
f current single CPU. Signed-off-by: Dou Liyang --- V3 --> V4: -Rewrite the changelog -Delete a blank line v2 --> v3: -Find a new way to for waiting. -Reference to the realization of hpet_clocksource_register() by Thomas. arch/x86/kernel/apic/io_apic.c | 45

Re: [PATCH v7 1/6] x86/tsc: remove tsc_disabled flag

2017-11-02 Thread Dou Liyang
Hi Pavel, At 11/03/2017 01:26 AM, Pavel Tatashin wrote: tsc_disabled is set when notsc is passed as kernel parameter. The reason we have notsc is to avoid timing problems on multi-preccors systems. However, we already have a mechanism to detect and resolve these issues by invoking tsc unstable p

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-24 Thread Dou Liyang
Hi Juergen, At 10/23/2017 09:49 PM, Juergen Gross wrote: Don't try to set the static virt_spin_lock_key to a value before jump_label_init() has been called, as this will result in a WARN(). Solve the problem by introducing a new lock_init() hook called after jump_label_init() instead of doing t

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-25 Thread Dou Liyang
Hi Juergen, [...] I like your original method. So, I try to fix it by moving the native_pv_lock_init() from native_smp_prepare_boot_cpu() to native_smp_prepare_cpus(). Hmm, this might work, but the Xen case has to be modified (same for my more general solution), as xen_init_spinlocks() is sti

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-25 Thread Dou Liyang
Hi Juergen, How about moving the check of xen_pvspin into native_pv_lock_init() like below? This would leak xen_pvspin to non-Xen code. I'd rather do the Oops, yes, I made the mistake. Please ignore it. static_branch_disable() in xen_init_lock_cpu() if cpu == 0. Yes. I will test it. :-

Re: [PATCH v8 2/6] time: sync read_boot_clock64() with persistent clock

2017-11-12 Thread Dou Liyang
Hi Pavel, At 11/09/2017 11:01 AM, Pavel Tatashin wrote: read_boot_clock64() returns a boot start timestamp from epoch. Some arches may need to access the persistent clock interface in order to calculate the epoch offset. The resolution of the persistent clock, however, might be low. Therefore,

Re: [PATCH v8 6/6] x86/tsc: use tsc early

2017-11-12 Thread Dou Liyang
Hi Pavel, At 11/09/2017 11:02 AM, Pavel Tatashin wrote: This patch adds early clock feature to x86 platforms. tsc_early_init(): Determines offset, shift and multiplier for the early clock based on the TSC frequency. tsc_early_fini() Implement the finish part of early tsc feature, prints messag

Re: [PATCH v8 1/6] x86/tsc: remove tsc_disabled flag

2017-11-12 Thread Dou Liyang
path. Thus, make notsc to behave the same as tsc=unstable. Signed-off-by: Pavel Tatashin I am not sure if I could add the signature. Anyway, it looks good to me. Reviewed-by: Dou Liyang --- arch/x86/kernel/tsc.c | 19 +++ 1 file changed, 3 insertions(+), 16 deletions

[PATCH] timekeeping: Eliminate the useless declaration of ktime_get_raw_and_real_ts64()

2017-11-12 Thread Dou Liyang
Commit: ba26621e63ce ("time: Remove duplicated code in ktime_get_raw_and_real()") ... got rid of ktime_get_raw_and_real_ts64(), but left its declaration behind. Remove it. Signed-off-by: Dou Liyang --- include/linux/timekeeping.h | 6 -- 1 file changed, 6 deletions(-) di

Re: [PATCH v8 2/6] time: sync read_boot_clock64() with persistent clock

2017-11-14 Thread Dou Liyang
Hi Pavel, At 11/15/2017 03:57 AM, Pavel Tatashin wrote: why we should remove the *extern* keyword? Hi Dou, While, I am not sure why it was decided to stop using externs in headers, this is a warning printed by scripts/checkpatch.pl: CHECK: extern prototypes should be avoided in .h files To

Re: [PATCH v8 6/6] x86/tsc: use tsc early

2017-11-14 Thread Dou Liyang
Hi Pavel, At 11/15/2017 05:46 AM, Pavel Tatashin wrote: Hi Dou, Great comments, my replies below: static inline unsigned long long paravirt_sched_clock(void) { - return PVOP_CALL0(unsigned long long, pv_time_ops.sched_clock); + return PVOP_CALL0(unsigned long long, pv_time_ops.a

Re: [PATCH v7 6/6] x86/tsc: use tsc early

2017-11-02 Thread Dou Liyang
Hi Pavel, At 11/03/2017 01:26 AM, Pavel Tatashin wrote: tsc_early_init(): Determines offset, shift and multiplier for the early clock based on the TSC frequency. tsc_early_fini() Implement the finish part of early tsc feature, prints message about the offset, which can be useful to find out how

Re: [PATCH v6 1/4] sched/clock: interface to allow timestamps early in boot

2017-10-18 Thread Dou Liyang
;. Thanks, dou. At 09/29/2017 11:00 PM, Dou Liyang wrote: Hi, Pasha At 09/28/2017 09:11 PM, Pasha Tatashin wrote: It will be best if we can support TSC sync capability in x86, but seems is not easy. Sure, your hardware achieving sync would be best, but even if it does not, we can sti

Re: [PATCH] paravirt/locks: avoid modifying static key before jump_label_init()

2017-10-27 Thread Dou Liyang
a new lock_init() hook called after jump_label_init() instead of doing the call inside of smp_prepare_boot_cpu(). Signed-off-by: Juergen Gross --- Based on kernel/git/tip/tip.git locking/core Just a quick ping: what's the conclusion of the discussion, do we want this patch as-is? Dou Liy

[PATCH][tip] x86/paravirt: Make the virt_spin_lock_key setup after jump_label_init()

2017-10-27 Thread Dou Liyang
. Make the setup later to avoid the WARN(). Reported-by: Juergen Gross Suggested-by: Juergen Gross Signed-off-by: Dou Liyang --- arch/x86/kernel/smpboot.c | 3 ++- arch/x86/xen/smp_pv.c | 2 ++ arch/x86/xen/spinlock.c | 6 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git

[PATCH tip v2] x86/paravirt: Make the virt_spin_lock_key setup after jump_label_init()

2017-10-27 Thread Dou Liyang
), and set the value in xen_init_lock_cpu() to make the setup later and avoid the WARN(). Reported-by: Juergen Gross Suggested-by: Juergen Gross Signed-off-by: Dou Liyang Reviewed-by: Juergen Gross --- changelog: v1-->v2: remove the native_pv_lock_init() from xen_pv_smp_prepare_cp

[PATCH] irqdomain: Update the comments of fwnode field of irq_domain structure

2017-10-29 Thread Dou Liyang
Commit: f110711a6053 ("irqdomain: Convert irqdomain-%3Eof_node to fwnode") converted of_node field to fwnode, but didn't update its comments. Update it. Signed-off-by: Dou Liyang --- include/linux/irqdomain.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

Re: [locking/paravirt] static_key_disable_cpuslocked(): static key 'virt_spin_lock_key+0x0/0x20' used before call to jump_label_init()

2017-10-30 Thread Dou Liyang
Hi Fengguang, There are two different warning. At 10/30/2017 03:35 PM, Fengguang Wu wrote: On Sun, Oct 29, 2017 at 11:51:55PM +0100, Fengguang Wu wrote: Hi Linus, Up to now we see the below boot error/warnings when testing v4.14-rc6. The original warning: WARNING:at_arch/x86/events/intel/

Re: [PATCH v4 2/4] x86/boot: Add acpitb.c to parse acpi tables

2018-08-02 Thread Dou Liyang
At 07/23/2018 05:29 PM, Chao Fan wrote: Imitate the ACPI code to parse ACPI tables. Functions are simplified cause some operations are not needed here. And also, this method won't influence the initialization of ACPI. Signed-off-by: Chao Fan Hi Fan, I know you got the code from acpica sub

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

2018-08-09 Thread Dou Liyang
(CONFIG_IRQ_TIME_ACCOUNTING) || defined(CONFIG_PARAVIRT_TIME_ACCOUNTING) Fixes: 2e62c4743adc ("sched/fair: Remove #ifdefs from scale_rt_capacity()") Signed-off-by: Dou Liyang --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/core.

[RESEND PATCH v2] acpi/processor: Fix the return value of acpi_processor_ids_walk()

2018-08-22 Thread Dou Liyang
erator for processor enumeration") Signed-off-by: Dou Liyang --- Changelog: v1 --> v2: - Fix the check against duplicate IDs suggested by Rafael. Now,the duplicate IDs only be found in Ivb42 machine, and we have added this check at linux-4.9. But, we introduced a bug in li

[PATCH v3] acpi/processor: Fix the return value of acpi_processor_ids_walk()

2018-08-23 Thread Dou Liyang
erator for processor enumeration") Signed-off-by: Dou Liyang --- Changelog: v2 --> v3: - Fix a compiler error reported by LKP v1 --> v2: - Fix the check against duplicate IDs suggested by Rafael. Now,the duplicate IDs only be found in Ivb42 machine, and we have added this

[PATCH 2/2] x86/kvmclock: Mark kvm_get_preset_lpj() as __init

2018-07-30 Thread Dou Liyang
kvm_get_preset_lpj() just be called at kvmclock_init(), So mark it __init as well. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: k...@vger.kernel.org Signed-off-by: Dou Liyang --- arch/x86/kernel/kvmclock.c | 2 +

[PATCH 0/2] Two cleanup patches

2018-07-30 Thread Dou Liyang
Here are two cleanup patches, When I test the early boot time stamps with tip tree today. Dou Liyang (2): x86/tsc: Avoid a double call if tsc can initialize earlier. x86/kvmclock: Mark kvm_get_preset_lpj() as __init arch/x86/kernel/kvmclock.c | 2 +- arch/x86/kernel/tsc.c | 22

[PATCH 1/2] x86/tsc: Avoid a double call if TSC initializes earlier.

2018-07-30 Thread Dou Liyang
init/tsc_init Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Peter Zijlstra Cc: Pavel Tatashin Signed-off-by: Dou Liyang --- arch/x86/kernel/tsc.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/a

[PATCH] x86/apic: Mark parse_mem_block_size as __init

2018-07-30 Thread Dou Liyang
The early_param() is only called during kernel initialization, So Linux marks the functions of it with __init macro to save memory. But it forgot to mark parse_mem_block_size(). So, Make it __init as well. Aslo mark mem_block_size variable __initdata. Signed-off-by: Dou Liyang --- arch/x86

Re: [PATCH 1/2] x86/tsc: Avoid a double call if TSC initializes earlier.

2018-07-30 Thread Dou Liyang
Hi Peter, At 07/30/2018 05:34 PM, Peter Zijlstra wrote: On Mon, Jul 30, 2018 at 03:54:20PM +0800, Dou Liyang wrote: static_branch_enable(&__use_tsc) may be called twice in common case, that is redundant. It is also really not a problem... Yes, right. Just avoid the second useless set

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-18 Thread Dou Liyang
Hi, Pavel I am sorry, I didn't point out typo clearly in the previous version. Please see the concerns below. ;-) At 07/18/2018 10:22 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_ca

Re: [PATCH v14 20/25] x86/tsc: calibrate tsc only once

2018-07-18 Thread Dou Liyang
Hi Thomas, At 07/19/2018 02:25 PM, Thomas Gleixner wrote: On Thu, 19 Jul 2018, Dou Liyang wrote: At 07/18/2018 10:22 AM, Pavel Tatashin wrote: + (unsigned long)cpu_khz % KHZ); if (cpu_khz != tsc_khz) { pr_info("Detected %lu.%03lu MH

Re: [PATCH v4 3/4] x86/boot/KASLR: Walk srat tables to filter immovable memory

2018-08-01 Thread Dou Liyang
Hi Fan, At 07/23/2018 05:29 PM, Chao Fan wrote: If 'CONFIG_MEMORY_HOTREMOVE' specified, walk the acpi srat memory tables, store the immovable memory regions, so that kaslr can get the information abouth where can be selected or not. If 'CONFIG_MEMORY_HOTREMOVE' not specified, go on the old code.

Re: [PATCH v4 4/4] x86/boot/KASLR: Limit kaslr to choosing the immovable memory

2018-08-01 Thread Dou Liyang
Hi Fan, At 07/23/2018 05:29 PM, Chao Fan wrote: If 'CONFIG_MEMORY_HOTREMOVE' specified and the account of immovable memory regions is not zero. Calculate the intersection between memory regions from e820/efi memory table and immovable memory regions. Or go on the old code. Rename process_mem_re

Re: [PATCH v4 4/4] x86/boot/KASLR: Limit kaslr to choosing the immovable memory

2018-08-01 Thread Dou Liyang
At 08/02/2018 02:00 PM, Chao Fan wrote: On Thu, Aug 02, 2018 at 01:46:29PM +0800, Dou Liyang wrote: Hi Fan, At 07/23/2018 05:29 PM, Chao Fan wrote: If 'CONFIG_MEMORY_HOTREMOVE' specified and the account of immovable memory regions is not zero. Calculate the intersection betw

Re: [PATCH v4 3/4] x86/boot/KASLR: Walk srat tables to filter immovable memory

2018-08-02 Thread Dou Liyang
At 08/02/2018 03:05 PM, Thomas Gleixner wrote: [...] Folks. Can you please both stop this annoying habit of keeping the full context of the mail and then sprinkling a random sentence into the middle? I see. won’t do this stupid thing again. Thanks, dou

Re: Bug report about KASLR and ZONE_MOVABLE

2018-07-11 Thread Dou Liyang
Hi Baoquan, At 07/11/2018 08:40 PM, Baoquan He wrote: Please try this v3 patch: >>From 9850d3de9c02e570dc7572069a9749a8add4c4c7 Mon Sep 17 00:00:00 2001 From: Baoquan He Date: Wed, 11 Jul 2018 20:31:51 +0800 Subject: [PATCH v3] mm, page_alloc: find movable zone after kernel text In find_zone_m

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

2018-07-13 Thread Dou Liyang
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() to tsc_early_init(), and rework it so the calibration is done only early, and make tsc_init() to use the

Re: [PATCH v13 14/18] x86/tsc: initialize cyc2ns when tsc freq. is determined

2018-07-13 Thread Dou Liyang
At 07/12/2018 08:04 AM, Pavel Tatashin wrote: cyc2ns converts tsc to nanoseconds, and it is handled in a per-cpu data structure. Currently, the setup code for c2ns data for every possible CPU goes through the same sequence of calculations as for the boot CPU, but is based on the same tsc freq

[RFC PATCH v4 10/12] x86/apic: Make the interrupt mode setup earlier for UP system

2017-05-11 Thread Dou Liyang
read earlier, setup the interrupt mode as soon as possible, and make the system run in the final mode to avoid the compatibility issues. Core patch for UP kernel and remove the original setup code. Signed-off-by: Dou Liyang --- V3 --> V4: - Setup upmode earlier for UP system. - Ch

[RFC PATCH v4 09/12] x86/apic: Setup interrupt mode earlier in case of no SMP motherboard

2017-05-12 Thread Dou Liyang
. Incidentally, -Extract apic_bsp_setup() and Refine apic_interrupt_mode_init(). Signed-off-by: Dou Liyang --- Sorry to trouble again, I tested a bug, update the patch to fix it. V3 --> V4: - Replace "return" with "break" in case of APIC_SYMMETRIC_IO_NO_ROUTING

Re: lapic-related boot crash in 4.15-rc1

2018-01-10 Thread Dou Liyang
re executed. [1] https://marc.info/?l=linux-kernel&m=151188084018443&w=2 Thanks, dou. --->8--- From: Ville Syrjälä This reverts commit b371ae0d4a194b178817b0edfb6a7395c7aec37a. Causes my P3 UP machine to hang at b

Re: Question about dmesg/sysfs output when retpoline config is disabled

2018-01-29 Thread Dou Liyang
Hi Misono-san, At 01/30/2018 12:52 PM, Misono, Tomohiro wrote: Hello, I think dmesg/sysfs output messages are not suitable if retpoline config is off: I intentionally compiled the kernel 4.15.0 with CONFIG_RETPOLINE=n for test and boot it with the following kernel command line option to check

Re: [RESEND PATCH 2/3] x86/apic/kexec: Enable legacy irq mode before jump to kexec/kdump kernel

2018-01-18 Thread Dou Liyang
Hi Baoquan, At 01/17/2018 06:08 PM, Baoquan He wrote: On 01/17/18 at 05:47pm, Dou Liyang wrote: Hi Baoquan, At 01/05/2018 12:38 PM, Baoquan He wrote: In commit commit 522e66464467 ("x86/apic: Disable I/O APIC before shutdown of the local APIC"). lapic_shutdown() invocation is m

Re: [RESEND PATCH 3/3] x86/apic: Clean up the names of legacy irq mode setting related functions

2018-01-18 Thread Dou Liyang
Hi Baoquan, At 01/05/2018 12:39 PM, Baoquan He wrote: [...] /* - * Not an __init, needed by kexec/kdump code. - * For safety IO-APIC and Local APIC need be cleared before this. + * In legacy irq mode, full DOS compatibility with the uniprocessor PC/AT is + * provided by using the APICs in conj

Re: [RESEND PATCH 3/3] x86/apic: Clean up the names of legacy irq mode setting related functions

2018-01-19 Thread Dou Liyang
At 01/19/2018 03:21 PM, Baoquan He wrote: On 01/19/18 at 02:42pm, Dou Liyang wrote: Hi Baoquan, At 01/05/2018 12:39 PM, Baoquan He wrote: [...] /* - * Not an __init, needed by kexec/kdump code. - * For safety IO-APIC and Local APIC need be cleared before this. + * In legacy irq mode

[PATCH] tile/pci_gx: Make setup_pcie_rc_delay __init

2018-01-16 Thread Dou Liyang
: Dou Liyang --- arch/tile/kernel/pci_gx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index 9aa238ac7b35..9a874e98b1cc 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c @@ -617,7 +617,7 @@ static void

[PATCH] x86/x2apic: Make set_x2apic_phys_mode __init

2018-01-16 Thread Dou Liyang
oss Cc: x...@kernel.org Signed-off-by: Dou Liyang --- arch/x86/kernel/apic/x2apic_phys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index f8d9d69994e6..e2829bf40e4a 100644 --- a/arch/x86/kernel/apic/x2a

[PATCH] x86/kvm: Make parse_no_xxx __init for kvm

2018-01-16 Thread Dou Liyang
...@vger.kernel.org Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Juergen Gross Cc: x...@kernel.org Signed-off-by: Dou Liyang --- arch/x86/kernel/kvm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index b4

[PATCH] mm/kmemleak: Make kmemleak_boot_config __init

2018-01-16 Thread Dou Liyang
The early_param() is only called during kernel initialization, So Linux marks the functions of it with __init macro to save memory. But it forgot to mark the kmemleak_boot_config(). So, Make it __init as well. Cc: Catalin Marinas Cc: Andrew Morton Cc: linux...@kvack.org Signed-off-by: Dou

[PATCH] mm/page_poison: Make early_page_poison_param __init

2018-01-16 Thread Dou Liyang
: Greg Kroah-Hartman Cc: linux...@kvack.org Signed-off-by: Dou Liyang --- mm/page_poison.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_poison.c b/mm/page_poison.c index e83fd44867de..aa2b3d34e8ea 100644 --- a/mm/page_poison.c +++ b/mm/page_poison.c @@ -9,7 +9,7

[PATCH] mm/page_owner: Make early_page_owner_param __init

2018-01-16 Thread Dou Liyang
: linux...@kvack.org Signed-off-by: Dou Liyang --- mm/page_owner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_owner.c b/mm/page_owner.c index 8592543a0f15..745a8b8de206 100644 --- a/mm/page_owner.c +++ b/mm/page_owner.c @@ -35,7 +35,7 @@ static depot_stack_handle_t

[PATCH] x86/apic: Replace the redundant macros with an empty stub

2018-01-16 Thread Dou Liyang
init_bsp_APIC(). Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 1 + arch/x86/kernel/irqinit.c | 9 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 98722773391d..6e1990d69865 100644 --- a/arch/x86

Re: [RESEND PATCH 2/3] x86/apic/kexec: Enable legacy irq mode before jump to kexec/kdump kernel

2018-01-17 Thread Dou Liyang
Hi Baoquan, At 01/05/2018 12:38 PM, Baoquan He wrote: In commit commit 522e66464467 ("x86/apic: Disable I/O APIC before shutdown of the local APIC"). lapic_shutdown() invocation is moved after disable_IO_APIC(). In fact in disable_IO_APIC(), it not only calls clear_IO_APIC() to disable IO-API

Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC

2018-01-15 Thread Dou Liyang
tem may build failed in the X2APIC=n case, due to the missing of x2apic_phys. So add a macro named x2apic_phys for the X2APIC=n case. Signed-off-by: Dou Liyang --- arch/x86/include/asm/apic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/apic.h b/arch/x8

Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC

2018-01-15 Thread Dou Liyang
Hi Arnd, At 01/16/2018 09:25 AM, Dou Liyang wrote: Hi Arnd, At 01/16/2018 04:23 AM, Arnd Bergmann wrote: When CONFIG_X86_X2APIC is disabled, jailhouse fails to build: arch/x86/kernel/jailhouse.c: In function 'jailhouse_get_smp_config': arch/x86/kernel/jailhouse.c:73:3: error: &#

Re: lapic-related boot crash in 4.15-rc1

2018-01-15 Thread Dou Liyang
s, dou. --->8--- From: Ville Syrjälä This reverts commit b371ae0d4a194b178817b0edfb6a7395c7aec37a. Causes my P3 UP machine to hang at boot with "lapic". Cc: Dou Liyang Cc: Thomas Gleixner Cc: ying...@kernel.org Cc: b...@redhat.com Cc: Ingo Moln

Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC

2018-01-16 Thread Dou Liyang
Hi Arnd, [...] The reason I don't want to expose the x2apic_mode and x2apic_phys is that they may be misused in X2APIC=n case. So I create an interface to wrap it. do you think so? ;-) I'm not sure I follow what the intention of that is. If you want to hide My purpose of that is hiding the v

Re: [PATCH] x86/jailhouse: fix building without X86_X2APIC

2018-01-16 Thread Dou Liyang
Hi Arnd, At 01/16/2018 04:50 PM, Arnd Bergmann wrote: On Tue, Jan 16, 2018 at 9:17 AM, Dou Liyang wrote: Hi Arnd, [...] The reason I don't want to expose the x2apic_mode and x2apic_phys is that they may be misused in X2APIC=n case. So I create an interface to wrap it. do you thi

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

2018-03-12 Thread Dou Liyang
Hi Thomas, At 03/09/2018 11:08 PM, Thomas Gleixner wrote: [...] I'm not sure if there is a clear indicator whether physcial hotplug is supported or not, but the ACPI folks (x86) and architecture maintainers +cc Rafael should be able to answer that question. I have a machine which says:

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

2018-04-06 Thread Dou Liyang
Hi Thomas, Peter, At 04/03/2018 07:23 PM, Peter Zijlstra wrote: On Tue, Apr 03, 2018 at 12:25:56PM +0200, Thomas Gleixner wrote: On Mon, 2 Apr 2018, Li RongQing wrote: lots of application will read /proc/stat, like ps and vmstat, but we find the reading time are spreading on Purley platform w

Re: [tip:x86/urgent] x86/apic: Fix signedness bug in APIC ID validity checks

2018-04-11 Thread Dou Liyang
Hi Thomas, At 04/10/2018 10:51 PM, tip-bot for Li RongQing wrote: [...] x86/apic: Fix signedness bug in APIC ID validity checks The APIC ID as parsed from ACPI MADT is validity checked with the apic->apic_id_valid() callback, which depends on the selected APIC type. For non X2APIC types APIC

[PATCH] x86/acpi: Prevent X2APIC id 0xffffffff from being accounted

2018-04-11 Thread Dou Liyang
chitecture x2APIC Specification", Chapter 2.4.1. Add a sanity check to acpi_parse_x2apic() which ignores the invalid id. Reported-by: Li RongQing Signed-off-by: Dou Liyang --- arch/x86/kernel/acpi/boot.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/acpi/boot.c b/

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

2018-03-20 Thread Dou Liyang
Kernel uses the possible_cpus in command line to reset the possible_cpus bits in cpu_possible_map. It doesn't be recorded in the kernel-parameters.txt Add its description in this document, also replace the wrong option additional_cpus with possible_cpus in cpu-gotplug-spec. Signed-off-by

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

2018-03-20 Thread Dou Liyang
the walk break after walking pass the first processor. Repace the value with AE_OK which is the standard acpi_status value. Fixes 8c8cb30f49b8 ("acpi/processor: Implement DEVICE operator for processor enumeration") Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 4 ++

[PATCH 0/5] x86/cpu_hotplug: one bug fix and four cleanup

2018-03-20 Thread Dou Liyang
), - two cleapup work (the 3th and 5th patch) - a bug fix for CPU hotplug(4th patch) Dou Liyang (5): x86/smpboot: Add the missing description of possible_cpus x86/cpu_hotplug: Update the link of cpu_hotplug.rst x86/smpboot: Make the check code more clear in prefill_possible_map() acpi

[PATCH 5/5] acpi/processor: Make the acpi_duplicate_processor_id() static

2018-03-20 Thread Dou Liyang
The acpi_duplicate_processor_id() is only called in acpi_processor_get_info(), So move it in front of acpi_processor_get_info() and make it static. Signed-off-by: Dou Liyang --- drivers/acpi/acpi_processor.c | 62 +-- include/linux/acpi.h | 3

[PATCH 2/5] x86/cpu_hotplug: Update the link of cpu_hotplug.rst

2018-03-20 Thread Dou Liyang
The original cpu_hotplug.txt documents describing CPU hotplug support in Linux kernel. it was moved in to core-api/ and renamed cpu_hotplug.rst. Update it's link in other documents Fixes: ff58fa7f556c ("Documentation: Update CPU hotplug and move it to core-api") Signed-off

[PATCH 3/5] x86/smpboot: Make the check code more clear in prefill_possible_map()

2018-03-20 Thread Dou Liyang
follow. Isolate them, and check them linearly. No functionary change, Prepare for cutting the number of possible CPUs Signed-off-by: Dou Liyang --- Situations: setup_possible_cpus == -1 | setup_max_cpus == 0 | CONFIG_HOTPLUG_CPU == y | yes | yes

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

2018-03-20 Thread Dou Liyang
Hi Peter, At 03/20/2018 08:37 PM, Peter Zijlstra wrote: On Tue, Mar 20, 2018 at 07:04:28PM +0800, Dou Liyang wrote: + possible_cpus= [s390,x86_64] Use this to set hotpluggable cpus. + This option sets possible_cpus bits in cpu_possible_map

Re: [PATCH 3/5] x86/smpboot: Make the check code more clear in prefill_possible_map()

2018-03-20 Thread Dou Liyang
Hi Peter, At 03/20/2018 08:39 PM, Peter Zijlstra wrote: On Tue, Mar 20, 2018 at 07:04:30PM +0800, Dou Liyang wrote: case 1: no | no | no | --> min (setup_possible_cpus, nr_cpu_ids, setup_max_cpus) case 2: no | no | yes| --> min (setup_possible_cpus, nr_cpu_ids) case 3: no | ye

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

2018-03-21 Thread Dou Liyang
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 mptables by default

  1   2   3   4   5   6   >