diff options
-rw-r--r-- | include/linux/irq.h | 14 | ||||
-rw-r--r-- | kernel/fork.c | 13 | ||||
-rw-r--r-- | kernel/futex.c | 7 | ||||
-rw-r--r-- | kernel/irq/numa_migrate.c | 1 | ||||
-rw-r--r-- | kernel/posix-cpu-timers.c | 2 | ||||
-rw-r--r-- | kernel/timer.c | 7 | ||||
-rw-r--r-- | lib/vsprintf.c | 16 |
7 files changed, 36 insertions, 24 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index ca507c9426b0..b7cbeed972e4 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -487,6 +487,16 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc, | |||
487 | #endif | 487 | #endif |
488 | } | 488 | } |
489 | 489 | ||
490 | static inline void free_desc_masks(struct irq_desc *old_desc, | ||
491 | struct irq_desc *new_desc) | ||
492 | { | ||
493 | free_cpumask_var(old_desc->affinity); | ||
494 | |||
495 | #ifdef CONFIG_GENERIC_PENDING_IRQ | ||
496 | free_cpumask_var(old_desc->pending_mask); | ||
497 | #endif | ||
498 | } | ||
499 | |||
490 | #else /* !CONFIG_SMP */ | 500 | #else /* !CONFIG_SMP */ |
491 | 501 | ||
492 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, | 502 | static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu, |
@@ -500,6 +510,10 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc, | |||
500 | { | 510 | { |
501 | } | 511 | } |
502 | 512 | ||
513 | static inline void free_desc_masks(struct irq_desc *old_desc, | ||
514 | struct irq_desc *new_desc) | ||
515 | { | ||
516 | } | ||
503 | #endif /* CONFIG_SMP */ | 517 | #endif /* CONFIG_SMP */ |
504 | 518 | ||
505 | #endif /* _LINUX_IRQ_H */ | 519 | #endif /* _LINUX_IRQ_H */ |
diff --git a/kernel/fork.c b/kernel/fork.c index 989c7c202b3d..b9e2edd00726 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -800,6 +800,12 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig) | |||
800 | sig->cputime_expires.virt_exp = cputime_zero; | 800 | sig->cputime_expires.virt_exp = cputime_zero; |
801 | sig->cputime_expires.sched_exp = 0; | 801 | sig->cputime_expires.sched_exp = 0; |
802 | 802 | ||
803 | if (sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY) { | ||
804 | sig->cputime_expires.prof_exp = | ||
805 | secs_to_cputime(sig->rlim[RLIMIT_CPU].rlim_cur); | ||
806 | sig->cputimer.running = 1; | ||
807 | } | ||
808 | |||
803 | /* The timer lists. */ | 809 | /* The timer lists. */ |
804 | INIT_LIST_HEAD(&sig->cpu_timers[0]); | 810 | INIT_LIST_HEAD(&sig->cpu_timers[0]); |
805 | INIT_LIST_HEAD(&sig->cpu_timers[1]); | 811 | INIT_LIST_HEAD(&sig->cpu_timers[1]); |
@@ -815,11 +821,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
815 | atomic_inc(¤t->signal->live); | 821 | atomic_inc(¤t->signal->live); |
816 | return 0; | 822 | return 0; |
817 | } | 823 | } |
818 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); | ||
819 | |||
820 | if (sig) | ||
821 | posix_cpu_timers_init_group(sig); | ||
822 | 824 | ||
825 | sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL); | ||
823 | tsk->signal = sig; | 826 | tsk->signal = sig; |
824 | if (!sig) | 827 | if (!sig) |
825 | return -ENOMEM; | 828 | return -ENOMEM; |
@@ -859,6 +862,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
859 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); | 862 | memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim); |
860 | task_unlock(current->group_leader); | 863 | task_unlock(current->group_leader); |
861 | 864 | ||
865 | posix_cpu_timers_init_group(sig); | ||
866 | |||
862 | acct_init_pacct(&sig->pacct); | 867 | acct_init_pacct(&sig->pacct); |
863 | 868 | ||
864 | tty_audit_fork(sig); | 869 | tty_audit_fork(sig); |
diff --git a/kernel/futex.c b/kernel/futex.c index 6b50a024bca2..eef8cd26b5e5 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -883,7 +883,12 @@ retry_private: | |||
883 | out_unlock: | 883 | out_unlock: |
884 | double_unlock_hb(hb1, hb2); | 884 | double_unlock_hb(hb1, hb2); |
885 | 885 | ||
886 | /* drop_futex_key_refs() must be called outside the spinlocks. */ | 886 | /* |
887 | * drop_futex_key_refs() must be called outside the spinlocks. During | ||
888 | * the requeue we moved futex_q's from the hash bucket at key1 to the | ||
889 | * one at key2 and updated their key pointer. We no longer need to | ||
890 | * hold the references to key1. | ||
891 | */ | ||
887 | while (--drop_count >= 0) | 892 | while (--drop_count >= 0) |
888 | drop_futex_key_refs(&key1); | 893 | drop_futex_key_refs(&key1); |
889 | 894 | ||
diff --git a/kernel/irq/numa_migrate.c b/kernel/irq/numa_migrate.c index 243d6121e50e..44bbdcbaf8d2 100644 --- a/kernel/irq/numa_migrate.c +++ b/kernel/irq/numa_migrate.c | |||
@@ -54,6 +54,7 @@ static bool init_copy_one_irq_desc(int irq, struct irq_desc *old_desc, | |||
54 | static void free_one_irq_desc(struct irq_desc *old_desc, struct irq_desc *desc) | 54 | static void free_one_irq_desc(struct irq_desc *old_desc, struct irq_desc *desc) |
55 | { | 55 | { |
56 | free_kstat_irqs(old_desc, desc); | 56 | free_kstat_irqs(old_desc, desc); |
57 | free_desc_masks(old_desc, desc); | ||
57 | arch_free_chip_data(old_desc, desc); | 58 | arch_free_chip_data(old_desc, desc); |
58 | } | 59 | } |
59 | 60 | ||
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index 8e5d9a68b022..bb53185d8c78 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
@@ -18,7 +18,7 @@ void update_rlimit_cpu(unsigned long rlim_new) | |||
18 | 18 | ||
19 | cputime = secs_to_cputime(rlim_new); | 19 | cputime = secs_to_cputime(rlim_new); |
20 | if (cputime_eq(current->signal->it_prof_expires, cputime_zero) || | 20 | if (cputime_eq(current->signal->it_prof_expires, cputime_zero) || |
21 | cputime_lt(current->signal->it_prof_expires, cputime)) { | 21 | cputime_gt(current->signal->it_prof_expires, cputime)) { |
22 | spin_lock_irq(¤t->sighand->siglock); | 22 | spin_lock_irq(¤t->sighand->siglock); |
23 | set_process_cpu_timer(current, CPUCLOCK_PROF, &cputime, NULL); | 23 | set_process_cpu_timer(current, CPUCLOCK_PROF, &cputime, NULL); |
24 | spin_unlock_irq(¤t->sighand->siglock); | 24 | spin_unlock_irq(¤t->sighand->siglock); |
diff --git a/kernel/timer.c b/kernel/timer.c index b4555568b4e4..cffffad01c31 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -531,10 +531,13 @@ static void __init_timer(struct timer_list *timer, | |||
531 | } | 531 | } |
532 | 532 | ||
533 | /** | 533 | /** |
534 | * init_timer - initialize a timer. | 534 | * init_timer_key - initialize a timer |
535 | * @timer: the timer to be initialized | 535 | * @timer: the timer to be initialized |
536 | * @name: name of the timer | ||
537 | * @key: lockdep class key of the fake lock used for tracking timer | ||
538 | * sync lock dependencies | ||
536 | * | 539 | * |
537 | * init_timer() must be done to a timer prior calling *any* of the | 540 | * init_timer_key() must be done to a timer prior calling *any* of the |
538 | * other timer functions. | 541 | * other timer functions. |
539 | */ | 542 | */ |
540 | void init_timer_key(struct timer_list *timer, | 543 | void init_timer_key(struct timer_list *timer, |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index be3001f912e4..7536acea135b 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -1051,13 +1051,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
1051 | if (str < end) | 1051 | if (str < end) |
1052 | *str = '%'; | 1052 | *str = '%'; |
1053 | ++str; | 1053 | ++str; |
1054 | if (*fmt) { | ||
1055 | if (str < end) | ||
1056 | *str = *fmt; | ||
1057 | ++str; | ||
1058 | } else { | ||
1059 | --fmt; | ||
1060 | } | ||
1061 | break; | 1054 | break; |
1062 | 1055 | ||
1063 | case FORMAT_TYPE_NRCHARS: { | 1056 | case FORMAT_TYPE_NRCHARS: { |
@@ -1339,8 +1332,6 @@ do { \ | |||
1339 | break; | 1332 | break; |
1340 | 1333 | ||
1341 | case FORMAT_TYPE_INVALID: | 1334 | case FORMAT_TYPE_INVALID: |
1342 | if (!*fmt) | ||
1343 | --fmt; | ||
1344 | break; | 1335 | break; |
1345 | 1336 | ||
1346 | case FORMAT_TYPE_NRCHARS: { | 1337 | case FORMAT_TYPE_NRCHARS: { |
@@ -1523,13 +1514,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) | |||
1523 | if (str < end) | 1514 | if (str < end) |
1524 | *str = '%'; | 1515 | *str = '%'; |
1525 | ++str; | 1516 | ++str; |
1526 | if (*fmt) { | ||
1527 | if (str < end) | ||
1528 | *str = *fmt; | ||
1529 | ++str; | ||
1530 | } else { | ||
1531 | --fmt; | ||
1532 | } | ||
1533 | break; | 1517 | break; |
1534 | 1518 | ||
1535 | case FORMAT_TYPE_NRCHARS: | 1519 | case FORMAT_TYPE_NRCHARS: |