3 ms·
Sure, I know how the zero page works - so for "sparse" scenarios like your diagonal matrix examples, it works great. You can of course also implement this tric
by BeeOnRope 7y ago
Sure, I know how the zero page works - so for "sparse" scenarios like your diagonal matrix examples, it works great.
You can of course also implement this trick in userspace, or at least without relying on the zero CoW thig on fault, e.g., by mapping /dev/zero.
Sometimes the zero page thing comes out worse: if you first read from a zero page and then ultimately write to it, for every page, you take 2x the number of faults.