Re: /proc/<n>/maps getting _VERY_ long

Jamie Lokier (lk@tantalophile.demon.co.uk)
Mon, 6 Aug 2001 19:41:20 +0100


Linus Torvalds wrote:
> >Do you count applications which selectively mprotect()'s memory (to
> >trap SIGSEGV and maintain coherency with on-disk data structures) as
> >"broken applications"?
> >
> >Such applications *can* use large amounts of mprotect()'s.
>
> Note that such applications tend to not get any advantage from merging -
> it does in fact only slow things down (because then the next mprotect
> just has to split the thing again).
>
> No, they aren't broken, but they should know that the use of lots of
> small memory segments (even if it is a design goal) can and will slow
> down page faulting, and use more memory for MM management for example.
>
> Linux does have a log(n) vma lookup, so the slowdown isn't huge.

There are garbage collectors that use mprotect() and SEGV trapping per
page. It would be nice if there was a way to change the protections per
page without requiring a VMA for each one.

Btw, Linux has pretty fast SIGSEGV handling (the fastest of any
OS/machine combination that I measured), so it's a good platform for
this sort of thing. I measured 7.75 microseconds per page for SEGV
trapping followed by mprotect() in the handler, on a particular test on
a 600MHz Pentium III.

-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/