[tip:x86/apic] x86/api: Rename mp_register_lapic in a comment

2012-09-26 Thread tip-bot for Yasuaki Ishimatsu
Commit-ID:  57c078ce13983d27c83f962b3e9722887209005c
Gitweb: http://git.kernel.org/tip/57c078ce13983d27c83f962b3e9722887209005c
Author: Yasuaki Ishimatsu 
AuthorDate: Wed, 26 Sep 2012 09:54:17 +0900
Committer:  Ingo Molnar 
CommitDate: Wed, 26 Sep 2012 13:29:36 +0200

x86/api: Rename mp_register_lapic in a comment

Commit 31d2092eb0c23636b73d2c24c0c11b66470cef58 ("x86: move
mp_register_lapic_address to boot.c") renamed mp_register_lapic
to acpi_register_lapic. But mp_register_lapic remains in a
comment. So the patch rename it.

Signed-off-by: Yasuaki Ishimatsu 
Cc: Len Brown 
Link: http://lkml.kernel.org/r/50625239.3050...@jp.fujitsu.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/acpi/boot.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index b2297e5..e651f7a 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -656,7 +656,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, 
int *pcpu)
acpi_register_lapic(physid, ACPI_MADT_ENABLED);
 
/*
-* If mp_register_lapic successfully generates a new logical cpu
+* If acpi_register_lapic successfully generates a new logical cpu
 * number, then the following will get us exactly what was mapped
 */
cpumask_andnot(new_map, cpu_present_mask, tmp_map);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:sched/core] sched/fair: Care divide error in update_task_scan_period()

2014-10-28 Thread tip-bot for Yasuaki Ishimatsu
Commit-ID:  2847c90e1b3ae95379af24894fc4f98e7f2fd705
Gitweb: http://git.kernel.org/tip/2847c90e1b3ae95379af24894fc4f98e7f2fd705
Author: Yasuaki Ishimatsu 
AuthorDate: Wed, 22 Oct 2014 16:04:35 +0900
Committer:  Ingo Molnar 
CommitDate: Tue, 28 Oct 2014 10:46:03 +0100

sched/fair: Care divide error in update_task_scan_period()

While offling node by hot removing memory, the following divide error
occurs:

  divide error:  [#1] SMP
  [...]
  Call Trace:
   [...] handle_mm_fault
   [...] ? try_to_wake_up
   [...] ? wake_up_state
   [...] __do_page_fault
   [...] ? do_futex
   [...] ? put_prev_entity
   [...] ? __switch_to
   [...] do_page_fault
   [...] page_fault
  [...]
  RIP  [] task_numa_fault
   RSP 

The issue occurs as follows:
  1. When page fault occurs and page is allocated from node 1,
 task_struct->numa_faults_buffer_memory[] of node 1 is
 incremented and p->numa_faults_locality[] is also incremented
 as follows:

 o numa_faults_buffer_memory[]   o numa_faults_locality[]
  NR_NUMA_HINT_FAULT_TYPES
 |  0 | 1 |
 --  --
  node 0 |  0 | 0 |   remote |  0 |
  node 1 |  0 | 1 |   locale |  1 |
 --  --

  2. node 1 is offlined by hot removing memory.

  3. When page fault occurs, fault_types[] is calculated by using
 p->numa_faults_buffer_memory[] of all online nodes in
 task_numa_placement(). But node 1 was offline by step 2. So
 the fault_types[] is calculated by using only
 p->numa_faults_buffer_memory[] of node 0. So both of fault_types[]
 are set to 0.

  4. The values(0) of fault_types[] pass to update_task_scan_period().

  5. numa_faults_locality[1] is set to 1. So the following division is
 calculated.

static void update_task_scan_period(struct task_struct *p,
unsigned long shared, unsigned long private){
...
ratio = DIV_ROUND_UP(private * NUMA_PERIOD_SLOTS, (private + 
shared));
}

  6. But both of private and shared are set to 0. So divide error
 occurs here.

The divide error is rare case because the trigger is node offline.
This patch always increments denominator for avoiding divide error.

Signed-off-by: Yasuaki Ishimatsu 
Signed-off-by: Peter Zijlstra (Intel) 
Cc: Linus Torvalds 
Link: http://lkml.kernel.org/r/54475703.8000...@jp.fujitsu.com
Signed-off-by: Ingo Molnar 
---
 kernel/sched/fair.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fbc0b82..e9abd4e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1530,7 +1530,7 @@ static void update_task_scan_period(struct task_struct *p,
 * scanning faster if shared accesses dominate as it may
 * simply bounce migrations uselessly
 */
-   ratio = DIV_ROUND_UP(private * NUMA_PERIOD_SLOTS, (private + 
shared));
+   ratio = DIV_ROUND_UP(private * NUMA_PERIOD_SLOTS, (private + 
shared + 1));
diff = (diff * ratio) / NUMA_PERIOD_SLOTS;
}
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/