--- a/kernel/kcov.c~kcov-move-t-kcov_sequence-assignment +++ a/kernel/kcov.c @@ -318,10 +318,10 @@ static void kcov_start(struct task_struc /* Cache in task struct for performance. */ t->kcov_size = size; t->kcov_area = area; + t->kcov_sequence = sequence; /* See comment in check_kcov_mode(). */ barrier(); WRITE_ONCE(t->kcov_mode, mode); - t->kcov_sequence = sequence; } static void kcov_stop(struct task_struct *t)