diff options
author | Paul Mackerras <paulus@samba.org> | 2005-10-22 02:51:34 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-10-22 02:51:34 -0400 |
commit | 985990137e81ca9fd6561cd0f7d1a9695ec57d5a (patch) | |
tree | 7a67493285623a7356ba7065cada6728993d1a3b /kernel | |
parent | 834289447542b7ec55c0847486616d4d53ddf891 (diff) | |
parent | 63172cb3d5ef762dcb60a292bc7f016b85cf6e1f (diff) |
Merge changes from linux-2.6 by hand
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 1 | ||||
-rw-r--r-- | kernel/fork.c | 2 | ||||
-rw-r--r-- | kernel/posix-cpu-timers.c | 3 | ||||
-rw-r--r-- | kernel/posix-timers.c | 2 | ||||
-rw-r--r-- | kernel/rcupdate.c | 13 | ||||
-rw-r--r-- | kernel/signal.c | 14 | ||||
-rw-r--r-- | kernel/time.c | 1 |
7 files changed, 20 insertions, 16 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 43077732619b..3b25b182d2be 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -843,6 +843,7 @@ fastcall NORET_TYPE void do_exit(long code) | |||
843 | group_dead = atomic_dec_and_test(&tsk->signal->live); | 843 | group_dead = atomic_dec_and_test(&tsk->signal->live); |
844 | if (group_dead) { | 844 | if (group_dead) { |
845 | del_timer_sync(&tsk->signal->real_timer); | 845 | del_timer_sync(&tsk->signal->real_timer); |
846 | exit_itimers(tsk->signal); | ||
846 | acct_process(code); | 847 | acct_process(code); |
847 | } | 848 | } |
848 | exit_mm(tsk); | 849 | exit_mm(tsk); |
diff --git a/kernel/fork.c b/kernel/fork.c index 533ce27f4b2c..280bd44ac441 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -848,7 +848,7 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p) | |||
848 | { | 848 | { |
849 | unsigned long new_flags = p->flags; | 849 | unsigned long new_flags = p->flags; |
850 | 850 | ||
851 | new_flags &= ~PF_SUPERPRIV; | 851 | new_flags &= ~(PF_SUPERPRIV | PF_NOFREEZE); |
852 | new_flags |= PF_FORKNOEXEC; | 852 | new_flags |= PF_FORKNOEXEC; |
853 | if (!(clone_flags & CLONE_PTRACE)) | 853 | if (!(clone_flags & CLONE_PTRACE)) |
854 | p->ptrace = 0; | 854 | p->ptrace = 0; |
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index ad85d3f0dcc4..7a51a5597c33 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -424,6 +424,7 @@ static void cleanup_timers(struct list_head *head, | |||
424 | cputime_t ptime = cputime_add(utime, stime); | 424 | cputime_t ptime = cputime_add(utime, stime); |
425 | 425 | ||
426 | list_for_each_entry_safe(timer, next, head, entry) { | 426 | list_for_each_entry_safe(timer, next, head, entry) { |
427 | put_task_struct(timer->task); | ||
427 | timer->task = NULL; | 428 | timer->task = NULL; |
428 | list_del_init(&timer->entry); | 429 | list_del_init(&timer->entry); |
429 | if (cputime_lt(timer->expires.cpu, ptime)) { | 430 | if (cputime_lt(timer->expires.cpu, ptime)) { |
@@ -436,6 +437,7 @@ static void cleanup_timers(struct list_head *head, | |||
436 | 437 | ||
437 | ++head; | 438 | ++head; |
438 | list_for_each_entry_safe(timer, next, head, entry) { | 439 | list_for_each_entry_safe(timer, next, head, entry) { |
440 | put_task_struct(timer->task); | ||
439 | timer->task = NULL; | 441 | timer->task = NULL; |
440 | list_del_init(&timer->entry); | 442 | list_del_init(&timer->entry); |
441 | if (cputime_lt(timer->expires.cpu, utime)) { | 443 | if (cputime_lt(timer->expires.cpu, utime)) { |
@@ -448,6 +450,7 @@ static void cleanup_timers(struct list_head *head, | |||
448 | 450 | ||
449 | ++head; | 451 | ++head; |
450 | list_for_each_entry_safe(timer, next, head, entry) { | 452 | list_for_each_entry_safe(timer, next, head, entry) { |
453 | put_task_struct(timer->task); | ||
451 | timer->task = NULL; | 454 | timer->task = NULL; |
452 | list_del_init(&timer->entry); | 455 | list_del_init(&timer->entry); |
453 | if (timer->expires.sched < sched_time) { | 456 | if (timer->expires.sched < sched_time) { |
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index b7b532acd9fc..dda3cda73c77 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -1157,7 +1157,7 @@ retry_delete: | |||
1157 | } | 1157 | } |
1158 | 1158 | ||
1159 | /* | 1159 | /* |
1160 | * This is called by __exit_signal, only when there are no more | 1160 | * This is called by do_exit or de_thread, only when there are no more |
1161 | * references to the shared signal_struct. | 1161 | * references to the shared signal_struct. |
1162 | */ | 1162 | */ |
1163 | void exit_itimers(struct signal_struct *sig) | 1163 | void exit_itimers(struct signal_struct *sig) |
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index bef3b6901b76..2559d4b8f23f 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -71,7 +71,7 @@ DEFINE_PER_CPU(struct rcu_data, rcu_bh_data) = { 0L }; | |||
71 | 71 | ||
72 | /* Fake initialization required by compiler */ | 72 | /* Fake initialization required by compiler */ |
73 | static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL}; | 73 | static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL}; |
74 | static int maxbatch = 10; | 74 | static int maxbatch = 10000; |
75 | 75 | ||
76 | #ifndef __HAVE_ARCH_CMPXCHG | 76 | #ifndef __HAVE_ARCH_CMPXCHG |
77 | /* | 77 | /* |
@@ -109,6 +109,10 @@ void fastcall call_rcu(struct rcu_head *head, | |||
109 | rdp = &__get_cpu_var(rcu_data); | 109 | rdp = &__get_cpu_var(rcu_data); |
110 | *rdp->nxttail = head; | 110 | *rdp->nxttail = head; |
111 | rdp->nxttail = &head->next; | 111 | rdp->nxttail = &head->next; |
112 | |||
113 | if (unlikely(++rdp->count > 10000)) | ||
114 | set_need_resched(); | ||
115 | |||
112 | local_irq_restore(flags); | 116 | local_irq_restore(flags); |
113 | } | 117 | } |
114 | 118 | ||
@@ -140,6 +144,12 @@ void fastcall call_rcu_bh(struct rcu_head *head, | |||
140 | rdp = &__get_cpu_var(rcu_bh_data); | 144 | rdp = &__get_cpu_var(rcu_bh_data); |
141 | *rdp->nxttail = head; | 145 | *rdp->nxttail = head; |
142 | rdp->nxttail = &head->next; | 146 | rdp->nxttail = &head->next; |
147 | rdp->count++; | ||
148 | /* | ||
149 | * Should we directly call rcu_do_batch() here ? | ||
150 | * if (unlikely(rdp->count > 10000)) | ||
151 | * rcu_do_batch(rdp); | ||
152 | */ | ||
143 | local_irq_restore(flags); | 153 | local_irq_restore(flags); |
144 | } | 154 | } |
145 | 155 | ||
@@ -157,6 +167,7 @@ static void rcu_do_batch(struct rcu_data *rdp) | |||
157 | next = rdp->donelist = list->next; | 167 | next = rdp->donelist = list->next; |
158 | list->func(list); | 168 | list->func(list); |
159 | list = next; | 169 | list = next; |
170 | rdp->count--; | ||
160 | if (++count >= maxbatch) | 171 | if (++count >= maxbatch) |
161 | break; | 172 | break; |
162 | } | 173 | } |
diff --git a/kernel/signal.c b/kernel/signal.c index 50c992643771..f2b96b08fb44 100644 --- a/kernel/signal.c +++ b/kernel/signal.c | |||
@@ -397,20 +397,8 @@ void __exit_signal(struct task_struct *tsk) | |||
397 | flush_sigqueue(&tsk->pending); | 397 | flush_sigqueue(&tsk->pending); |
398 | if (sig) { | 398 | if (sig) { |
399 | /* | 399 | /* |
400 | * We are cleaning up the signal_struct here. We delayed | 400 | * We are cleaning up the signal_struct here. |
401 | * calling exit_itimers until after flush_sigqueue, just in | ||
402 | * case our thread-local pending queue contained a queued | ||
403 | * timer signal that would have been cleared in | ||
404 | * exit_itimers. When that called sigqueue_free, it would | ||
405 | * attempt to re-take the tasklist_lock and deadlock. This | ||
406 | * can never happen if we ensure that all queues the | ||
407 | * timer's signal might be queued on have been flushed | ||
408 | * first. The shared_pending queue, and our own pending | ||
409 | * queue are the only queues the timer could be on, since | ||
410 | * there are no other threads left in the group and timer | ||
411 | * signals are constrained to threads inside the group. | ||
412 | */ | 401 | */ |
413 | exit_itimers(sig); | ||
414 | exit_thread_group_keys(sig); | 402 | exit_thread_group_keys(sig); |
415 | kmem_cache_free(signal_cachep, sig); | 403 | kmem_cache_free(signal_cachep, sig); |
416 | } | 404 | } |
diff --git a/kernel/time.c b/kernel/time.c index dd5ae1162a8f..40c2410ac99a 100644 --- a/kernel/time.c +++ b/kernel/time.c | |||
@@ -570,6 +570,7 @@ void getnstimeofday(struct timespec *tv) | |||
570 | tv->tv_sec = x.tv_sec; | 570 | tv->tv_sec = x.tv_sec; |
571 | tv->tv_nsec = x.tv_usec * NSEC_PER_USEC; | 571 | tv->tv_nsec = x.tv_usec * NSEC_PER_USEC; |
572 | } | 572 | } |
573 | EXPORT_SYMBOL_GPL(getnstimeofday); | ||
573 | #endif | 574 | #endif |
574 | 575 | ||
575 | #if (BITS_PER_LONG < 64) | 576 | #if (BITS_PER_LONG < 64) |