This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[libc/string] State of PAGE_COPY_FWD / PAGE_COPY_THRESHOLD
- From: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 1 Nov 2016 12:28:05 +0300
- Subject: [libc/string] State of PAGE_COPY_FWD / PAGE_COPY_THRESHOLD
- Authentication-results: sourceware.org; auth=none
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