Re: missing madvise functionality

Andi Kleen
2007-04-03T17:15:55Z

Ulrich Drepper <drepper@redhat.com> writes:

> to free: mmap(PROT_NONE) over the area

Why do you need a lock for that? I don't see any problem with
two threads doing that in parallel. The kernel would
serialize it internally and one would fail, but that shouldn't
be a problem.

Of course having the lock should also not make much difference --
if glibc doesn't do it then it kernel would anyways and run
into the same scalability issue on mmap_sem.

-Andi