Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e70c7f7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'timers-fixes-for-linus' of...

Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  hrtimers: fix inconsistent lock state on resume in hres_timers_resume
  time-sched.c: tick_nohz_update_jiffies should be static
  locking, hpet: annotate false positive warning
  kernel/fork.c: unused variable 'ret'
  itimers: remove the per-cpu-ish-ness
parents 810ee58d 1d4a7f1c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -628,7 +628,7 @@ static int hpet_cpuhp_notify(struct notifier_block *n,

	switch (action & 0xf) {
	case CPU_ONLINE:
		INIT_DELAYED_WORK(&work.work, hpet_work);
		INIT_DELAYED_WORK_ON_STACK(&work.work, hpet_work);
		init_completion(&work.complete);
		/* FIXME: add schedule_work_on() */
		schedule_delayed_work_on(cpu, &work.work, 0);
+6 −0
Original line number Diff line number Diff line
@@ -48,6 +48,12 @@ extern struct fs_struct init_fs;
	.posix_timers	 = LIST_HEAD_INIT(sig.posix_timers),		\
	.cpu_timers	= INIT_CPU_TIMERS(sig.cpu_timers),		\
	.rlim		= INIT_RLIMITS,					\
	.cputime	= { .totals = {					\
		.utime = cputime_zero,					\
		.stime = cputime_zero,					\
		.sum_exec_runtime = 0,					\
		.lock = __SPIN_LOCK_UNLOCKED(sig.cputime.totals.lock),	\
	}, },								\
}

extern struct nsproxy init_nsproxy;
+18 −11
Original line number Diff line number Diff line
@@ -450,6 +450,7 @@ struct task_cputime {
	cputime_t utime;
	cputime_t stime;
	unsigned long long sum_exec_runtime;
	spinlock_t lock;
};
/* Alternate field names when used to cache expirations. */
#define prof_exp	stime
@@ -465,7 +466,7 @@ struct task_cputime {
 * used for thread group CPU clock calculations.
 */
struct thread_group_cputime {
	struct task_cputime *totals;
	struct task_cputime totals;
};

/*
@@ -2180,24 +2181,30 @@ static inline int spin_needbreak(spinlock_t *lock)
 * Thread group CPU time accounting.
 */

extern int thread_group_cputime_alloc(struct task_struct *);
extern void thread_group_cputime(struct task_struct *, struct task_cputime *);

static inline void thread_group_cputime_init(struct signal_struct *sig)
static inline
void thread_group_cputime(struct task_struct *tsk, struct task_cputime *times)
{
	sig->cputime.totals = NULL;
	struct task_cputime *totals = &tsk->signal->cputime.totals;
	unsigned long flags;

	spin_lock_irqsave(&totals->lock, flags);
	*times = *totals;
	spin_unlock_irqrestore(&totals->lock, flags);
}

static inline int thread_group_cputime_clone_thread(struct task_struct *curr)
static inline void thread_group_cputime_init(struct signal_struct *sig)
{
	if (curr->signal->cputime.totals)
		return 0;
	return thread_group_cputime_alloc(curr);
	sig->cputime.totals = (struct task_cputime){
		.utime = cputime_zero,
		.stime = cputime_zero,
		.sum_exec_runtime = 0,
	};

	spin_lock_init(&sig->cputime.totals.lock);
}

static inline void thread_group_cputime_free(struct signal_struct *sig)
{
	free_percpu(sig->cputime.totals);
}

/*
+6 −0
Original line number Diff line number Diff line
@@ -118,6 +118,12 @@ struct execute_work {
		init_timer(&(_work)->timer);			\
	} while (0)

#define INIT_DELAYED_WORK_ON_STACK(_work, _func)		\
	do {							\
		INIT_WORK(&(_work)->work, (_func));		\
		init_timer_on_stack(&(_work)->timer);		\
	} while (0)

#define INIT_DELAYED_WORK_DEFERRABLE(_work, _func)			\
	do {							\
		INIT_WORK(&(_work)->work, (_func));		\
+7 −9
Original line number Diff line number Diff line
@@ -817,17 +817,17 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
{
	struct signal_struct *sig;
	int ret;

	if (clone_flags & CLONE_THREAD) {
		ret = thread_group_cputime_clone_thread(current);
		if (likely(!ret)) {
		atomic_inc(&current->signal->count);
		atomic_inc(&current->signal->live);
		}
		return ret;
		return 0;
	}
	sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);

	if (sig)
		posix_cpu_timers_init_group(sig);

	tsk->signal = sig;
	if (!sig)
		return -ENOMEM;
@@ -864,8 +864,6 @@ 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);
Loading