[libc/string] State of PAGE_COPY_FWD / PAGE_COPY_THRESHOLD
Maxim Kuvyrkov
maxim.kuvyrkov@linaro.org
Tue Nov 1 09:28:00 GMT 2016
I wanted to check performance impact of using linux zero page sharing in calls to memset (PTR, 0, SIZE). I remembered seeing PAGE_COPY_FWD_MAYBE and PAGE_COPY_THRESHOLD in string/memcpy.c, and my plan was to copy this logic to an experimental memset() implementation.
Closer inspection of the current code showed that only Mach port attempted to use full-page copying in memcpy.c, but now even the Mach port disables it. The net result is that code in string/memcpy.c, as well as parts of headers sysdeps/generic/pagecopy.h and sysdeps/generic/memcopy.h are dead code.
From the above we have 2 questions:
1. Is it possible to use full-page copy (with COW) in the Linux glibc port for memcpy() and/or memset(0)?
2. If not, then is there any reason to keep the dead code around or should we clean it up?
--
Maxim Kuvyrkov
www.linaro.org
More information about the Libc-alpha
mailing list