RE: Running an Ivy Bridge cpu at fixed frequency

From: David Laight
Date: Fri Dec 06 2019 - 08:06:35 EST


From: Peter Zijlstra
> Sent: 06 December 2019 10:16
> To: David Laight <David.Laight@xxxxxxxxxx>
...
> The whole counter scaling crud is just that, crud you can mostly forget
> about if you want to quickly hack something together. See
> mmap_read_pinned() for the simplified (and much faster version) that
> ignores all that.

I noticed that version later :-(
The 'seqcount' is interesting, since it only protects against updates
that happen while the process itself is in kernel space.
It doesn't allow arbitrary kernel updates of the memory area.

...
> You still need to do the rdpmc sign extent crud, but see
> mmap_read_pinned() that does just about that.

Actually for what I'm doing i can truncate the counter to 32 bits
and not worry about when it wraps.

Anyway I've not got some histograms of the elapsed cycle counts
for recvfrom() and recvmsg() with, and without, some of the
HARDENED_USERCOPY costs.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)