Commit 29167632 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.115pre4

parent 9307ef5f
......@@ -8301,26 +8301,6 @@ CONFIG_SOUND_SONICVIBES
differs slightly from OSS/Free, so PLEASE READ
Documentation/sound/sonicvibes.
Kernel profiling support
CONFIG_PROFILE
This is for kernel hackers who want to know how much time the kernel
spends in the various procedures. The information is stored in
/proc/profile (say Y to "/proc filesystem support"!) and in order to
read it, you need the readprofile package from
sunsite.unc.edu:/pub/Linux/kernel. Its manpage gives information
regarding the format of profiling data. To become a kernel hacker,
you can start with the Kernel Hacker's Guide at
http://www.redhat.com:8080/HyperNews/get/khg.html (to browse the
WWW, you need to have access to a machine on the Internet that has a
program like lynx or netscape). Mere mortals say N.
Profile shift count
CONFIG_PROFILE_SHIFT
This is used to adjust the granularity with which the addresses of
executed instructions get recorded in /proc/profile. But since you
said Y to "Kernel profiling support", you must be a kernel hacker and
hence you know what this is about :-)
Magic System Request Key support
CONFIG_MAGIC_SYSRQ
If you say Y here, you will have some control over the system even
......
......@@ -279,10 +279,6 @@ mainmenu_option next_comment
comment 'Kernel hacking'
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'Kernel FP software completion' CONFIG_MATHEMU
else
......
......@@ -297,6 +297,5 @@ CONFIG_VGA_CONSOLE=y
#
# Kernel hacking
#
# CONFIG_PROFILE is not set
CONFIG_MATHEMU=y
# CONFIG_MAGIC_SYSRQ is not set
......@@ -81,15 +81,7 @@ int cpu_idle(void *unused)
current->priority = -100;
while (1) {
/*
* tq_scheduler currently assumes we're running in a process
* context (ie that we hold the kernel lock..)
*/
if (tq_scheduler) {
lock_kernel();
run_task_queue(&tq_scheduler);
unlock_kernel();
}
run_task_queue(&tq_scheduler);
/* endless idle loop with no priority at all */
current->counter = -100;
if (!smp_commenced || resched_needed()) {
......
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/kernel_stat.h>
......
......@@ -169,9 +169,5 @@ comment 'Kernel hacking'
bool 'Debug kernel errors' CONFIG_DEBUG_ERRORS
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
endmenu
......@@ -263,5 +263,4 @@ DSP_BUFFSIZE=65536
#
# Kernel hacking
#
# CONFIG_PROFILE is not set
CONFIG_MAGIC_SYSRQ=y
......@@ -290,6 +290,4 @@ CONFIG_VGA_CONSOLE=y
#
# Kernel hacking
#
CONFIG_PROFILE=y
CONFIG_PROFILE_SHIFT=2
# CONFIG_MAGIC_SYSRQ is not set
......@@ -159,15 +159,8 @@ int cpu_idle(void *unused)
!hlt_counter && !current->need_resched)
__asm("hlt");
check_pgt_cache();
/*
* tq_scheduler currently assumes we're running in a process
* context (ie that we hold the kernel lock..)
*/
if (tq_scheduler) {
lock_kernel();
run_task_queue(&tq_scheduler);
unlock_kernel();
}
run_task_queue(&tq_scheduler);
/* endless idle loop with no priority at all */
current->counter = 0;
schedule();
......
......@@ -356,10 +356,6 @@ mainmenu_option next_comment
comment 'Kernel hacking'
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
bool 'Remote debugging support' CONFIG_KGDB
endmenu
......@@ -217,5 +217,4 @@ CONFIG_AMIGA_BUILTIN_SERIAL=y
#
# Kernel hacking
#
# CONFIG_PROFILE is not set
CONFIG_SCSI_CONSTANTS=y
......@@ -211,8 +211,4 @@ if [ "$CONFIG_MODULES" = "y" ]; then
bool ' Build fp execption handler module' CONFIG_MIPS_FPE_MODULE
fi
bool 'Remote GDB kernel debugging' CONFIG_REMOTE_DEBUG
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
endmenu
......@@ -327,4 +327,3 @@ CONFIG_SERIAL=y
#
CONFIG_CROSSCOMPILE=y
# CONFIG_REMOTE_DEBUG is not set
# CONFIG_PROFILE is not set
......@@ -6,7 +6,6 @@
* Jesper
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
......
#include <linux/config.h> /* CONFIG_HEARTBEAT */
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......
......@@ -12,7 +12,6 @@
* 2 of the License, or (at your option) any later version.
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/delay.h>
......
......@@ -7,6 +7,7 @@
* Paul Mackerras August 1996.
* Copyright (C) 1996 Paul Mackerras.
*/
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......
......@@ -18,7 +18,6 @@
*
*/
#include <linux/config.h>
#include <linux/string.h>
#include <asm/residual.h>
#include <asm/pnp.h>
......
......@@ -7,7 +7,6 @@
*/
/* routines to control the AP1000 timer chip */
#include <linux/config.h> /* for CONFIG_PROFILE */
#include <linux/time.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
......@@ -74,8 +73,6 @@ void ap_gettimeofday(struct timeval *xt)
last_freerun = new_freerun;
}
#ifdef CONFIG_PROFILE
static void profile_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
if (prof_buffer && current->pid) {
......@@ -98,8 +95,6 @@ void ap_profile_init(void)
}
}
#endif
void ap_init_timers(void)
{
extern void timer_interrupt(int irq, void *dev_id, struct pt_regs * regs);
......@@ -114,12 +109,10 @@ void ap_init_timers(void)
(SA_INTERRUPT | SA_STATIC_ALLOC),
"timer", NULL);
#ifdef CONFIG_PROFILE
request_irq(APTIM0_IRQ,
profile_interrupt,
(SA_INTERRUPT | SA_STATIC_ALLOC),
"profile", NULL);
#endif
ap_clear_clock_irq();
......
......@@ -185,9 +185,5 @@ endmenu
mainmenu_option next_comment
comment 'Kernel hacking'
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
endmenu
......@@ -315,5 +315,4 @@ CONFIG_NLS=y
#
# Kernel hacking
#
# CONFIG_PROFILE is not set
# CONFIG_MAGIC_SYSRQ is not set
......@@ -113,15 +113,7 @@ int cpu_idle(void *unused)
current->priority = -100;
while(1) {
srmmu_check_pgt_cache();
/*
* tq_scheduler currently assumes we're running in a process
* context (ie that we hold the kernel lock..)
*/
if (tq_scheduler) {
lock_kernel();
run_task_queue(&tq_scheduler);
unlock_kernel();
}
run_task_queue(&tq_scheduler);
/* endless idle loop with no priority at all */
current->counter = -100;
if(!smp_commenced || current->need_resched)
......
......@@ -9,6 +9,7 @@
* Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
*/
#include <linux/config.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/linkage.h>
......
......@@ -6,7 +6,6 @@
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/config.h> /* for CONFIG_PROFILE */
#include <asm/head.h>
#include <linux/kernel.h>
......@@ -437,8 +436,6 @@ void smp4d_message_pass(int target, int msg, unsigned long data, int wait)
/* Protects counters touched during level14 ticker */
static spinlock_t ticker_lock = SPIN_LOCK_UNLOCKED;
#ifdef CONFIG_PROFILE
/* 32-bit Sparc specific profiling function. */
static inline void sparc_do_profile(unsigned long pc)
{
......@@ -457,8 +454,6 @@ static inline void sparc_do_profile(unsigned long pc)
}
}
#endif
extern unsigned int prof_multiplier[NR_CPUS];
extern unsigned int prof_counter[NR_CPUS];
......@@ -484,10 +479,9 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs)
show_leds(cpu);
}
#ifdef CONFIG_PROFILE
if(!user_mode(regs))
sparc_do_profile(regs->pc);
#endif
if(!--prof_counter[cpu]) {
int user = user_mode(regs);
if(current->pid) {
......
......@@ -3,7 +3,6 @@
* Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/config.h> /* for CONFIG_PROFILE */
#include <asm/head.h>
#include <linux/kernel.h>
......@@ -433,8 +432,6 @@ void smp4m_cross_call_irq(void)
/* Protects counters touched during level14 ticker */
static spinlock_t ticker_lock = SPIN_LOCK_UNLOCKED;
#ifdef CONFIG_PROFILE
/* 32-bit Sparc specific profiling function. */
static inline void sparc_do_profile(unsigned long pc)
{
......@@ -453,8 +450,6 @@ static inline void sparc_do_profile(unsigned long pc)
}
}
#endif
extern unsigned int prof_multiplier[NR_CPUS];
extern unsigned int prof_counter[NR_CPUS];
......@@ -467,10 +462,10 @@ void smp4m_percpu_timer_interrupt(struct pt_regs *regs)
int cpu = smp_processor_id();
clear_profile_irq(mid_xlate[cpu]);
#ifdef CONFIG_PROFILE
if(!user_mode(regs))
sparc_do_profile(regs->pc);
#endif
if(!--prof_counter[cpu]) {
int user = user_mode(regs);
if(current->pid) {
......
......@@ -4,8 +4,6 @@
* Copyright (C) 1998 Chris G. Davis (cdavis@cois.on.ca)
*/
#include <linux/config.h>
#include <asm/page.h>
#include <asm/oplib.h>
#include <asm/idprom.h>
......
......@@ -245,10 +245,6 @@ endmenu
mainmenu_option next_comment
comment 'Kernel hacking'
bool 'Kernel profiling support' CONFIG_PROFILE
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
bool 'Magic SysRq key' CONFIG_MAGIC_SYSRQ
bool 'ECache flush trap support at ta 0x72' CONFIG_EC_FLUSH_TRAP
endmenu
......@@ -334,6 +334,5 @@ CONFIG_NLS=y
#
# Kernel hacking
#
# CONFIG_PROFILE is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_EC_FLUSH_TRAP is not set
This diff is collapsed.
......@@ -72,11 +72,7 @@ asmlinkage int cpu_idle(void)
current->priority = 0;
while(1) {
check_pgt_cache();
if(tq_scheduler) {
lock_kernel();
run_task_queue(&tq_scheduler);
unlock_kernel();
}
run_task_queue(&tq_scheduler);
barrier();
current->counter = 0;
if(current->need_resched)
......
......@@ -3,7 +3,6 @@
* Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tasks.h>
......
......@@ -46,6 +46,8 @@
#include <linux/ioport.h>
#include <linux/config.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/uaccess.h>
......@@ -2001,7 +2003,6 @@ static void stl_echpci64intr(stlbrd_t *brdp)
/*
* Service an off-level request for some channel.
*/
static void stl_offintr(void *private)
{
stlport_t *portp;
......@@ -2016,10 +2017,12 @@ static void stl_offintr(void *private)
if (portp == (stlport_t *) NULL)
return;
tty = portp->tty;
if (tty == (struct tty_struct *) NULL)
return;
lock_kernel();
if (test_bit(ASYI_TXLOW, &portp->istate)) {
if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
tty->ldisc.write_wakeup)
......@@ -2041,6 +2044,7 @@ static void stl_offintr(void *private)
}
}
}
unlock_kernel();
}
/*****************************************************************************/
......
......@@ -80,6 +80,7 @@
#include <linux/proc_fs.h>
#endif
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
......@@ -371,17 +372,24 @@ static struct file_operations hung_up_tty_fops = {
NULL /* hung_up_tty_fasync */
};
/*
* This can be called through the "tq_scheduler"
* task-list. That is process synchronous, but
* doesn't hold any locks, so we need to make
* sure we have the appropriate locks for what
* we're doing..
*/
void do_tty_hangup(void *data)
{
struct tty_struct *tty = (struct tty_struct *) data;
struct file * filp;
struct task_struct *p;
unsigned long flags;
if (!tty)
return;
save_flags(flags); cli();
/* inuse_filps is protected by the single kernel lock */
lock_kernel();
check_tty_count(tty, "do_tty_hangup");
for (filp = inuse_filps; filp; filp = filp->f_next) {
......@@ -400,13 +408,21 @@ void do_tty_hangup(void *data)
filp->f_op = &hung_up_tty_fops;
}
if (tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (tty->driver.flush_buffer)
tty->driver.flush_buffer(tty);
if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
/* FIXME! What are the locking issues here? This may me overdoing things.. */
{
unsigned long flags;
save_flags(flags); cli();
if (tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (tty->driver.flush_buffer)
tty->driver.flush_buffer(tty);
if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) &&
tty->ldisc.write_wakeup)
(tty->ldisc.write_wakeup)(tty);
restore_flags(flags);
}
wake_up_interruptible(&tty->write_wait);
wake_up_interruptible(&tty->read_wait);
......@@ -449,7 +465,7 @@ void do_tty_hangup(void *data)
tty->ctrl_status = 0;
if (tty->driver.hangup)
(tty->driver.hangup)(tty);
restore_flags(flags);
unlock_kernel();
}
void tty_hangup(struct tty_struct * tty)
......@@ -459,7 +475,7 @@ void tty_hangup(struct tty_struct * tty)
printk("%s hangup...\n", tty_name(tty, buf));
#endif
queue_task(&tty->tq_hangup, &tq_timer);
queue_task(&tty->tq_hangup, &tq_scheduler);
}
void tty_vhangup(struct tty_struct * tty)
......@@ -1158,6 +1174,7 @@ static void release_dev(struct file * filp)
* Make sure that the tty's task queue isn't activated.
*/
run_task_queue(&tq_timer);
run_task_queue(&tq_scheduler);
/*
* The release_mem function takes care of the details of clearing
......
......@@ -11,6 +11,7 @@
* Copyright (C) 1998 Paul Mackerras and Fabio Riccardi.
*/
#include <stdarg.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
......
......@@ -9,6 +9,7 @@
#ifndef _SPARC_MOSTEK_H
#define _SPARC_MOSTEK_H
#include <linux/config.h>
#include <asm/idprom.h>
/* M48T02 Register Map (adapted from Sun NVRAM/Hostid FAQ)
......
......@@ -469,8 +469,11 @@ asmlinkage void schedule(void)
if (in_interrupt())
goto scheduling_in_interrupt;
release_kernel_lock(prev, this_cpu);
/* Do "administrative" work here while we don't hold any locks */
if (bh_active & bh_mask)
do_bottom_half();
run_task_queue(&tq_scheduler);
spin_lock(&scheduler_lock);
spin_lock_irq(&runqueue_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment