diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 21:10:18 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-31 21:10:18 -0400 |
| commit | 08615d7d85e5aa02c05bf6c4dde87d940e7f85f6 (patch) | |
| tree | 18906149d313d25914160aca21cedf54b3a7e818 /arch/um/kernel | |
| parent | 9fdadb2cbaf4b482dfd6086e8bd3d2db071a1702 (diff) | |
| parent | 0a4dd35c67b144d8ef9432120105f1aab9293ee9 (diff) | |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton:
- the "misc" tree - stuff from all over the map
- checkpatch updates
- fatfs
- kmod changes
- procfs
- cpumask
- UML
- kexec
- mqueue
- rapidio
- pidns
- some checkpoint-restore feature work. Reluctantly. Most of it
delayed a release. I'm still rather worried that we don't have a
clear roadmap to completion for this work.
* emailed from Andrew Morton <akpm@linux-foundation.org>: (78 patches)
kconfig: update compression algorithm info
c/r: prctl: add ability to set new mm_struct::exe_file
c/r: prctl: extend PR_SET_MM to set up more mm_struct entries
c/r: procfs: add arg_start/end, env_start/end and exit_code members to /proc/$pid/stat
syscalls, x86: add __NR_kcmp syscall
fs, proc: introduce /proc/<pid>/task/<tid>/children entry
sysctl: make kernel.ns_last_pid control dependent on CHECKPOINT_RESTORE
aio/vfs: cleanup of rw_copy_check_uvector() and compat_rw_copy_check_uvector()
eventfd: change int to __u64 in eventfd_signal()
fs/nls: add Apple NLS
pidns: make killed children autoreap
pidns: use task_active_pid_ns in do_notify_parent
rapidio/tsi721: add DMA engine support
rapidio: add DMA engine support for RIO data transfers
ipc/mqueue: add rbtree node caching support
tools/selftests: add mq_perf_tests
ipc/mqueue: strengthen checks on mqueue creation
ipc/mqueue: correct mq_attr_ok test
ipc/mqueue: improve performance of send/recv
selftests: add mq_open_tests
...
Diffstat (limited to 'arch/um/kernel')
| -rw-r--r-- | arch/um/kernel/reboot.c | 13 | ||||
| -rw-r--r-- | arch/um/kernel/trap.c | 24 |
2 files changed, 29 insertions, 8 deletions
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index 4d93dff6b371..3d15243ce692 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c | |||
| @@ -4,7 +4,9 @@ | |||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #include "linux/sched.h" | 6 | #include "linux/sched.h" |
| 7 | #include "linux/spinlock.h" | ||
| 7 | #include "linux/slab.h" | 8 | #include "linux/slab.h" |
| 9 | #include "linux/oom.h" | ||
| 8 | #include "kern_util.h" | 10 | #include "kern_util.h" |
| 9 | #include "os.h" | 11 | #include "os.h" |
| 10 | #include "skas.h" | 12 | #include "skas.h" |
| @@ -22,13 +24,18 @@ static void kill_off_processes(void) | |||
| 22 | struct task_struct *p; | 24 | struct task_struct *p; |
| 23 | int pid; | 25 | int pid; |
| 24 | 26 | ||
| 27 | read_lock(&tasklist_lock); | ||
| 25 | for_each_process(p) { | 28 | for_each_process(p) { |
| 26 | if (p->mm == NULL) | 29 | struct task_struct *t; |
| 27 | continue; | ||
| 28 | 30 | ||
| 29 | pid = p->mm->context.id.u.pid; | 31 | t = find_lock_task_mm(p); |
| 32 | if (!t) | ||
| 33 | continue; | ||
| 34 | pid = t->mm->context.id.u.pid; | ||
| 35 | task_unlock(t); | ||
| 30 | os_kill_ptraced_process(pid, 1); | 36 | os_kill_ptraced_process(pid, 1); |
| 31 | } | 37 | } |
| 38 | read_unlock(&tasklist_lock); | ||
| 32 | } | 39 | } |
| 33 | } | 40 | } |
| 34 | 41 | ||
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c index dafc94715950..3be60765c0e2 100644 --- a/arch/um/kernel/trap.c +++ b/arch/um/kernel/trap.c | |||
| @@ -30,6 +30,8 @@ int handle_page_fault(unsigned long address, unsigned long ip, | |||
| 30 | pmd_t *pmd; | 30 | pmd_t *pmd; |
| 31 | pte_t *pte; | 31 | pte_t *pte; |
| 32 | int err = -EFAULT; | 32 | int err = -EFAULT; |
| 33 | unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | | ||
| 34 | (is_write ? FAULT_FLAG_WRITE : 0); | ||
| 33 | 35 | ||
| 34 | *code_out = SEGV_MAPERR; | 36 | *code_out = SEGV_MAPERR; |
| 35 | 37 | ||
| @@ -40,6 +42,7 @@ int handle_page_fault(unsigned long address, unsigned long ip, | |||
| 40 | if (in_atomic()) | 42 | if (in_atomic()) |
| 41 | goto out_nosemaphore; | 43 | goto out_nosemaphore; |
| 42 | 44 | ||
| 45 | retry: | ||
| 43 | down_read(&mm->mmap_sem); | 46 | down_read(&mm->mmap_sem); |
| 44 | vma = find_vma(mm, address); | 47 | vma = find_vma(mm, address); |
| 45 | if (!vma) | 48 | if (!vma) |
| @@ -65,7 +68,11 @@ good_area: | |||
| 65 | do { | 68 | do { |
| 66 | int fault; | 69 | int fault; |
| 67 | 70 | ||
| 68 | fault = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); | 71 | fault = handle_mm_fault(mm, vma, address, flags); |
| 72 | |||
| 73 | if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) | ||
| 74 | goto out_nosemaphore; | ||
| 75 | |||
| 69 | if (unlikely(fault & VM_FAULT_ERROR)) { | 76 | if (unlikely(fault & VM_FAULT_ERROR)) { |
| 70 | if (fault & VM_FAULT_OOM) { | 77 | if (fault & VM_FAULT_OOM) { |
| 71 | goto out_of_memory; | 78 | goto out_of_memory; |
| @@ -75,10 +82,17 @@ good_area: | |||
| 75 | } | 82 | } |
| 76 | BUG(); | 83 | BUG(); |
| 77 | } | 84 | } |
| 78 | if (fault & VM_FAULT_MAJOR) | 85 | if (flags & FAULT_FLAG_ALLOW_RETRY) { |
| 79 | current->maj_flt++; | 86 | if (fault & VM_FAULT_MAJOR) |
| 80 | else | 87 | current->maj_flt++; |
| 81 | current->min_flt++; | 88 | else |
| 89 | current->min_flt++; | ||
| 90 | if (fault & VM_FAULT_RETRY) { | ||
| 91 | flags &= ~FAULT_FLAG_ALLOW_RETRY; | ||
| 92 | |||
| 93 | goto retry; | ||
| 94 | } | ||
| 95 | } | ||
| 82 | 96 | ||
| 83 | pgd = pgd_offset(mm, address); | 97 | pgd = pgd_offset(mm, address); |
| 84 | pud = pud_offset(pgd, address); | 98 | pud = pud_offset(pgd, address); |
