Linux’s vDSO (or digital dynamic shared object) is “a small shared library that the kernel robotically maps into the handle house of all user-space purposes,” in keeping with its man web page. “There are some system calls the kernel offers that user-space code finally ends up utilizing ceaselessly, to the purpose that such calls can dominate total efficiency… due each to the frequency of the decision in addition to the context-switch overhead that outcomes from exiting consumer house and getting into the kernel.”
However Linus Torvalds had so much to say a few proposed getrandom() improve, studies Phoronix:
This getrandom() work within the vDSO has been via 20+ rounds of assessment over the previous 2+ years, however… Torvalds took a while out of his U.S. Independence Day to argue the deserves of the patches on the Linux kernel mailing record. Torvalds kicked issues off by writing:
No person has defined to me what has modified since your final vdso getrandom, and I am not planning on pulling it except that elementary flaw is mounted. Why is that this _so_ crucial that it wants a vdso? Why is not consumer house simply doing it itself? What’s so magical about this all?
This all appears totally pointless to me nonetheless, as a result of it is optimizing one thing that no one appears to care about, including new VM infrastructure, new magic system calls, yadda yadda. I used to be very sceptical final time, and completely _nothing_ has modified. Not a peep on why it is now all of a sudden so massively vital once more. We do not add stuff “simply because we will”. We have to have a rattling good cause for it. And I nonetheless do not see the rationale, and I have never seen anyone even making an attempt to clarify the rationale.
After which he responded to himself, including:
In different phrases, I wish to see precise *customers* piping up and saying “it is a drawback, this is my actual load that spends 10% of time on getrandom(), and this fixes it”. I am not AT ALL fascinated by microbenchmarks or theoretical “if customers want high-performance random numbers”. I want an actual precise stay consumer that claims “I can not simply use rdrand and my very own chacha mixing on prime” and explains why having a SSE2 chachacha in kernel code uncovered as a vdso is so crucial, and a magical buffer maintained by the kernel.”
Torvalds additionally added in a 3rd message:
One last notice: the rationale I am so destructive about this all is that the random quantity subsystem has such a completely _horrendous_ historical past of two important conflicting points: individuals wanting cheap usable random numbers on one facet, after which the individuals that debate what the phrase “entropy” means on the opposite facet. And actually, I do not need the kernel caught even *extra* in the course of that morass…. Torvalds made extra feedback. (“This smells. It is BS…”) Advocating for the change was WiredGuard developer Jason Donenfeld, and extra communication occurred (and continues to occur… 40 messages and counting).
At one level the dialogue advanced to Torvalds saying “Bah. I assume I am going to should stroll via the patch collection as soon as once more. I am nonetheless not thrilled about it. However I am going to give it one other go…”