[...]
> Maybe preload (if there's anything like that) have
> build a library with a list of applications to load?
> It behaves like this in Linux...
[...]

I don't know if anyone has ported the Linux preload daemon
to Solaris.  I wrote my own preloader, but it's much dumber - it
simply takes a list of files to mmap() and optionally lock into memory,
it does _not_ look on its own for binaries or libraries that are good 
candidates.
(If not requested to lock files into memory, my preloader will (unless
compiled not to) instead access the first byte of each page, in an attempt to
at least get them loaded into memory; whether or not they stay there is
up to the system.)

Just for the heck of testing disk accesses fairly, I also wrote something
that mmaps a file and then uses madvise() with MADV_DONTNEED on it
to evict that file from the VM cache (so that it will be read from disk
next time); on versions of Solaris where memtool still worked (has
it been updated lately?), that did indeed seem to function as I intended.
No idea whether MADV_DONTNEED also evicts it from the ZFS ARC, at
least not without digging probably very deep into code I might not
understand anyway.

Google for
NO_PAGE_IN NO_LOCKING
to find the former, and
MADV_DONTNEED S_ISREG freemap
to find the latter.  (I posted them to Usenet ages ago, but AFAIK don't
have them on a web or ftp server.)

PS. I just took a _very_ quick look at the source for the Linux preload
daemon.  It appears to monitor /proc to find interesting files to cache
(executables or libraries).  That could probably be done on Solaris too,
(esp. Solaris 10 or later, with /proc/*/path/*), but it would take a fair
number of changes due at the very least to differences in /proc.  And I
suppose it might well need to be "tuned" a bit differently to be at least as
effective on Solaris as it is said to be (by some, anyway) on Linux.

I think a rewrite might be better, esp. _if_ non-polling file event notification
(OpenSolaris) could be used to detect changes in /proc (processes creation
and termination); I hate having anything polling if it can be avoided.
(No, I'm not volunteering, and I have no immediate plans to play with the
notion...but if somebody knows enough to advise on effective strategy
differences, actually coding this probably wouldn't be rocket science.)
-- 
This message posted from opensolaris.org

Reply via email to