Skip to contentSkip to conversation

about prandom vs __this_cpu_read()

DISCUSSION Willy Tarreau 1 participant 1 message Oct 13, 2020

lore
Share & tools
lore
#0 lore raw

Linus,

the latest prandom series I sent you changes __this_cpu_read() to this_cpu_read() since LKP returned the following trace on i386:

[    9.061912]  dump_stack+0x54/0x6e
[    9.061912]  check_preemption_disabled+0xb1/0xc0
[    9.061912]  __this_cpu_preempt_check+0xf/0x11
[    9.065516]  __igt_reserve+0x91/0x580
[    9.065516]  igt_reserve+0x5b/0xc0
[    9.065516]  test_drm_mm_init+0x78/0xa9

I got another report that it breaks on ARC (trivial fix consists in adding irqflags.h in prandom.h) but that made me wonder, we're using this to access and update the net_rand_noise variable only, wouldn't it be better to use the faster raw_cpu_read()/raw_cpu_write() there, considering we don't care about concurrent accesses since they simply add even more impredictability to the noise ?

If so, I'll update this branch and will send you another PR.

Thanks,
Willy