History

tick/sched: Release seqcount before invoking calc_load_global()

calc_load_global() does not need the sequence count protection. [ tglx: Split it up properly and added comments ]

Yunfeng Ye committed 5 years ago

Commit 896b9691 parent 7a35bf21 file · +11 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/time/tick-sched.c+11−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/sched/clock.h>
2121 #include <linux/sched/stat.h>
2222 #include <linux/sched/nohz.h>
23+#include <linux/sched/loadavg.h>
2324 #include <linux/module.h>
2425 #include <linux/irq_work.h>
2526 #include <linux/posix-timers.h>
@@ -107,7 +108,8 @@ static void tick_do_update_jiffies64(ktime_t now) · 81 unmodified lines
107108 tick_period);
108109 }
109110
110− do_timer(ticks);
111+ /* Advance jiffies to complete the jiffies_seq protected job */
112+ jiffies_64 += ticks;
111113
112114 /*
113115 * 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
116118 WRITE_ONCE(tick_next_period,
117119 ktime_add(last_jiffies_update, tick_period));
118120
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+ */
119126 write_seqcount_end(&jiffies_seq);
127+
128+ calc_global_load();
129+
120130 raw_spin_unlock(&jiffies_lock);
121131 update_wall_time();
122132 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t