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

Commit bf967be3 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'timers/nohz' of...

Merge branch 'timers/nohz' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks

 into timers/nohz

Pull nohz-full enabling patches from Frederic Weisbecker:

  " This handles perf and CPUs that get more than one task and fix posix cpu timers
    handling.

    This can finally stop the tick."

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents a166fcf0 67826eae
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -799,6 +799,12 @@ static inline int __perf_event_disable(void *info) { return -1; }
static inline void perf_event_task_tick(void)				{ }
#endif

#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_NO_HZ_FULL)
extern bool perf_event_can_stop_tick(void);
#else
static inline bool perf_event_can_stop_tick(void)			{ return true; }
#endif

#define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))

/*
+6 −0
Original line number Diff line number Diff line
@@ -1856,6 +1856,12 @@ extern void wake_up_nohz_cpu(int cpu);
static inline void wake_up_nohz_cpu(int cpu) { }
#endif

#ifdef CONFIG_NO_HZ_FULL
extern bool sched_can_stop_tick(void);
#else
static inline bool sched_can_stop_tick(void) { return false; }
#endif

#ifdef CONFIG_SCHED_AUTOGROUP
extern void sched_autogroup_create_attach(struct task_struct *p);
extern void sched_autogroup_detach(struct task_struct *p);
+4 −0
Original line number Diff line number Diff line
@@ -160,13 +160,17 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
#ifdef CONFIG_NO_HZ_FULL
extern void tick_nohz_init(void);
extern int tick_nohz_full_cpu(int cpu);
extern void tick_nohz_full_check(void);
extern void tick_nohz_full_kick(void);
extern void tick_nohz_full_kick_all(void);
extern void tick_nohz_task_switch(struct task_struct *tsk);
#else
static inline void tick_nohz_init(void) { }
static inline int tick_nohz_full_cpu(int cpu) { return 0; }
static inline void tick_nohz_full_check(void) { }
static inline void tick_nohz_full_kick(void) { }
static inline void tick_nohz_full_kick_all(void) { }
static inline void tick_nohz_task_switch(struct task_struct *tsk) { }
#endif


+16 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/hash.h>
#include <linux/tick.h>
#include <linux/sysfs.h>
#include <linux/dcache.h>
#include <linux/percpu.h>
@@ -655,8 +656,12 @@ static void perf_pmu_rotate_start(struct pmu *pmu)

	WARN_ON(!irqs_disabled());

	if (list_empty(&cpuctx->rotation_list))
	if (list_empty(&cpuctx->rotation_list)) {
		int was_empty = list_empty(head);
		list_add(&cpuctx->rotation_list, head);
		if (was_empty)
			tick_nohz_full_kick();
	}
}

static void get_ctx(struct perf_event_context *ctx)
@@ -2555,6 +2560,16 @@ done:
		list_del_init(&cpuctx->rotation_list);
}

#ifdef CONFIG_NO_HZ_FULL
bool perf_event_can_stop_tick(void)
{
	if (list_empty(&__get_cpu_var(rotation_list)))
		return true;
	else
		return false;
}
#endif

void perf_event_task_tick(void)
{
	struct list_head *head = &__get_cpu_var(rotation_list);
+3 −3
Original line number Diff line number Diff line
@@ -673,12 +673,12 @@ static void posix_cpu_timer_kick_nohz(void)
bool posix_cpu_timers_can_stop_tick(struct task_struct *tsk)
{
	if (!task_cputime_zero(&tsk->cputime_expires))
		return true;
		return false;

	if (tsk->signal->cputimer.running)
		return true;

		return false;

	return true;
}
#else
static inline void posix_cpu_timer_kick_nohz(void) { }
Loading