Skip to content

Commit 0c34fa4

Browse files
committed
Merge: clocksource: Avoid calling get_random_u32() in atomic context
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/340 JIRA: https://issues.redhat.com/browse/RHEL-77959 MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/340 The second patch is the fix commit. The first patch fixes a minor issue in the code. Signed-off-by: Waiman Long <longman@redhat.com> Approved-by: Phil Auld <pauld@redhat.com> Approved-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents 7411135 + b812a22 commit 0c34fa4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

kernel/time/clocksource.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,18 @@ void clocksource_verify_percpu(struct clocksource *cs)
365365
cpumask_clear(&cpus_ahead);
366366
cpumask_clear(&cpus_behind);
367367
cpus_read_lock();
368-
preempt_disable();
368+
migrate_disable();
369369
clocksource_verify_choose_cpus();
370370
if (cpumask_empty(&cpus_chosen)) {
371-
preempt_enable();
371+
migrate_enable();
372372
cpus_read_unlock();
373373
pr_warn("Not enough CPUs to check clocksource '%s'.\n", cs->name);
374374
return;
375375
}
376376
testcpu = smp_processor_id();
377-
pr_warn("Checking clocksource %s synchronization from CPU %d to CPUs %*pbl.\n", cs->name, testcpu, cpumask_pr_args(&cpus_chosen));
377+
pr_info("Checking clocksource %s synchronization from CPU %d to CPUs %*pbl.\n",
378+
cs->name, testcpu, cpumask_pr_args(&cpus_chosen));
379+
preempt_disable();
378380
for_each_cpu(cpu, &cpus_chosen) {
379381
if (cpu == testcpu)
380382
continue;
@@ -394,6 +396,7 @@ void clocksource_verify_percpu(struct clocksource *cs)
394396
cs_nsec_min = cs_nsec;
395397
}
396398
preempt_enable();
399+
migrate_enable();
397400
cpus_read_unlock();
398401
if (!cpumask_empty(&cpus_ahead))
399402
pr_warn(" CPUs %*pbl ahead of CPU %d for clocksource %s.\n",

0 commit comments

Comments
 (0)