This is the mail archive of the glibc-bugs@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]

[Bug libc/11431] consider madvise for ld.so


------- Additional Comments From drepper at redhat dot com  2010-04-06 20:54 -------
(In reply to comment #2)
> Can you suggest some statistics we can gather in order to inform
> heuristics within ld.so to trigger a madvise(MADV_WILLNEED)
> (which itself is a heuristic for the kernel)?

I don't think heuristics will work in ld.so.

It's pretty much an all or nothing selection.  For each use the madvise call is
useful or not.  This should be a setting in a file, perhaps it can be changed
after the file has been created (similar to the execstack setting).  Perhaps ELF
flags (e_flags).  Otherwise an entry in the program header.

Where heuristics may come in is in monitoring the system (using systemtap or so)
and look at the DSO use in apps.  I.e., when the app ends look how many pages of
the DSO have been used over the lifetime of the app.  If a certain threshold is
reached the flag could be set.

Another piece of information would be how much of each segment (text, data) is
used.  This could then help lowering the threshold for using the flag if the
commonly used code/data is first in the segment.  This would then not be a
simple flag but instead each PT_LOAD entry in the program header could have a
corresponding PT_READAHEAD entry or so.  By default it could be of zero size and
using profiling tools the ideal size can be determined.



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11431

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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