Bonus summary: She didn’t use the mmapped data in place in order to make a more apples-to-apples comparison. If you can use the data in place then you will get even better performance.
Bonus summary: She didn’t use the mmapped data in place in order to make a more apples-to-apples comparison. If you can use the data in place then you will get even better performance.
Disclaimer: I speak Russian.
Source: I am Russian
What it actually seems to be comparing is whether its faster if the copy happens in the kernel, in the read() system call, or whether it's faster in userspace.
The results are puzzling because I would expect the kernel to be faster since it would incur no page-faults to access the pages from page cache since those ought to fall under the page-global mappings, or, at least, be in the kernels linear ram map which use 1GB pages (edit: in either case, not incur faults for demand map/demand load). But maybe that's no longer the case in a post-spectre world?
So I think actually it's a test of "does AVX go enough-faster to outweigh the costs of the extra-pagefaults incurred by copying from a user-space mapping which has not been prefaulted"
Sounds like the answer is yes (which still surprises me). And I expect if they MAP_POPULATE it would pull even further ahead...
My libc is using rep/mov, same as the kernel, however. So I can't conclude that AVX memcpy is the win.
From the profile of readsyscall version I see this:
42.12% fa [kernel.kallsyms] [k] copy_user_enhanced_fast_string
14.45% fa [kernel.kallsyms] [k] syscall_exit_to_user_mode
11.00% fa [kernel.kallsyms] [k] find_get_entry
6.28% fa [kernel.kallsyms] [k] syscall_return_via_sysret
5.14% fa [kernel.kallsyms] [k] entry_SYSCALL_64
nearly 15% of the time is spent on a single verw instruction. Spectre mitigations.When I reboot with mitigations=off, sure enough, the difference goes away and read() and mmap() perform identically.
What OP has discovered is that spectre mitigations make syscalls enough slower than pagefaults that what used to be a slower way to do things is now faster.
If you want the mmap version to perform faster when spectre mitigations are off, you need to use MAP_POPULATE.
(The OED quotations for sense 2(b) "In anaphoric reference to a singular noun or pronoun of undetermined gender" go back to at least 1200AD.)
There's not a man I meet but doth salute me
As if I were their well-acquainted friend> According to the third edition, The New Fowler's Modern English Usage (edited by Burchfield and published in 1996) singular they has not only been widely used by good writers for centuries, but is now generally accepted, except by some conservative grammarians, including the Fowler of 1926, who, it is argued, ignored the evidence:
https://en.wikipedia.org/wiki/Singular_they
Elsewhere in the article you'll find dates like: 1375, 1382, 1400, 1489, 1759, etc, and references to these by Fowler's
https://en.wikipedia.org/wiki/A_Dictionary_of_Modern_English...
Anyone arguing against singular 'they' may as well be arguing for a gender neutral 'he' - an argument lost over a century ago by virtually any modern English standard.
Absolutely true. At least one whole generation grew up taught in school that singular "they" isn't a thing. I was on the tail end of that and read a lot of books written by the previous generation, so it never stuck strongly in my head, but that's what GP is referring to.
Either way, clinging to a frozen-in-time interpretation of a living, changing language is foolish for anyone who would like to easily understand and be easily understood. And not waste time in our too-short lives on pointless language nitpickery like we're doing here.
But by modern English standards, which I would define through works like Fowlers', the legitimate argument against singular they is long over.
That seems like a flawed analogy; many people abuse the traditional generic usage of 'they' but I've seen few people abuse the traditional generic usage of 'he'.
[name of paper] mentions that X is faster than Y. The author suggests the cause of the speed up is Z, while we believe it is W.