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
20#include <linux/sched/clock.h>20#include <linux/sched/clock.h>
21#include <linux/sched/stat.h>21#include <linux/sched/stat.h>
22#include <linux/sched/nohz.h>22#include <linux/sched/nohz.h>
23#include <linux/sched/loadavg.h>
23#include <linux/module.h>24#include <linux/module.h>
24#include <linux/irq_work.h>25#include <linux/irq_work.h>
25#include <linux/posix-timers.h>26#include <linux/posix-timers.h>
@@ -107,7 +108,8 @@ static void tick_do_update_jiffies64(ktime_t now) · 81 unmodified lines
107 tick_period);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 * Keep the tick_next_period variable up to date. WRITE_ONCE()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 WRITE_ONCE(tick_next_period,118 WRITE_ONCE(tick_next_period,
117 ktime_add(last_jiffies_update, tick_period));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 write_seqcount_end(&jiffies_seq);126 write_seqcount_end(&jiffies_seq);
127
128 calc_global_load();
129
120 raw_spin_unlock(&jiffies_lock);130 raw_spin_unlock(&jiffies_lock);
121 update_wall_time();131 update_wall_time();
122}132}

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