diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-27 23:20:03 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-27 23:20:03 +0000 |
commit | 89eba5eb77bbf92ffed6686c951cc35f4027e71f (patch) | |
tree | b56887b1753ca2573002bc7f60e5f3e47c33b116 /kernel | |
parent | f7ff3f5a67747c7714c3db772d05965a0c033705 (diff) |
Merge with Linux 2.4.0-test5-pre5.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kmod.c | 1 | ||||
-rw-r--r-- | kernel/ksyms.c | 8 | ||||
-rw-r--r-- | kernel/sched.c | 2 | ||||
-rw-r--r-- | kernel/timer.c | 46 |
4 files changed, 31 insertions, 26 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c index 5f9c3b7df..3f59386e5 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -15,6 +15,7 @@ #define __KERNEL_SYSCALLS__ +#include <linux/config.h> #include <linux/sched.h> #include <linux/unistd.h> #include <linux/smp_lock.h> diff --git a/kernel/ksyms.c b/kernel/ksyms.c index eae4ef1b7..241855d8e 100644 --- a/kernel/ksyms.c +++ b/kernel/ksyms.c @@ -141,6 +141,7 @@ EXPORT_SYMBOL(get_empty_super); EXPORT_SYMBOL(getname); EXPORT_SYMBOL(names_cachep); EXPORT_SYMBOL(fput); +EXPORT_SYMBOL(fget); EXPORT_SYMBOL(igrab); EXPORT_SYMBOL(iunique); EXPORT_SYMBOL(iget4); @@ -353,6 +354,11 @@ EXPORT_SYMBOL(del_timer); EXPORT_SYMBOL(request_irq); EXPORT_SYMBOL(free_irq); +/* waitqueue handling */ +EXPORT_SYMBOL(add_wait_queue); +EXPORT_SYMBOL(add_wait_queue_exclusive); +EXPORT_SYMBOL(remove_wait_queue); + /* The notion of irq probe/assignment is foreign to S/390 */ #if !defined(CONFIG_ARCH_S390) @@ -503,9 +509,7 @@ EXPORT_SYMBOL(fs_overflowgid); EXPORT_SYMBOL(fasync_helper); EXPORT_SYMBOL(kill_fasync); -#ifdef CONFIG_BLK_DEV_MD EXPORT_SYMBOL(disk_name); /* for md.c */ -#endif /* binfmt_aout */ EXPORT_SYMBOL(get_write_access); diff --git a/kernel/sched.c b/kernel/sched.c index 1cfa76d3b..68d786e89 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -106,7 +106,7 @@ static union { #define cpu_curr(cpu) aligned_data[(cpu)].schedule_data.curr #define last_schedule(cpu) aligned_data[(cpu)].schedule_data.last_schedule -struct kernel_stat kstat = { 0 }; +struct kernel_stat kstat; #ifdef CONFIG_SMP diff --git a/kernel/timer.c b/kernel/timer.c index 7688a56a4..108ca240f 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -545,64 +545,60 @@ static inline void do_it_virt(struct task_struct * p, unsigned long ticks) unsigned long it_virt = p->it_virt_value; if (it_virt) { - if (it_virt <= ticks) { - it_virt = ticks + p->it_virt_incr; + it_virt -= ticks; + if (!it_virt) { + it_virt = p->it_virt_incr; send_sig(SIGVTALRM, p, 1); } - p->it_virt_value = it_virt - ticks; + p->it_virt_value = it_virt; } } -static inline void do_it_prof(struct task_struct * p, unsigned long ticks) +static inline void do_it_prof(struct task_struct *p) { unsigned long it_prof = p->it_prof_value; if (it_prof) { - if (it_prof <= ticks) { - it_prof = ticks + p->it_prof_incr; + if (--it_prof == 0) { + it_prof = p->it_prof_incr; send_sig(SIGPROF, p, 1); } - p->it_prof_value = it_prof - ticks; + p->it_prof_value = it_prof; } } -void update_one_process(struct task_struct *p, - unsigned long ticks, unsigned long user, unsigned long system, int cpu) +void update_one_process(struct task_struct *p, unsigned long user, + unsigned long system, int cpu) { p->per_cpu_utime[cpu] += user; p->per_cpu_stime[cpu] += system; do_process_times(p, user, system); do_it_virt(p, user); - do_it_prof(p, ticks); + do_it_prof(p); } /* * Called from the timer interrupt handler to charge one tick to the current * process. user_tick is 1 if the tick is user time, 0 for system. */ -static void update_process_times(int user_tick) +void update_process_times(int user_tick) { -/* - * SMP does this on a per-CPU basis elsewhere - */ -#ifndef CONFIG_SMP struct task_struct *p = current; - int system = !user_tick; + int cpu = smp_processor_id(), system = user_tick ^ 1; + update_one_process(p, user_tick, system, cpu); if (p->pid) { if (--p->counter <= 0) { p->counter = 0; p->need_resched = 1; } if (p->nice > 0) - kstat.cpu_nice += user_tick; + kstat.per_cpu_nice[cpu] += user_tick; else - kstat.cpu_user += user_tick; - kstat.cpu_system += system; - } else if (local_bh_count(0) || local_irq_count(0) > 1) - kstat.cpu_system += system; - update_one_process(p, 1, user_tick, system, 0); -#endif + kstat.per_cpu_user[cpu] += user_tick; + kstat.per_cpu_system[cpu] += system; + } else if (local_bh_count(cpu) || local_irq_count(cpu) > 1) + kstat.per_cpu_system[cpu] += system; } /* @@ -683,7 +679,11 @@ void timer_bh(void) void do_timer(struct pt_regs *regs) { (*(unsigned long *)&jiffies)++; +#ifndef CONFIG_SMP + /* SMP process accounting uses the local APIC timer */ + update_process_times(user_mode(regs)); +#endif mark_bh(TIMER_BH); if (tq_timer) mark_bh(TQUEUE_BH); |