calc_load_global() does not need the sequence count protection. [ tglx: Split it up properly and added comments ]
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/sched/clock.h> |
| 21 | 21 | #include <linux/sched/stat.h> |
| 22 | 22 | #include <linux/sched/nohz.h> |
| 23 | +#include <linux/sched/loadavg.h> | |
| 23 | 24 | #include <linux/module.h> |
| 24 | 25 | #include <linux/irq_work.h> |
| 25 | 26 | #include <linux/posix-timers.h> |
| @@ -107,7 +108,8 @@ static void tick_do_update_jiffies64(ktime_t now) · 81 unmodified lines | ||
| 107 | 108 | tick_period); |
| 108 | 109 | } |
| 109 | 110 | |
| 110 | − do_timer(ticks); | |
| 111 | + /* Advance jiffies to complete the jiffies_seq protected job */ | |
| 112 | + jiffies_64 += ticks; | |
| 111 | 113 | |
| 112 | 114 | /* |
| 113 | 115 | * Keep the tick_next_period variable up to date. WRITE_ONCE() |
| @@ -116,7 +118,15 @@ static void tick_do_update_jiffies64(ktime_t now) · 2 unmodified lines | ||
| 116 | 118 | WRITE_ONCE(tick_next_period, |
| 117 | 119 | ktime_add(last_jiffies_update, tick_period)); |
| 118 | 120 | |
| 121 | + /* | |
| 122 | + * Release the sequence count. calc_global_load() below is not | |
| 123 | + * protected by it, but jiffies_lock needs to be held to prevent | |
| 124 | + * concurrent invocations. | |
| 125 | + */ | |
| 119 | 126 | write_seqcount_end(&jiffies_seq); |
| 127 | + | |
| 128 | + calc_global_load(); | |
| 129 | + | |
| 120 | 130 | raw_spin_unlock(&jiffies_lock); |
| 121 | 131 | update_wall_time(); |
| 122 | 132 | } |