mirror of
https://github.com/torvalds/linux.git
synced 2025-08-15 14:11:42 +02:00
sched/psi: Fix psi_seq initialization
With the seqcount moved out of the group into a global psi_seq,
re-initializing the seqcount on group creation is causing seqcount
corruption.
Fixes: 570c8efd5e
("sched/psi: Optimize psi_group_change() cpu_clock() usage")
Reported-by: Chris Mason <clm@meta.com>
Suggested-by: Beata Michalska <beata.michalska@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d632ab86af
commit
99b773d720
1 changed files with 1 additions and 5 deletions
|
@ -176,7 +176,7 @@ struct psi_group psi_system = {
|
|||
.pcpu = &system_group_pcpu,
|
||||
};
|
||||
|
||||
static DEFINE_PER_CPU(seqcount_t, psi_seq);
|
||||
static DEFINE_PER_CPU(seqcount_t, psi_seq) = SEQCNT_ZERO(psi_seq);
|
||||
|
||||
static inline void psi_write_begin(int cpu)
|
||||
{
|
||||
|
@ -204,11 +204,7 @@ static void poll_timer_fn(struct timer_list *t);
|
|||
|
||||
static void group_init(struct psi_group *group)
|
||||
{
|
||||
int cpu;
|
||||
|
||||
group->enabled = true;
|
||||
for_each_possible_cpu(cpu)
|
||||
seqcount_init(per_cpu_ptr(&psi_seq, cpu));
|
||||
group->avg_last_update = sched_clock();
|
||||
group->avg_next_update = group->avg_last_update + psi_period;
|
||||
mutex_init(&group->avgs_lock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue