diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-10-11 11:05:26 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2017-10-11 11:05:26 -0400 |
commit | 7d1a0e5d3b200ca532f31905a8398a32836c869c (patch) | |
tree | 36e31c62c5c72f1ca766a0592866f3a7a5f7d181 | |
parent | a87d95e0b511c8cc478e1522cefdb1cddf2f2aa1 (diff) | |
download | 4.12-rt-patches-7d1a0e5d3b200ca532f31905a8398a32836c869c.tar.gz |
trivial refresh of timer-make-the-base-lock-raw.patch
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | patches/timer-make-the-base-lock-raw.patch | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/patches/timer-make-the-base-lock-raw.patch b/patches/timer-make-the-base-lock-raw.patch index f3f6f8800276d..7a2e82d91a054 100644 --- a/patches/timer-make-the-base-lock-raw.patch +++ b/patches/timer-make-the-base-lock-raw.patch @@ -1,3 +1,4 @@ +From fc932ffc87196b4ba8233d3095f0f5bc57b57f7a Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Date: Wed, 13 Jul 2016 18:22:23 +0200 Subject: [PATCH] timer: make the base lock raw @@ -7,10 +8,9 @@ timer rework. One reason is the lack of re-cascading. That means the lock can be made raw and held in IRQ context. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/time/timer.c | 48 ++++++++++++++++++++++++------------------------ - 1 file changed, 24 insertions(+), 24 deletions(-) +diff --git a/kernel/time/timer.c b/kernel/time/timer.c +index 36cec054b8ae..dfc7eef2753c 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -195,7 +195,7 @@ EXPORT_SYMBOL(jiffies_64); @@ -22,7 +22,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> struct timer_list *running_timer; unsigned long clk; unsigned long next_expiry; -@@ -913,10 +913,10 @@ static struct timer_base *lock_timer_bas +@@ -920,10 +920,10 @@ static struct timer_base *lock_timer_base(struct timer_list *timer, if (!(tf & TIMER_MIGRATING)) { base = get_timer_base(tf); @@ -35,7 +35,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } cpu_relax(); } -@@ -986,9 +986,9 @@ static inline int +@@ -1000,9 +1000,9 @@ __mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only) /* See the comment in lock_timer_base() */ timer->flags |= TIMER_MIGRATING; @@ -46,8 +46,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> + raw_spin_lock(&base->lock); WRITE_ONCE(timer->flags, (timer->flags & ~TIMER_BASEMASK) | base->cpu); - } -@@ -1013,7 +1013,7 @@ static inline int + forward_timer_base(base); +@@ -1025,7 +1025,7 @@ __mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only) } out_unlock: @@ -56,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -1106,16 +1106,16 @@ void add_timer_on(struct timer_list *tim +@@ -1118,9 +1118,9 @@ void add_timer_on(struct timer_list *timer, int cpu) if (base != new_base) { timer->flags |= TIMER_MIGRATING; @@ -68,6 +68,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> WRITE_ONCE(timer->flags, (timer->flags & ~TIMER_BASEMASK) | cpu); } +@@ -1128,7 +1128,7 @@ void add_timer_on(struct timer_list *timer, int cpu) debug_activate(timer, timer->expires); internal_add_timer(base, timer); @@ -76,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } EXPORT_SYMBOL_GPL(add_timer_on); -@@ -1141,7 +1141,7 @@ int del_timer(struct timer_list *timer) +@@ -1154,7 +1154,7 @@ int del_timer(struct timer_list *timer) if (timer_pending(timer)) { base = lock_timer_base(timer, &flags); ret = detach_if_pending(timer, base, true); @@ -85,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } return ret; -@@ -1168,7 +1168,7 @@ int try_to_del_timer_sync(struct timer_l +@@ -1181,7 +1181,7 @@ int try_to_del_timer_sync(struct timer_list *timer) if (base->running_timer != timer) ret = detach_if_pending(timer, base, true); @@ -94,7 +95,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -1299,13 +1299,13 @@ static void expire_timers(struct timer_b +@@ -1312,13 +1312,13 @@ static void expire_timers(struct timer_base *base, struct hlist_head *head) data = timer->data; if (timer->flags & TIMER_IRQSAFE) { @@ -112,7 +113,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } } } -@@ -1474,7 +1474,7 @@ u64 get_next_timer_interrupt(unsigned lo +@@ -1487,7 +1487,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) if (cpu_is_offline(smp_processor_id())) return expires; @@ -121,16 +122,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> nextevt = __next_timer_interrupt(base); is_max_delta = (nextevt == base->clk + NEXT_TIMER_MAX_DELTA); base->next_expiry = nextevt; -@@ -1502,7 +1502,7 @@ u64 get_next_timer_interrupt(unsigned lo - if ((expires - basem) > TICK_NSEC) +@@ -1521,7 +1521,7 @@ u64 get_next_timer_interrupt(unsigned long basej, u64 basem) base->is_idle = true; + } } - spin_unlock(&base->lock); + raw_spin_unlock(&base->lock); return cmp_next_hrtimer_event(basem, expires); } -@@ -1590,7 +1590,7 @@ static inline void __run_timers(struct t +@@ -1609,7 +1609,7 @@ static inline void __run_timers(struct timer_base *base) if (!time_after_eq(jiffies, base->clk)) return; @@ -139,7 +140,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> while (time_after_eq(jiffies, base->clk)) { -@@ -1601,7 +1601,7 @@ static inline void __run_timers(struct t +@@ -1620,7 +1620,7 @@ static inline void __run_timers(struct timer_base *base) expire_timers(base, heads + levels); } base->running_timer = NULL; @@ -148,7 +149,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -1786,16 +1786,16 @@ int timers_dead_cpu(unsigned int cpu) +@@ -1818,16 +1818,16 @@ int timers_dead_cpu(unsigned int cpu) * The caller is globally serialized and nobody else * takes two locks at once, deadlock is not possible. */ @@ -169,7 +170,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> put_cpu_ptr(&timer_bases); } return 0; -@@ -1811,7 +1811,7 @@ static void __init init_timer_cpu(int cp +@@ -1843,7 +1843,7 @@ static void __init init_timer_cpu(int cpu) for (i = 0; i < NR_BASES; i++) { base = per_cpu_ptr(&timer_bases[i], cpu); base->cpu = cpu; @@ -178,3 +179,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> base->clk = jiffies; } } +-- +2.1.4 + |