summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-22 21:57:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-22 21:57:44 -0400
commit43224b96af3154cedd7220f7b90094905f07ac78 (patch)
tree44279acc4613b314ff031620fd62641db3c85b71 /kernel/rcu
parentd70b3ef54ceaf1c7c92209f5a662a670d04cbed9 (diff)
parent1cb6c2151850584ee805fdcf088af0bb81f4b086 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "A rather largish update for everything time and timer related: - Cache footprint optimizations for both hrtimers and timer wheel - Lower the NOHZ impact on systems which have NOHZ or timer migration disabled at runtime. - Optimize run time overhead of hrtimer interrupt by making the clock offset updates smarter - hrtimer cleanups and removal of restrictions to tackle some problems in sched/perf - Some more leap second tweaks - Another round of changes addressing the 2038 problem - First step to change the internals of clock event devices by introducing the necessary infrastructure - Allow constant folding for usecs/msecs_to_jiffies() - The usual pile of clockevent/clocksource driver updates The hrtimer changes contain updates to sched, perf and x86 as they depend on them plus changes all over the tree to cleanup API changes and redundant code, which got copied all over the place. The y2038 changes touch s390 to remove the last non 2038 safe code related to boot/persistant clock" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (114 commits) clocksource: Increase dependencies of timer-stm32 to limit build wreckage timer: Minimize nohz off overhead timer: Reduce timer migration overhead if disabled timer: Stats: Simplify the flags handling timer: Replace timer base by a cpu index timer: Use hlist for the timer wheel hash buckets timer: Remove FIFO "guarantee" timers: Sanitize catchup_timer_jiffies() usage hrtimer: Allow hrtimer::function() to free the timer seqcount: Introduce raw_write_seqcount_barrier() seqcount: Rename write_seqcount_barrier() hrtimer: Fix hrtimer_is_queued() hole hrtimer: Remove HRTIMER_STATE_MIGRATE selftest: Timers: Avoid signal deadlock in leap-a-day timekeeping: Copy the shadow-timekeeper over the real timekeeper last clockevents: Check state instead of mode in suspend/resume path selftests: timers: Add leap-second timer edge testing to leap-a-day.c ntp: Do leapsecond adjustment in adjtimex read path time: Prevent early expiry of hrtimers[CLOCK_REALTIME] at the leap second edge ntp: Introduce and use SECS_PER_DAY macro instead of 86400 ...
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree_plugin.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index 32664347091a..013485fb2b06 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -1375,9 +1375,9 @@ static void rcu_prepare_kthreads(int cpu)
1375 * Because we not have RCU_FAST_NO_HZ, just check whether this CPU needs 1375 * Because we not have RCU_FAST_NO_HZ, just check whether this CPU needs
1376 * any flavor of RCU. 1376 * any flavor of RCU.
1377 */ 1377 */
1378int rcu_needs_cpu(unsigned long *delta_jiffies) 1378int rcu_needs_cpu(u64 basemono, u64 *nextevt)
1379{ 1379{
1380 *delta_jiffies = ULONG_MAX; 1380 *nextevt = KTIME_MAX;
1381 return IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL) 1381 return IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL)
1382 ? 0 : rcu_cpu_has_callbacks(NULL); 1382 ? 0 : rcu_cpu_has_callbacks(NULL);
1383} 1383}
@@ -1439,8 +1439,6 @@ module_param(rcu_idle_gp_delay, int, 0644);
1439static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY; 1439static int rcu_idle_lazy_gp_delay = RCU_IDLE_LAZY_GP_DELAY;
1440module_param(rcu_idle_lazy_gp_delay, int, 0644); 1440module_param(rcu_idle_lazy_gp_delay, int, 0644);
1441 1441
1442extern int tick_nohz_active;
1443
1444/* 1442/*
1445 * Try to advance callbacks for all flavors of RCU on the current CPU, but 1443 * Try to advance callbacks for all flavors of RCU on the current CPU, but
1446 * only if it has been awhile since the last time we did so. Afterwards, 1444 * only if it has been awhile since the last time we did so. Afterwards,
@@ -1487,12 +1485,13 @@ static bool __maybe_unused rcu_try_advance_all_cbs(void)
1487 * 1485 *
1488 * The caller must have disabled interrupts. 1486 * The caller must have disabled interrupts.
1489 */ 1487 */
1490int rcu_needs_cpu(unsigned long *dj) 1488int rcu_needs_cpu(u64 basemono, u64 *nextevt)
1491{ 1489{
1492 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks); 1490 struct rcu_dynticks *rdtp = this_cpu_ptr(&rcu_dynticks);
1491 unsigned long dj;
1493 1492
1494 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL)) { 1493 if (IS_ENABLED(CONFIG_RCU_NOCB_CPU_ALL)) {
1495 *dj = ULONG_MAX; 1494 *nextevt = KTIME_MAX;
1496 return 0; 1495 return 0;
1497 } 1496 }
1498 1497
@@ -1501,7 +1500,7 @@ int rcu_needs_cpu(unsigned long *dj)
1501 1500
1502 /* If no callbacks, RCU doesn't need the CPU. */ 1501 /* If no callbacks, RCU doesn't need the CPU. */
1503 if (!rcu_cpu_has_callbacks(&rdtp->all_lazy)) { 1502 if (!rcu_cpu_has_callbacks(&rdtp->all_lazy)) {
1504 *dj = ULONG_MAX; 1503 *nextevt = KTIME_MAX;
1505 return 0; 1504 return 0;
1506 } 1505 }
1507 1506
@@ -1515,11 +1514,12 @@ int rcu_needs_cpu(unsigned long *dj)
1515 1514
1516 /* Request timer delay depending on laziness, and round. */ 1515 /* Request timer delay depending on laziness, and round. */
1517 if (!rdtp->all_lazy) { 1516 if (!rdtp->all_lazy) {
1518 *dj = round_up(rcu_idle_gp_delay + jiffies, 1517 dj = round_up(rcu_idle_gp_delay + jiffies,
1519 rcu_idle_gp_delay) - jiffies; 1518 rcu_idle_gp_delay) - jiffies;
1520 } else { 1519 } else {
1521 *dj = round_jiffies(rcu_idle_lazy_gp_delay + jiffies) - jiffies; 1520 dj = round_jiffies(rcu_idle_lazy_gp_delay + jiffies) - jiffies;
1522 } 1521 }
1522 *nextevt = basemono + dj * TICK_NSEC;
1523 return 0; 1523 return 0;
1524} 1524}
1525 1525