Skip to content

Commit

Permalink
sched/fair: Use __this_cpu_read() in wake_wide()
Browse files Browse the repository at this point in the history
The code is executed with preemption(and interrupts) disabled,
so it's safe to use __this_cpu_write().

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200421144123.33580-1-songmuchun@bytedance.com
  • Loading branch information
Muchun Song authored and Peter Zijlstra committed Apr 30, 2020
1 parent bf2c59f commit 17c891a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched/fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -5718,7 +5718,7 @@ static int wake_wide(struct task_struct *p)
{
unsigned int master = current->wakee_flips;
unsigned int slave = p->wakee_flips;
int factor = this_cpu_read(sd_llc_size);
int factor = __this_cpu_read(sd_llc_size);

if (master < slave)
swap(master, slave);
Expand Down

0 comments on commit 17c891a

Please sign in to comment.