diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:48 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-07-11 08:15:55 -0400 |
| commit | b7e9c223be8ce335e30f2cf6ba588e6a4092275c (patch) | |
| tree | 2d1e3b75606abc18df7ad65e51ac3f90cd68b38d /kernel | |
| parent | c172d82500a6cf3c32d1e650722a1055d72ce858 (diff) | |
| parent | e3bbfa78bab125f58b831b5f7f45b5a305091d72 (diff) | |
Merge branch 'master' into for-next
Sync with Linus' tree to be able to apply pending patches that
are based on newer code already present upstream.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/exit.c | 31 | ||||
| -rw-r--r-- | kernel/gcov/Kconfig | 3 | ||||
| -rw-r--r-- | kernel/irq/manage.c | 3 | ||||
| -rw-r--r-- | kernel/jump_label.c | 14 | ||||
| -rw-r--r-- | kernel/kmod.c | 16 | ||||
| -rw-r--r-- | kernel/power/snapshot.c | 6 | ||||
| -rw-r--r-- | kernel/power/user.c | 4 | ||||
| -rw-r--r-- | kernel/rcutree.c | 398 | ||||
| -rw-r--r-- | kernel/rcutree.h | 12 | ||||
| -rw-r--r-- | kernel/rcutree_plugin.h | 419 | ||||
| -rw-r--r-- | kernel/rcutree_trace.c | 32 | ||||
| -rw-r--r-- | kernel/resource.c | 116 | ||||
| -rw-r--r-- | kernel/sched.c | 9 | ||||
| -rw-r--r-- | kernel/sched_rt.c | 6 | ||||
| -rw-r--r-- | kernel/signal.c | 2 | ||||
| -rw-r--r-- | kernel/smp.c | 5 | ||||
| -rw-r--r-- | kernel/softirq.c | 2 | ||||
| -rw-r--r-- | kernel/taskstats.c | 15 | ||||
| -rw-r--r-- | kernel/time/alarmtimer.c | 158 | ||||
| -rw-r--r-- | kernel/time/clocksource.c | 24 | ||||
| -rw-r--r-- | kernel/trace/ftrace.c | 9 | ||||
| -rw-r--r-- | kernel/trace/trace_kprobe.c | 8 | ||||
| -rw-r--r-- | kernel/trace/trace_printk.c | 5 |
23 files changed, 743 insertions, 554 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 07dc154fc799..14c9b63a96c3 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
| @@ -560,29 +560,28 @@ void exit_files(struct task_struct *tsk) | |||
| 560 | 560 | ||
| 561 | #ifdef CONFIG_MM_OWNER | 561 | #ifdef CONFIG_MM_OWNER |
| 562 | /* | 562 | /* |
| 563 | * Task p is exiting and it owned mm, lets find a new owner for it | 563 | * A task is exiting. If it owned this mm, find a new owner for the mm. |
| 564 | */ | 564 | */ |
| 565 | static inline int | ||
| 566 | mm_need_new_owner(struct mm_struct *mm, struct task_struct *p) | ||
| 567 | { | ||
| 568 | /* | ||
| 569 | * If there are other users of the mm and the owner (us) is exiting | ||
| 570 | * we need to find a new owner to take on the responsibility. | ||
| 571 | */ | ||
| 572 | if (atomic_read(&mm->mm_users) <= 1) | ||
| 573 | return 0; | ||
| 574 | if (mm->owner != p) | ||
| 575 | return 0; | ||
| 576 | return 1; | ||
| 577 | } | ||
| 578 | |||
| 579 | void mm_update_next_owner(struct mm_struct *mm) | 565 | void mm_update_next_owner(struct mm_struct *mm) |
| 580 | { | 566 | { |
| 581 | struct task_struct *c, *g, *p = current; | 567 | struct task_struct *c, *g, *p = current; |
| 582 | 568 | ||
| 583 | retry: | 569 | retry: |
| 584 | if (!mm_need_new_owner(mm, p)) | 570 | /* |
| 571 | * If the exiting or execing task is not the owner, it's | ||
| 572 | * someone else's problem. | ||
| 573 | */ | ||
| 574 | if (mm->owner != p) | ||
| 585 | return; | 575 | return; |
| 576 | /* | ||
| 577 | * The current owner is exiting/execing and there are no other | ||
| 578 | * candidates. Do not leave the mm pointing to a possibly | ||
| 579 | * freed task structure. | ||
| 580 | */ | ||
| 581 | if (atomic_read(&mm->mm_users) <= 1) { | ||
| 582 | mm->owner = NULL; | ||
| 583 | return; | ||
| 584 | } | ||
| 586 | 585 | ||
| 587 | read_lock(&tasklist_lock); | 586 | read_lock(&tasklist_lock); |
| 588 | /* | 587 | /* |
diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig index b8cadf70b1fb..5bf924d80b5c 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig | |||
| @@ -2,7 +2,8 @@ menu "GCOV-based kernel profiling" | |||
| 2 | 2 | ||
| 3 | config GCOV_KERNEL | 3 | config GCOV_KERNEL |
| 4 | bool "Enable gcov-based kernel profiling" | 4 | bool "Enable gcov-based kernel profiling" |
| 5 | depends on DEBUG_FS && CONSTRUCTORS | 5 | depends on DEBUG_FS |
| 6 | select CONSTRUCTORS | ||
| 6 | default n | 7 | default n |
| 7 | ---help--- | 8 | ---help--- |
| 8 | This option enables gcov-based code profiling (e.g. for code coverage | 9 | This option enables gcov-based code profiling (e.g. for code coverage |
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index d64bafb1afd0..0a7840aeb0fb 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
| @@ -491,6 +491,9 @@ int irq_set_irq_wake(unsigned int irq, unsigned int on) | |||
| 491 | struct irq_desc *desc = irq_get_desc_buslock(irq, &flags); | 491 | struct irq_desc *desc = irq_get_desc_buslock(irq, &flags); |
| 492 | int ret = 0; | 492 | int ret = 0; |
| 493 | 493 | ||
| 494 | if (!desc) | ||
| 495 | return -EINVAL; | ||
| 496 | |||
| 494 | /* wakeup-capable irqs can be shared between drivers that | 497 | /* wakeup-capable irqs can be shared between drivers that |
| 495 | * don't need to have the same sleep mode behaviors. | 498 | * don't need to have the same sleep mode behaviors. |
| 496 | */ | 499 | */ |
diff --git a/kernel/jump_label.c b/kernel/jump_label.c index fa27e750dbc0..a8ce45097f3d 100644 --- a/kernel/jump_label.c +++ b/kernel/jump_label.c | |||
| @@ -375,15 +375,19 @@ int jump_label_text_reserved(void *start, void *end) | |||
| 375 | 375 | ||
| 376 | static void jump_label_update(struct jump_label_key *key, int enable) | 376 | static void jump_label_update(struct jump_label_key *key, int enable) |
| 377 | { | 377 | { |
| 378 | struct jump_entry *entry = key->entries; | 378 | struct jump_entry *entry = key->entries, *stop = __stop___jump_table; |
| 379 | |||
| 380 | /* if there are no users, entry can be NULL */ | ||
| 381 | if (entry) | ||
| 382 | __jump_label_update(key, entry, __stop___jump_table, enable); | ||
| 383 | 379 | ||
| 384 | #ifdef CONFIG_MODULES | 380 | #ifdef CONFIG_MODULES |
| 381 | struct module *mod = __module_address((jump_label_t)key); | ||
| 382 | |||
| 385 | __jump_label_mod_update(key, enable); | 383 | __jump_label_mod_update(key, enable); |
| 384 | |||
| 385 | if (mod) | ||
| 386 | stop = mod->jump_entries + mod->num_jump_entries; | ||
| 386 | #endif | 387 | #endif |
| 388 | /* if there are no users, entry can be NULL */ | ||
| 389 | if (entry) | ||
| 390 | __jump_label_update(key, entry, stop, enable); | ||
| 387 | } | 391 | } |
| 388 | 392 | ||
| 389 | #endif | 393 | #endif |
diff --git a/kernel/kmod.c b/kernel/kmod.c index ad6a81c58b44..47613dfb7b28 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
| @@ -156,12 +156,6 @@ static int ____call_usermodehelper(void *data) | |||
| 156 | */ | 156 | */ |
| 157 | set_user_nice(current, 0); | 157 | set_user_nice(current, 0); |
| 158 | 158 | ||
| 159 | if (sub_info->init) { | ||
| 160 | retval = sub_info->init(sub_info); | ||
| 161 | if (retval) | ||
| 162 | goto fail; | ||
| 163 | } | ||
| 164 | |||
| 165 | retval = -ENOMEM; | 159 | retval = -ENOMEM; |
| 166 | new = prepare_kernel_cred(current); | 160 | new = prepare_kernel_cred(current); |
| 167 | if (!new) | 161 | if (!new) |
| @@ -173,6 +167,14 @@ static int ____call_usermodehelper(void *data) | |||
| 173 | new->cap_inheritable); | 167 | new->cap_inheritable); |
| 174 | spin_unlock(&umh_sysctl_lock); | 168 | spin_unlock(&umh_sysctl_lock); |
| 175 | 169 | ||
| 170 | if (sub_info->init) { | ||
| 171 | retval = sub_info->init(sub_info, new); | ||
| 172 | if (retval) { | ||
| 173 | abort_creds(new); | ||
| 174 | goto fail; | ||
| 175 | } | ||
| 176 | } | ||
| 177 | |||
| 176 | commit_creds(new); | 178 | commit_creds(new); |
| 177 | 179 | ||
| 178 | retval = kernel_execve(sub_info->path, | 180 | retval = kernel_execve(sub_info->path, |
| @@ -388,7 +390,7 @@ EXPORT_SYMBOL(call_usermodehelper_setup); | |||
| 388 | * context in which call_usermodehelper_exec is called. | 390 | * context in which call_usermodehelper_exec is called. |
| 389 | */ | 391 | */ |
| 390 | void call_usermodehelper_setfns(struct subprocess_info *info, | 392 | void call_usermodehelper_setfns(struct subprocess_info *info, |
| 391 | int (*init)(struct subprocess_info *info), | 393 | int (*init)(struct subprocess_info *info, struct cred *new), |
| 392 | void (*cleanup)(struct subprocess_info *info), | 394 | void (*cleanup)(struct subprocess_info *info), |
| 393 | void *data) | 395 | void *data) |
| 394 | { | 396 | { |
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index ace55889f702..06efa54f93d6 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c | |||
| @@ -1211,7 +1211,11 @@ static void free_unnecessary_pages(void) | |||
| 1211 | to_free_highmem = alloc_highmem - save; | 1211 | to_free_highmem = alloc_highmem - save; |
| 1212 | } else { | 1212 | } else { |
| 1213 | to_free_highmem = 0; | 1213 | to_free_highmem = 0; |
| 1214 | to_free_normal -= save - alloc_highmem; | 1214 | save -= alloc_highmem; |
| 1215 | if (to_free_normal > save) | ||
| < | |||
