Skip to content

Commit

Permalink
Merge branches 'core-fixes-for-linus', 'irq-fixes-for-linus' and 'tim…
Browse files Browse the repository at this point in the history
…ers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  printk: fix wrong format string iter for printk
  futex: comment requeue key reference semantics

* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  irq: fix cpumask memory leak on offstack cpumask kernels

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  posix-timers: fix RLIMIT_CPU && setitimer(CPUCLOCK_PROF)
  posix-timers: fix RLIMIT_CPU && fork()
  timers: add missing kernel-doc
  • Loading branch information
torvalds committed Apr 9, 2009
4 parents 91e58b6 + 022624a + 9756b15 + 8f2e586 commit 422a253
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 24 deletions.
14 changes: 14 additions & 0 deletions include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,16 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc,
#endif
}

static inline void free_desc_masks(struct irq_desc *old_desc,
struct irq_desc *new_desc)
{
free_cpumask_var(old_desc->affinity);

#ifdef CONFIG_GENERIC_PENDING_IRQ
free_cpumask_var(old_desc->pending_mask);
#endif
}

#else /* !CONFIG_SMP */

static inline bool init_alloc_desc_masks(struct irq_desc *desc, int cpu,
Expand All @@ -500,6 +510,10 @@ static inline void init_copy_desc_masks(struct irq_desc *old_desc,
{
}

static inline void free_desc_masks(struct irq_desc *old_desc,
struct irq_desc *new_desc)
{
}
#endif /* CONFIG_SMP */

#endif /* _LINUX_IRQ_H */
13 changes: 9 additions & 4 deletions kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,12 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
sig->cputime_expires.virt_exp = cputime_zero;
sig->cputime_expires.sched_exp = 0;

if (sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY) {
sig->cputime_expires.prof_exp =
secs_to_cputime(sig->rlim[RLIMIT_CPU].rlim_cur);
sig->cputimer.running = 1;
}

/* The timer lists. */
INIT_LIST_HEAD(&sig->cpu_timers[0]);
INIT_LIST_HEAD(&sig->cpu_timers[1]);
Expand All @@ -815,11 +821,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
atomic_inc(&current->signal->live);
return 0;
}
sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);

if (sig)
posix_cpu_timers_init_group(sig);

sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
tsk->signal = sig;
if (!sig)
return -ENOMEM;
Expand Down Expand Up @@ -859,6 +862,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
task_unlock(current->group_leader);

posix_cpu_timers_init_group(sig);

acct_init_pacct(&sig->pacct);

tty_audit_fork(sig);
Expand Down
7 changes: 6 additions & 1 deletion kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,12 @@ static int futex_requeue(u32 __user *uaddr1, int fshared, u32 __user *uaddr2,
out_unlock:
double_unlock_hb(hb1, hb2);

/* drop_futex_key_refs() must be called outside the spinlocks. */
/*
* drop_futex_key_refs() must be called outside the spinlocks. During
* the requeue we moved futex_q's from the hash bucket at key1 to the
* one at key2 and updated their key pointer. We no longer need to
* hold the references to key1.
*/
while (--drop_count >= 0)
drop_futex_key_refs(&key1);

Expand Down
1 change: 1 addition & 0 deletions kernel/irq/numa_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static bool init_copy_one_irq_desc(int irq, struct irq_desc *old_desc,
static void free_one_irq_desc(struct irq_desc *old_desc, struct irq_desc *desc)
{
free_kstat_irqs(old_desc, desc);
free_desc_masks(old_desc, desc);
arch_free_chip_data(old_desc, desc);
}

Expand Down
2 changes: 1 addition & 1 deletion kernel/posix-cpu-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void update_rlimit_cpu(unsigned long rlim_new)

cputime = secs_to_cputime(rlim_new);
if (cputime_eq(current->signal->it_prof_expires, cputime_zero) ||
cputime_lt(current->signal->it_prof_expires, cputime)) {
cputime_gt(current->signal->it_prof_expires, cputime)) {
spin_lock_irq(&current->sighand->siglock);
set_process_cpu_timer(current, CPUCLOCK_PROF, &cputime, NULL);
spin_unlock_irq(&current->sighand->siglock);
Expand Down
7 changes: 5 additions & 2 deletions kernel/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,13 @@ static void __init_timer(struct timer_list *timer,
}

/**
* init_timer - initialize a timer.
* init_timer_key - initialize a timer
* @timer: the timer to be initialized
* @name: name of the timer
* @key: lockdep class key of the fake lock used for tracking timer
* sync lock dependencies
*
* init_timer() must be done to a timer prior calling *any* of the
* init_timer_key() must be done to a timer prior calling *any* of the
* other timer functions.
*/
void init_timer_key(struct timer_list *timer,
Expand Down
16 changes: 0 additions & 16 deletions lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,13 +1051,6 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
if (str < end)
*str = '%';
++str;
if (*fmt) {
if (str < end)
*str = *fmt;
++str;
} else {
--fmt;
}
break;

case FORMAT_TYPE_NRCHARS: {
Expand Down Expand Up @@ -1339,8 +1332,6 @@ do { \
break;

case FORMAT_TYPE_INVALID:
if (!*fmt)
--fmt;
break;

case FORMAT_TYPE_NRCHARS: {
Expand Down Expand Up @@ -1523,13 +1514,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
if (str < end)
*str = '%';
++str;
if (*fmt) {
if (str < end)
*str = *fmt;
++str;
} else {
--fmt;
}
break;

case FORMAT_TYPE_NRCHARS:
Expand Down

0 comments on commit 422a253

Please sign in to comment.