Skip to content

Commit

Permalink
[S390] Convert s390 to GENERIC_CLOCKEVENTS.
Browse files Browse the repository at this point in the history
This way we get rid of s390's NO_IDLE_HZ and use the generic dynticks
variant instead. In addition we get high resolution timers for free.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
  • Loading branch information
Heiko Carstens committed Apr 17, 2008
1 parent d7b9068 commit 5a62b19
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 228 deletions.
24 changes: 5 additions & 19 deletions arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ config GENERIC_HWEIGHT
config GENERIC_TIME
def_bool y

config GENERIC_CLOCKEVENTS
def_bool y

config GENERIC_BUG
bool
depends on BUG
Expand Down Expand Up @@ -73,6 +76,8 @@ menu "Base setup"

comment "Processor type and features"

source "kernel/time/Kconfig"

config 64BIT
bool "64 bit kernel"
help
Expand Down Expand Up @@ -487,25 +492,6 @@ config APPLDATA_NET_SUM

source kernel/Kconfig.hz

config NO_IDLE_HZ
bool "No HZ timer ticks in idle"
help
Switches the regular HZ timer off when the system is going idle.
This helps z/VM to detect that the Linux system is idle. VM can
then "swap-out" this guest which reduces memory usage. It also
reduces the overhead of idle systems.

The HZ timer can be switched on/off via /proc/sys/kernel/hz_timer.
hz_timer=0 means HZ timer is disabled. hz_timer=1 means HZ
timer is active.

config NO_IDLE_HZ_INIT
bool "HZ timer in idle off by default"
depends on NO_IDLE_HZ
help
The HZ timer is switched off in idle by default. That means the
HZ timer is already disabled at boot time.

config S390_HYPFS_FS
bool "s390 hypervisor file system support"
select SYS_HYPERVISOR
Expand Down
4 changes: 3 additions & 1 deletion arch/s390/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/utsname.h>
#include <linux/tick.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/system.h>
Expand Down Expand Up @@ -167,9 +168,10 @@ static void default_idle(void)
void cpu_idle(void)
{
for (;;) {
tick_nohz_stop_sched_tick();
while (!need_resched())
default_idle();

tick_nohz_restart_sched_tick();
preempt_enable_no_resched();
schedule();
preempt_disable();
Expand Down
9 changes: 3 additions & 6 deletions arch/s390/kernel/s390_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,9 @@ void do_extint(struct pt_regs *regs, unsigned short code)
old_regs = set_irq_regs(regs);
irq_enter();
s390_idle_check();
if (S390_lowcore.int_clock >= S390_lowcore.jiffy_timer)
/**
* Make sure that the i/o interrupt did not "overtake"
* the last HZ timer interrupt.
*/
account_ticks(S390_lowcore.int_clock);
if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator)
/* Serve timer interrupts first. */
clock_comparator_work();
kstat_cpu(smp_processor_id()).irqs[EXTERNAL_INTERRUPT]++;
index = ext_hash(code);
for (p = ext_int_hash[index]; p; p = p->next) {
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ setup_lowcore(void)
lc->io_new_psw.mask = psw_kernel_bits;
lc->io_new_psw.addr = PSW_ADDR_AMODE | (unsigned long) io_int_handler;
lc->ipl_device = S390_lowcore.ipl_device;
lc->jiffy_timer = -1LL;
lc->clock_comparator = -1ULL;
lc->kernel_stack = ((unsigned long) &init_thread_union) + THREAD_SIZE;
lc->async_stack = (unsigned long)
__alloc_bootmem(ASYNC_SIZE, ASYNC_SIZE, 0) + ASYNC_SIZE;
Expand Down
Loading

0 comments on commit 5a62b19

Please sign in to comment.