Closing week used to be essentially the most foremost home of ARM 64-bit architecture updates for Linux 5.10 while this day a second batch of adjustments had been sent in for this kernel. That first round had the Reminiscence Tagging Extension (MTE) and Pointer Authentication give a boost to amongst other enhancements while this secondary pull has two valuable performance optimizations.
First up is a performance optimization that the Arm builders acknowledge used to be seemingly forgotten about for some two years. Encourage in 2018 used to be a memory management velocity-up by round 20x for the mremap machine call on first-rate memory regions. That work used to be merged however the characteristic never enabled for the ARM64 Linux kernel builds till now.
That patch by a Google engineer used to be an optimization for mremap provided that Android relies on the usage of it for first-rate regions of memory all thru varied operations. The mremap machine call might per chance furthermore be rather humdrum without transparent substantial-pages (THP) while this patch makes issues sooner by copying at the PMD level when that that it’s most likely you will more than doubtless deem. The velocity-up befriend in 2018 by the engineer used to be reported to be round ~20x sooner on x86 (x86_64) with a 1GB mremap taking appropriate 144~160 microseconds in narrate of 3.4~3.6 milliseconds. But for systems with THP give a boost to, there might be now not any longer going to be great of a performance distinction.
The mremap machine call is weak for expanding/scared an existing memory mapping. Mremap is weak particularly on Android and thus Google’s emphasis on making it sooner. Whereas the work used to be merged, taking this sooner direction for PMD-level remapping requires atmosphere the HAVE_MOVE_PMD and that never obtained enabled as a part of the ARM64 Kconfig — before all the pieces it used to be delayed while pending other enhancements however then forgotten about. Just a few days ago it used to be noticed about HAVE_MOVE_PMD being home for x86 however no longer ARM64 without a unique blockers fighting it from being enabled. The tests applied this month noticed an 8x improvement with this methodology call on ARM64.
So this day’s pull quiz lets in HAVE_MOVE_PMD for ARM64 on Linux 5.10, “this has been shown to red meat up mremap() performance, which is weak closely by the Android runtime [garbage collection], and it seems we forgot to enable this upstream befriend in 2018.”
That pullals has several fixes along with one more optimization: better Spectre V2 mitigation on Qualcomm Centriq “Falkor” CPUs. But with Qualcomm having divested from its ARM server chip ambitions, the Spectre V2 optimization will doubtless abet few. That optimization comes from Falkor being in a local to mitigate Spectre Variant Two by calling into firmware or issuing a magic sequence of branches. That magic sequence is sooner however requires particular conditions and the ARM64 want logic for the time being used to be ultimate home to enable it if the firmware mitigation used to be unavailable.