This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread wastes memory with mlockall(MCL_FUTURE)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]