diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/irq/handle.c | 1 | ||||
| -rw-r--r-- | kernel/power/main.c | 6 | ||||
| -rw-r--r-- | kernel/printk.c | 72 | ||||
| -rw-r--r-- | kernel/profile.c | 16 | ||||
| -rw-r--r-- | kernel/sched.c | 2 | ||||
| -rw-r--r-- | kernel/signal.c | 11 | ||||
| -rw-r--r-- | kernel/spinlock.c | 8 | 
7 files changed, 65 insertions, 51 deletions
| diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 2fb0e46e11f3..06b5a6323998 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | */ | 30 | */ | 
| 31 | irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { | 31 | irq_desc_t irq_desc[NR_IRQS] __cacheline_aligned = { | 
| 32 | [0 ... NR_IRQS-1] = { | 32 | [0 ... NR_IRQS-1] = { | 
| 33 | .status = IRQ_DISABLED, | ||
| 33 | .handler = &no_irq_type, | 34 | .handler = &no_irq_type, | 
| 34 | .lock = SPIN_LOCK_UNLOCKED | 35 | .lock = SPIN_LOCK_UNLOCKED | 
| 35 | } | 36 | } | 
| diff --git a/kernel/power/main.c b/kernel/power/main.c index 7960ddf04a57..4cdebc972ff2 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -156,14 +156,14 @@ static int enter_state(suspend_state_t state) | |||
| 156 | goto Unlock; | 156 | goto Unlock; | 
| 157 | } | 157 | } | 
| 158 | 158 | ||
| 159 | pr_debug("PM: Preparing system for suspend\n"); | 159 | pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]); | 
| 160 | if ((error = suspend_prepare(state))) | 160 | if ((error = suspend_prepare(state))) | 
| 161 | goto Unlock; | 161 | goto Unlock; | 
| 162 | 162 | ||
| 163 | pr_debug("PM: Entering state.\n"); | 163 | pr_debug("PM: Entering %s sleep\n", pm_states[state]); | 
| 164 | error = suspend_enter(state); | 164 | error = suspend_enter(state); | 
| 165 | 165 | ||
| 166 | pr_debug("PM: Finishing up.\n"); | 166 | pr_debug("PM: Finishing wakeup.\n"); | 
| 167 | suspend_finish(state); | 167 | suspend_finish(state); | 
| 168 | Unlock: | 168 | Unlock: | 
| 169 | up(&pm_sem); | 169 | up(&pm_sem); | 
| diff --git a/kernel/printk.c b/kernel/printk.c index 290a07ce2c8a..01b58d7d17ff 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
| @@ -160,42 +160,6 @@ static int __init console_setup(char *str) | |||
| 160 | 160 | ||
| 161 | __setup("console=", console_setup); | 161 | __setup("console=", console_setup); | 
| 162 | 162 | ||
| 163 | /** | ||
| 164 | * add_preferred_console - add a device to the list of preferred consoles. | ||
| 165 | * | ||
| 166 | * The last preferred console added will be used for kernel messages | ||
| 167 | * and stdin/out/err for init. Normally this is used by console_setup | ||
| 168 | * above to handle user-supplied console arguments; however it can also | ||
| 169 | * be used by arch-specific code either to override the user or more | ||
| 170 | * commonly to provide a default console (ie from PROM variables) when | ||
| 171 | * the user has not supplied one. | ||
| 172 | */ | ||
| 173 | int __init add_preferred_console(char *name, int idx, char *options) | ||
| 174 | { | ||
| 175 | struct console_cmdline *c; | ||
| 176 | int i; | ||
| 177 | |||
| 178 | /* | ||
| 179 | * See if this tty is not yet registered, and | ||
| 180 | * if we have a slot free. | ||
| 181 | */ | ||
| 182 | for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) | ||
| 183 | if (strcmp(console_cmdline[i].name, name) == 0 && | ||
| 184 | console_cmdline[i].index == idx) { | ||
| 185 | selected_console = i; | ||
| 186 | return 0; | ||
| 187 | } | ||
| 188 | if (i == MAX_CMDLINECONSOLES) | ||
| 189 | return -E2BIG; | ||
| 190 | selected_console = i; | ||
| 191 | c = &console_cmdline[i]; | ||
| 192 | memcpy(c->name, name, sizeof(c->name)); | ||
| 193 | c->name[sizeof(c->name) - 1] = 0; | ||
| 194 | c->options = options; | ||
| 195 | c->index = idx; | ||
| 196 | return 0; | ||
| 197 | } | ||
| 198 | |||
| 199 | static int __init log_buf_len_setup(char *str) | 163 | static int __init log_buf_len_setup(char *str) | 
| 200 | { | 164 | { | 
| 201 | unsigned long size = memparse(str, &str); | 165 | unsigned long size = memparse(str, &str); | 
| @@ -671,6 +635,42 @@ static void call_console_drivers(unsigned long start, unsigned long end) {} | |||
| 671 | #endif | 635 | #endif | 
| 672 | 636 | ||
| 673 | /** | 637 | /** | 
| 638 | * add_preferred_console - add a device to the list of preferred consoles. | ||
| 639 | * | ||
| 640 | * The last preferred console added will be used for kernel messages | ||
| 641 | * and stdin/out/err for init. Normally this is used by console_setup | ||
| 642 | * above to handle user-supplied console arguments; however it can also | ||
| 643 | * be used by arch-specific code either to override the user or more | ||
| 644 | * commonly to provide a default console (ie from PROM variables) when | ||
| 645 | * the user has not supplied one. | ||
| 646 | */ | ||
| 647 | int __init add_preferred_console(char *name, int idx, char *options) | ||
| 648 | { | ||
| 649 | struct console_cmdline *c; | ||
| 650 | int i; | ||
| 651 | |||
| 652 | /* | ||
| 653 | * See if this tty is not yet registered, and | ||
| 654 | * if we have a slot free. | ||
| 655 | */ | ||
| 656 | for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) | ||
| 657 | if (strcmp(console_cmdline[i].name, name) == 0 && | ||
| 658 | console_cmdline[i].index == idx) { | ||
| 659 | selected_console = i; | ||
| 660 | return 0; | ||
| 661 | } | ||
| 662 | if (i == MAX_CMDLINECONSOLES) | ||
| 663 | return -E2BIG; | ||
| 664 | selected_console = i; | ||
| 665 | c = &console_cmdline[i]; | ||
| 666 | memcpy(c->name, name, sizeof(c->name)); | ||
| 667 | c->name[sizeof(c->name) - 1] = 0; | ||
| 668 | c->options = options; | ||
| 669 | c->index = idx; | ||
| 670 | return 0; | ||
| 671 | } | ||
| 672 | |||
| 673 | /** | ||
| 674 | * acquire_console_sem - lock the console system for exclusive use. | 674 | * acquire_console_sem - lock the console system for exclusive use. | 
| 675 | * | 675 | * | 
| 676 | * Acquires a semaphore which guarantees that the caller has | 676 | * Acquires a semaphore which guarantees that the caller has | 
| diff --git a/kernel/profile.c b/kernel/profile.c index 0221a50ca867..ad8cbb75ffa2 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
| @@ -49,15 +49,19 @@ static DECLARE_MUTEX(profile_flip_mutex); | |||
| 49 | 49 | ||
| 50 | static int __init profile_setup(char * str) | 50 | static int __init profile_setup(char * str) | 
| 51 | { | 51 | { | 
| 52 | static char __initdata schedstr[] = "schedule"; | ||
| 52 | int par; | 53 | int par; | 
| 53 | 54 | ||
| 54 | if (!strncmp(str, "schedule", 8)) { | 55 | if (!strncmp(str, schedstr, strlen(schedstr))) { | 
| 55 | prof_on = SCHED_PROFILING; | 56 | prof_on = SCHED_PROFILING; | 
| 56 | printk(KERN_INFO "kernel schedule profiling enabled\n"); | 57 | if (str[strlen(schedstr)] == ',') | 
| 57 | if (str[7] == ',') | 58 | str += strlen(schedstr) + 1; | 
| 58 | str += 8; | 59 | if (get_option(&str, &par)) | 
| 59 | } | 60 | prof_shift = par; | 
| 60 | if (get_option(&str,&par)) { | 61 | printk(KERN_INFO | 
| 62 | "kernel schedule profiling enabled (shift: %ld)\n", | ||
| 63 | prof_shift); | ||
| 64 | } else if (get_option(&str, &par)) { | ||
| 61 | prof_shift = par; | 65 | prof_shift = par; | 
| 62 | prof_on = CPU_PROFILING; | 66 | prof_on = CPU_PROFILING; | 
| 63 | printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n", | 67 | printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n", | 
| diff --git a/kernel/sched.c b/kernel/sched.c index 0dc3158667a2..66b2ed784822 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
| @@ -4243,7 +4243,7 @@ static void move_task_off_dead_cpu(int dead_cpu, struct task_struct *tsk) | |||
| 4243 | 4243 | ||
| 4244 | /* No more Mr. Nice Guy. */ | 4244 | /* No more Mr. Nice Guy. */ | 
| 4245 | if (dest_cpu == NR_CPUS) { | 4245 | if (dest_cpu == NR_CPUS) { | 
| 4246 | tsk->cpus_allowed = cpuset_cpus_allowed(tsk); | 4246 | cpus_setall(tsk->cpus_allowed); | 
| 4247 | dest_cpu = any_online_cpu(tsk->cpus_allowed); | 4247 | dest_cpu = any_online_cpu(tsk->cpus_allowed); | 
| 4248 | 4248 | ||
| 4249 | /* | 4249 | /* | 
| diff --git a/kernel/signal.c b/kernel/signal.c index 8f3debc77c5b..b3c24c732c5a 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
| @@ -522,7 +522,16 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask, | |||
| 522 | { | 522 | { | 
| 523 | int sig = 0; | 523 | int sig = 0; | 
| 524 | 524 | ||
| 525 | sig = next_signal(pending, mask); | 525 | /* SIGKILL must have priority, otherwise it is quite easy | 
| 526 | * to create an unkillable process, sending sig < SIGKILL | ||
| 527 | * to self */ | ||
| 528 | if (unlikely(sigismember(&pending->signal, SIGKILL))) { | ||
| 529 | if (!sigismember(mask, SIGKILL)) | ||
| 530 | sig = SIGKILL; | ||
| 531 | } | ||
| 532 | |||
| 533 | if (likely(!sig)) | ||
| 534 | sig = next_signal(pending, mask); | ||
| 526 | if (sig) { | 535 | if (sig) { | 
| 527 | if (current->notifier) { | 536 | if (current->notifier) { | 
| 528 | if (sigismember(current->notifier_mask, sig)) { | 537 | if (sigismember(current->notifier_mask, sig)) { | 
| diff --git a/kernel/spinlock.c b/kernel/spinlock.c index e15ed17863f1..0c3f9d8bbe17 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
| @@ -294,7 +294,7 @@ EXPORT_SYMBOL(_spin_unlock_irq); | |||
| 294 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) | 294 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) | 
| 295 | { | 295 | { | 
| 296 | _raw_spin_unlock(lock); | 296 | _raw_spin_unlock(lock); | 
| 297 | preempt_enable(); | 297 | preempt_enable_no_resched(); | 
| 298 | local_bh_enable(); | 298 | local_bh_enable(); | 
| 299 | } | 299 | } | 
| 300 | EXPORT_SYMBOL(_spin_unlock_bh); | 300 | EXPORT_SYMBOL(_spin_unlock_bh); | 
| @@ -318,7 +318,7 @@ EXPORT_SYMBOL(_read_unlock_irq); | |||
| 318 | void __lockfunc _read_unlock_bh(rwlock_t *lock) | 318 | void __lockfunc _read_unlock_bh(rwlock_t *lock) | 
| 319 | { | 319 | { | 
| 320 | _raw_read_unlock(lock); | 320 | _raw_read_unlock(lock); | 
| 321 | preempt_enable(); | 321 | preempt_enable_no_resched(); | 
| 322 | local_bh_enable(); | 322 | local_bh_enable(); | 
| 323 | } | 323 | } | 
| 324 | EXPORT_SYMBOL(_read_unlock_bh); | 324 | EXPORT_SYMBOL(_read_unlock_bh); | 
| @@ -342,7 +342,7 @@ EXPORT_SYMBOL(_write_unlock_irq); | |||
| 342 | void __lockfunc _write_unlock_bh(rwlock_t *lock) | 342 | void __lockfunc _write_unlock_bh(rwlock_t *lock) | 
| 343 | { | 343 | { | 
| 344 | _raw_write_unlock(lock); | 344 | _raw_write_unlock(lock); | 
| 345 | preempt_enable(); | 345 | preempt_enable_no_resched(); | 
| 346 | local_bh_enable(); | 346 | local_bh_enable(); | 
| 347 | } | 347 | } | 
| 348 | EXPORT_SYMBOL(_write_unlock_bh); | 348 | EXPORT_SYMBOL(_write_unlock_bh); | 
| @@ -354,7 +354,7 @@ int __lockfunc _spin_trylock_bh(spinlock_t *lock) | |||
| 354 | if (_raw_spin_trylock(lock)) | 354 | if (_raw_spin_trylock(lock)) | 
| 355 | return 1; | 355 | return 1; | 
| 356 | 356 | ||
| 357 | preempt_enable(); | 357 | preempt_enable_no_resched(); | 
| 358 | local_bh_enable(); | 358 | local_bh_enable(); | 
| 359 | return 0; | 359 | return 0; | 
| 360 | } | 360 | } | 
