aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/smp.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-31 09:11:42 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-31 09:11:49 -0500
commitc742b31c03f37c5c499178f09f57381aa6c70131 (patch)
treedb0e95b8299d997fcb1264126bc8efe10d0ddd51 /arch/s390/kernel/smp.c
parent9cfb9b3c3a7361c793c031e9c3583b177ac5debd (diff)
[PATCH] fast vdso implementation for CLOCK_THREAD_CPUTIME_ID
The extract cpu time instruction (ectg) instruction allows the user process to get the current thread cputime without calling into the kernel. The code that uses the instruction needs to switch to the access registers mode to get access to the per-cpu info page that contains the two base values that are needed to calculate the current cputime from the CPU timer with the ectg instruction. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/smp.c')
-rw-r--r--arch/s390/kernel/smp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 3979a6fc0882..b3461e8f1705 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -47,6 +47,7 @@
47#include <asm/lowcore.h> 47#include <asm/lowcore.h>
48#include <asm/sclp.h> 48#include <asm/sclp.h>
49#include <asm/cpu.h> 49#include <asm/cpu.h>
50#include <asm/vdso.h>
50#include "entry.h" 51#include "entry.h"
51 52
52/* 53/*
@@ -506,6 +507,9 @@ static int __cpuinit smp_alloc_lowcore(int cpu)
506 goto out; 507 goto out;
507 lowcore->extended_save_area_addr = (u32) save_area; 508 lowcore->extended_save_area_addr = (u32) save_area;
508 } 509 }
510#else
511 if (vdso_alloc_per_cpu(cpu, lowcore))
512 goto out;
509#endif 513#endif
510 lowcore_ptr[cpu] = lowcore; 514 lowcore_ptr[cpu] = lowcore;
511 return 0; 515 return 0;
@@ -528,6 +532,8 @@ static void smp_free_lowcore(int cpu)
528#ifndef CONFIG_64BIT 532#ifndef CONFIG_64BIT
529 if (MACHINE_HAS_IEEE) 533 if (MACHINE_HAS_IEEE)
530 free_page((unsigned long) lowcore->extended_save_area_addr); 534 free_page((unsigned long) lowcore->extended_save_area_addr);
535#else
536 vdso_free_per_cpu(cpu, lowcore);
531#endif 537#endif
532 free_page(lowcore->panic_stack - PAGE_SIZE); 538 free_page(lowcore->panic_stack - PAGE_SIZE);
533 free_pages(lowcore->async_stack - ASYNC_SIZE, ASYNC_ORDER); 539 free_pages(lowcore->async_stack - ASYNC_SIZE, ASYNC_ORDER);
@@ -670,6 +676,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
670 lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, lc_order); 676 lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, lc_order);
671 panic_stack = __get_free_page(GFP_KERNEL); 677 panic_stack = __get_free_page(GFP_KERNEL);
672 async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); 678 async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER);
679 BUG_ON(!lowcore || !panic_stack || !async_stack);
673#ifndef CONFIG_64BIT 680#ifndef CONFIG_64BIT
674 if (MACHINE_HAS_IEEE) 681 if (MACHINE_HAS_IEEE)
675 save_area = get_zeroed_page(GFP_KERNEL); 682 save_area = get_zeroed_page(GFP_KERNEL);
@@ -683,6 +690,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
683#ifndef CONFIG_64BIT 690#ifndef CONFIG_64BIT
684 if (MACHINE_HAS_IEEE) 691 if (MACHINE_HAS_IEEE)
685 lowcore->extended_save_area_addr = (u32) save_area; 692 lowcore->extended_save_area_addr = (u32) save_area;
693#else
694 BUG_ON(vdso_alloc_per_cpu(smp_processor_id(), lowcore));
686#endif 695#endif
687 set_prefix((u32)(unsigned long) lowcore); 696 set_prefix((u32)(unsigned long) lowcore);
688 local_mcck_enable(); 697 local_mcck_enable();