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

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

Merge branch 'timers/core-v2' of...

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

 into timers/core

Pull dynticks updates from Frederic Weisbecker:

  * Fix a bug where posix cpu timers requeued due to interval got ignored on full
    dynticks CPUs (not a regression though as it only impacts full dynticks and the
    bug is there since we merged full dynticks).

  * Optimizations and cleanups on the use of per CPU APIs to improve code readability,
    performance and debuggability in the nohz subsystem;

  * Optimize posix cpu timer by sparing stub workqueue queue with full dynticks off case

  * Rename some functions to extend with *_this_cpu() suffix for clarity

  * Refine the naming of some context tracking subsystem state accessors

  * Trivial spelling fix by Paul Gortmaker

Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents dea4f48a c925077c
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -17,13 +17,13 @@ extern void __context_tracking_task_switch(struct task_struct *prev,

static inline void user_enter(void)
{
	if (static_key_false(&context_tracking_enabled))
	if (context_tracking_is_enabled())
		context_tracking_user_enter();

}
static inline void user_exit(void)
{
	if (static_key_false(&context_tracking_enabled))
	if (context_tracking_is_enabled())
		context_tracking_user_exit();
}

@@ -31,7 +31,7 @@ static inline enum ctx_state exception_enter(void)
{
	enum ctx_state prev_ctx;

	if (!static_key_false(&context_tracking_enabled))
	if (!context_tracking_is_enabled())
		return 0;

	prev_ctx = this_cpu_read(context_tracking.state);
@@ -42,7 +42,7 @@ static inline enum ctx_state exception_enter(void)

static inline void exception_exit(enum ctx_state prev_ctx)
{
	if (static_key_false(&context_tracking_enabled)) {
	if (context_tracking_is_enabled()) {
		if (prev_ctx == IN_USER)
			context_tracking_user_enter();
	}
@@ -51,7 +51,7 @@ static inline void exception_exit(enum ctx_state prev_ctx)
static inline void context_tracking_task_switch(struct task_struct *prev,
						struct task_struct *next)
{
	if (static_key_false(&context_tracking_enabled))
	if (context_tracking_is_enabled())
		__context_tracking_task_switch(prev, next);
}
#else
+8 −3
Original line number Diff line number Diff line
@@ -22,15 +22,20 @@ struct context_tracking {
extern struct static_key context_tracking_enabled;
DECLARE_PER_CPU(struct context_tracking, context_tracking);

static inline bool context_tracking_in_user(void)
static inline bool context_tracking_is_enabled(void)
{
	return __this_cpu_read(context_tracking.state) == IN_USER;
	return static_key_false(&context_tracking_enabled);
}

static inline bool context_tracking_active(void)
static inline bool context_tracking_cpu_is_enabled(void)
{
	return __this_cpu_read(context_tracking.active);
}

static inline bool context_tracking_in_user(void)
{
	return __this_cpu_read(context_tracking.state) == IN_USER;
}
#else
static inline bool context_tracking_in_user(void) { return false; }
static inline bool context_tracking_active(void) { return false; }
+4 −4
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ extern struct cpumask *tick_get_broadcast_oneshot_mask(void);
extern void tick_clock_notify(void);
extern int tick_check_oneshot_change(int allow_nohz);
extern struct tick_sched *tick_get_tick_sched(int cpu);
extern void tick_check_idle(int cpu);
extern void tick_check_idle(void);
extern int tick_oneshot_mode_active(void);
#  ifndef arch_needs_cpu
#   define arch_needs_cpu(cpu) (0)
@@ -112,7 +112,7 @@ extern int tick_oneshot_mode_active(void);
# else
static inline void tick_clock_notify(void) { }
static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
static inline void tick_check_idle(int cpu) { }
static inline void tick_check_idle(void) { }
static inline int tick_oneshot_mode_active(void) { return 0; }
# endif

@@ -121,7 +121,7 @@ static inline void tick_init(void) { }
static inline void tick_cancel_sched_timer(int cpu) { }
static inline void tick_clock_notify(void) { }
static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
static inline void tick_check_idle(int cpu) { }
static inline void tick_check_idle(void) { }
static inline int tick_oneshot_mode_active(void) { return 0; }
#endif /* !CONFIG_GENERIC_CLOCKEVENTS */

@@ -165,7 +165,7 @@ extern cpumask_var_t tick_nohz_full_mask;

static inline bool tick_nohz_full_enabled(void)
{
	if (!static_key_false(&context_tracking_enabled))
	if (!context_tracking_is_enabled())
		return false;

	return tick_nohz_full_running;
+2 −2
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ static inline bool vtime_accounting_enabled(void) { return true; }
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
static inline bool vtime_accounting_enabled(void)
{
	if (static_key_false(&context_tracking_enabled)) {
		if (context_tracking_active())
	if (context_tracking_is_enabled()) {
		if (context_tracking_cpu_is_enabled())
			return true;
	}

+1 −1
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ config CONTEXT_TRACKING_FORCE
	  dynticks subsystem by forcing the context tracking on all
	  CPUs in the system.

	  Say Y only if you're working on the developpement of an
	  Say Y only if you're working on the development of an
	  architecture backend for the context tracking.

	  Say N otherwise, this option brings an overhead that you
Loading