This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: pthread wastes memory with mlockall(MCL_FUTURE)
- From: Balazs Kezes <rlblaster at gmail dot com>
- To: Rich Felker <dalias at libc dot org>
- Cc: libc-alpha at sourceware dot org
- Date: Fri, 18 Sep 2015 17:38:42 +0100
- Subject: Re: pthread wastes memory with mlockall(MCL_FUTURE)
- Authentication-results: sourceware.org; auth=none
- References: <20150918102734 dot GA27881 at eper> <20150918143824 dot GB17773 at brightrain dot aerifal dot cx>
On 2015-09-18 10:38 -0400, Rich Felker wrote:
> I would say it's a kernel bug for PROT_NONE pages to actually occupy
> resources when locked, if they actually do?
It could make sense that you have some pages with some data in them but
in a later stage you remove the permissions to trap data accesses. I
think some debuggers (e.g. watchpoints) or some cache simulators work
this way.
> How did you test/measure this?
There's a pthread_attr_setguardsize function. Basically I've set it to
large (to expand the effect of this behavior) and then created a bunch
of threads and checked what happens. I could try to create a simple
repro if needed.
--
Balazs