[PATCH] AArch64: Check kernel version for SVE ifuncs
Florian Weimer
fweimer@redhat.com
Thu Mar 14 09:06:10 GMT 2024
* Wilco Dijkstra:
> Older Linux kernels may disable SVE after certain syscalls. Calling the
> SVE-optimized memcpy afterwards will then cause a trap to reenable SVE.
> As a result, applications with a high use of syscalls may run slower with
> the SVE memcpy. Avoid this by checking the kernel version and enable the
> SVE-optimized memcpy/memmove ifuncs only on Linux kernel 6.2 or newer.
Given that the existing SVE users have not complained about this, is it
really a good idea to disable SVE string functions for them? Not
everyone interleaves system calls and string functions in inner loops.
> +/* Parse kernel version without calling any library functions.
> + Allow 2 digits for kernel version and 3 digits for major version,
> + separated by '.': "kk.mmm.".
> + Return kernel version * 1000 + major version, or -1 on failure. */
I think you should parse the versions you exclude because you know their
syntax. We tried to predict the layout of future kernel version strings
before and failed.
Thanks,
Florian
More information about the Libc-alpha
mailing list