diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 6 | ||||
-rw-r--r-- | kernel/auditsc.c | 2 | ||||
-rw-r--r-- | kernel/exit.c | 8 | ||||
-rw-r--r-- | kernel/kexec.c | 7 | ||||
-rw-r--r-- | kernel/posix-cpu-timers.c | 47 | ||||
-rw-r--r-- | kernel/power/swsusp.c | 2 |
6 files changed, 41 insertions, 31 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index aefa73a8a586..0c56320d38dc 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -133,7 +133,7 @@ struct audit_buffer { | |||
133 | struct list_head list; | 133 | struct list_head list; |
134 | struct sk_buff *skb; /* formatted skb ready to send */ | 134 | struct sk_buff *skb; /* formatted skb ready to send */ |
135 | struct audit_context *ctx; /* NULL or associated context */ | 135 | struct audit_context *ctx; /* NULL or associated context */ |
136 | int gfp_mask; | 136 | gfp_t gfp_mask; |
137 | }; | 137 | }; |
138 | 138 | ||
139 | static void audit_set_pid(struct audit_buffer *ab, pid_t pid) | 139 | static void audit_set_pid(struct audit_buffer *ab, pid_t pid) |
@@ -647,7 +647,7 @@ static inline void audit_get_stamp(struct audit_context *ctx, | |||
647 | * will be written at syscall exit. If there is no associated task, tsk | 647 | * will be written at syscall exit. If there is no associated task, tsk |
648 | * should be NULL. */ | 648 | * should be NULL. */ |
649 | 649 | ||
650 | struct audit_buffer *audit_log_start(struct audit_context *ctx, int gfp_mask, | 650 | struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, |
651 | int type) | 651 | int type) |
652 | { | 652 | { |
653 | struct audit_buffer *ab = NULL; | 653 | struct audit_buffer *ab = NULL; |
@@ -879,7 +879,7 @@ void audit_log_end(struct audit_buffer *ab) | |||
879 | /* Log an audit record. This is a convenience function that calls | 879 | /* Log an audit record. This is a convenience function that calls |
880 | * audit_log_start, audit_log_vformat, and audit_log_end. It may be | 880 | * audit_log_start, audit_log_vformat, and audit_log_end. It may be |
881 | * called in any context. */ | 881 | * called in any context. */ |
882 | void audit_log(struct audit_context *ctx, int gfp_mask, int type, | 882 | void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, |
883 | const char *fmt, ...) | 883 | const char *fmt, ...) |
884 | { | 884 | { |
885 | struct audit_buffer *ab; | 885 | struct audit_buffer *ab; |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 88696f639aab..d8a68509e729 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -803,7 +803,7 @@ static void audit_log_task_info(struct audit_buffer *ab) | |||
803 | up_read(&mm->mmap_sem); | 803 | up_read(&mm->mmap_sem); |
804 | } | 804 | } |
805 | 805 | ||
806 | static void audit_log_exit(struct audit_context *context, unsigned int gfp_mask) | 806 | static void audit_log_exit(struct audit_context *context, gfp_t gfp_mask) |
807 | { | 807 | { |
808 | int i; | 808 | int i; |
809 | struct audit_buffer *ab; | 809 | struct audit_buffer *ab; |
diff --git a/kernel/exit.c b/kernel/exit.c index 4897977a1f4b..3b25b182d2be 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -825,6 +825,14 @@ fastcall NORET_TYPE void do_exit(long code) | |||
825 | 825 | ||
826 | tsk->flags |= PF_EXITING; | 826 | tsk->flags |= PF_EXITING; |
827 | 827 | ||
828 | /* | ||
829 | * Make sure we don't try to process any timer firings | ||
830 | * while we are already exiting. | ||
831 | */ | ||
832 | tsk->it_virt_expires = cputime_zero; | ||
833 | tsk->it_prof_expires = cputime_zero; | ||
834 | tsk->it_sched_expires = 0; | ||
835 | |||
828 | if (unlikely(in_atomic())) | 836 | if (unlikely(in_atomic())) |
829 | printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n", | 837 | printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n", |
830 | current->comm, current->pid, | 838 | current->comm, current->pid, |
diff --git a/kernel/kexec.c b/kernel/kexec.c index cdd4dcd8fb63..36c5d9cd4cc1 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -90,7 +90,7 @@ int kexec_should_crash(struct task_struct *p) | |||
90 | static int kimage_is_destination_range(struct kimage *image, | 90 | static int kimage_is_destination_range(struct kimage *image, |
91 | unsigned long start, unsigned long end); | 91 | unsigned long start, unsigned long end); |
92 | static struct page *kimage_alloc_page(struct kimage *image, | 92 | static struct page *kimage_alloc_page(struct kimage *image, |
93 | unsigned int gfp_mask, | 93 | gfp_t gfp_mask, |
94 | unsigned long dest); | 94 | unsigned long dest); |
95 | 95 | ||
96 | static int do_kimage_alloc(struct kimage **rimage, unsigned long entry, | 96 | static int do_kimage_alloc(struct kimage **rimage, unsigned long entry, |
@@ -326,8 +326,7 @@ static int kimage_is_destination_range(struct kimage *image, | |||
326 | return 0; | 326 | return 0; |
327 | } | 327 | } |
328 | 328 | ||
329 | static struct page *kimage_alloc_pages(unsigned int gfp_mask, | 329 | static struct page *kimage_alloc_pages(gfp_t gfp_mask, unsigned int order) |
330 | unsigned int order) | ||
331 | { | 330 | { |
332 | struct page *pages; | 331 | struct page *pages; |
333 | 332 | ||
@@ -654,7 +653,7 @@ static kimage_entry_t *kimage_dst_used(struct kimage *image, | |||
654 | } | 653 | } |
655 | 654 | ||
656 | static struct page *kimage_alloc_page(struct kimage *image, | 655 | static struct page *kimage_alloc_page(struct kimage *image, |
657 | unsigned int gfp_mask, | 656 | gfp_t gfp_mask, |
658 | unsigned long destination) | 657 | unsigned long destination) |
659 | { | 658 | { |
660 | /* | 659 | /* |
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index 383ba22f0b62..bf374fceb39c 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -497,7 +497,7 @@ static void process_timer_rebalance(struct task_struct *p, | |||
497 | left = cputime_div(cputime_sub(expires.cpu, val.cpu), | 497 | left = cputime_div(cputime_sub(expires.cpu, val.cpu), |
498 | nthreads); | 498 | nthreads); |
499 | do { | 499 | do { |
500 | if (!unlikely(t->exit_state)) { | 500 | if (!unlikely(t->flags & PF_EXITING)) { |
501 | ticks = cputime_add(prof_ticks(t), left); | 501 | ticks = cputime_add(prof_ticks(t), left); |
502 | if (cputime_eq(t->it_prof_expires, | 502 | if (cputime_eq(t->it_prof_expires, |
503 | cputime_zero) || | 503 | cputime_zero) || |
@@ -512,7 +512,7 @@ static void process_timer_rebalance(struct task_struct *p, | |||
512 | left = cputime_div(cputime_sub(expires.cpu, val.cpu), | 512 | left = cputime_div(cputime_sub(expires.cpu, val.cpu), |
513 | nthreads); | 513 | nthreads); |
514 | do { | 514 | do { |
515 | if (!unlikely(t->exit_state)) { | 515 | if (!unlikely(t->flags & PF_EXITING)) { |
516 | ticks = cputime_add(virt_ticks(t), left); | 516 | ticks = cputime_add(virt_ticks(t), left); |
517 | if (cputime_eq(t->it_virt_expires, | 517 | if (cputime_eq(t->it_virt_expires, |
518 | cputime_zero) || | 518 | cputime_zero) || |
@@ -527,7 +527,7 @@ static void process_timer_rebalance(struct task_struct *p, | |||
527 | nsleft = expires.sched - val.sched; | 527 | nsleft = expires.sched - val.sched; |
528 | do_div(nsleft, nthreads); | 528 | do_div(nsleft, nthreads); |
529 | do { | 529 | do { |
530 | if (!unlikely(t->exit_state)) { | 530 | if (!unlikely(t->flags & PF_EXITING)) { |
531 | ns = t->sched_time + nsleft; | 531 | ns = t->sched_time + nsleft; |
532 | if (t->it_sched_expires == 0 || | 532 | if (t->it_sched_expires == 0 || |
533 | t->it_sched_expires > ns) { | 533 | t->it_sched_expires > ns) { |
@@ -566,6 +566,9 @@ static void arm_timer(struct k_itimer *timer, union cpu_time_count now) | |||
566 | struct cpu_timer_list *next; | 566 | struct cpu_timer_list *next; |
567 | unsigned long i; | 567 | unsigned long i; |
568 | 568 | ||
569 | if (CPUCLOCK_PERTHREAD(timer->it_clock) && (p->flags & PF_EXITING)) | ||
570 | return; | ||
571 | |||
569 | head = (CPUCLOCK_PERTHREAD(timer->it_clock) ? | 572 | head = (CPUCLOCK_PERTHREAD(timer->it_clock) ? |
570 | p->cpu_timers : p->signal->cpu_timers); | 573 | p->cpu_timers : p->signal->cpu_timers); |
571 | head += CPUCLOCK_WHICH(timer->it_clock); | 574 | head += CPUCLOCK_WHICH(timer->it_clock); |
@@ -1204,7 +1207,7 @@ static void check_process_timers(struct task_struct *tsk, | |||
1204 | 1207 | ||
1205 | do { | 1208 | do { |
1206 | t = next_thread(t); | 1209 | t = next_thread(t); |
1207 | } while (unlikely(t->exit_state)); | 1210 | } while (unlikely(t->flags & PF_EXITING)); |
1208 | } while (t != tsk); | 1211 | } while (t != tsk); |
1209 | } | 1212 | } |
1210 | } | 1213 | } |
@@ -1293,30 +1296,30 @@ void run_posix_cpu_timers(struct task_struct *tsk) | |||
1293 | 1296 | ||
1294 | #undef UNEXPIRED | 1297 | #undef UNEXPIRED |
1295 | 1298 | ||
1299 | BUG_ON(tsk->exit_state); | ||
1300 | |||
1296 | /* | 1301 | /* |
1297 | * Double-check with locks held. | 1302 | * Double-check with locks held. |
1298 | */ | 1303 | */ |
1299 | read_lock(&tasklist_lock); | 1304 | read_lock(&tasklist_lock); |
1300 | if (likely(tsk->signal != NULL)) { | 1305 | spin_lock(&tsk->sighand->siglock); |
1301 | spin_lock(&tsk->sighand->siglock); | ||
1302 | 1306 | ||
1303 | /* | 1307 | /* |
1304 | * Here we take off tsk->cpu_timers[N] and tsk->signal->cpu_timers[N] | 1308 | * Here we take off tsk->cpu_timers[N] and tsk->signal->cpu_timers[N] |
1305 | * all the timers that are firing, and put them on the firing list. | 1309 | * all the timers that are firing, and put them on the firing list. |
1306 | */ | 1310 | */ |
1307 | check_thread_timers(tsk, &firing); | 1311 | check_thread_timers(tsk, &firing); |
1308 | check_process_timers(tsk, &firing); | 1312 | check_process_timers(tsk, &firing); |
1309 | 1313 | ||
1310 | /* | 1314 | /* |
1311 | * We must release these locks before taking any timer's lock. | 1315 | * We must release these locks before taking any timer's lock. |
1312 | * There is a potential race with timer deletion here, as the | 1316 | * There is a potential race with timer deletion here, as the |
1313 | * siglock now protects our private firing list. We have set | 1317 | * siglock now protects our private firing list. We have set |
1314 | * the firing flag in each timer, so that a deletion attempt | 1318 | * the firing flag in each timer, so that a deletion attempt |
1315 | * that gets the timer lock before we do will give it up and | 1319 | * that gets the timer lock before we do will give it up and |
1316 | * spin until we've taken care of that timer below. | 1320 | * spin until we've taken care of that timer below. |
1317 | */ | 1321 | */ |
1318 | spin_unlock(&tsk->sighand->siglock); | 1322 | spin_unlock(&tsk->sighand->siglock); |
1319 | } | ||
1320 | read_unlock(&tasklist_lock); | 1323 | read_unlock(&tasklist_lock); |
1321 | 1324 | ||
1322 | /* | 1325 | /* |
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 2d5c45676442..10bc5ec496d7 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c | |||
@@ -1095,7 +1095,7 @@ static inline void eat_page(void *page) | |||
1095 | *eaten_memory = c; | 1095 | *eaten_memory = c; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | unsigned long get_usable_page(unsigned gfp_mask) | 1098 | unsigned long get_usable_page(gfp_t gfp_mask) |
1099 | { | 1099 | { |
1100 | unsigned long m; | 1100 | unsigned long m; |
1101 | 1101 | ||