On Sat, 2007-01-13 at 00:03 +0300, Michael Tokarev wrote: [snip] > And sure thing, withOUT O_DIRECT, the whole system is almost dead under this > load - because everything is thrown away from the cache, even caches of /bin > /usr/bin etc... ;) (For that, fadvise() seems to help a bit, but not alot). One thing that I've been using, and seems to work well, is a customized version of the readahead program several distros use during boot up. Mine starts off doing: mlockall(MCL_CURRENT|MCL_FUTURE); ...yadda, yadda... and for each file listed: ...open, stat stuff... if( NULL == mmap( NULL, stat_buf.st_size, PROT_READ, MAP_SHARED|MAP_LOCKED|MAP_POPULATE, fd, 0) ) { fprintf(stderr, "'%s' ", file); perror("mmap"); } ...more stuff... and then ends with: pause(); and it sits there forever. As far as I can tell, this makes the program and library code stay in RAM. At least, after a drop_caches nautilus doesn't load 12 MB off disk, it just starts. It has to be reloaded after software updates and after prelinking. I find the 250 MB used to be worthwhile, even if its kinda Windowsey. Something like that could keep your system responsive no matter what the disk cache is doing otherwise. -- Zan Lynx <[email protected]>
Attachment:
signature.asc
Description: This is a digitally signed message part
- Follow-Ups:
- Re: Disk Cache, Was: O_DIRECT question
- From: Michael Tokarev <[email protected]>
- Re: Disk Cache, Was: O_DIRECT question
- References:
- O_DIRECT question
- From: Aubrey <[email protected]>
- Re: O_DIRECT question
- From: Linus Torvalds <[email protected]>
- Re: O_DIRECT question
- From: Viktor <[email protected]>
- Re: O_DIRECT question
- From: Linus Torvalds <[email protected]>
- Re: O_DIRECT question
- From: dean gaudet <[email protected]>
- Re: O_DIRECT question
- From: Linus Torvalds <[email protected]>
- Re: O_DIRECT question
- From: Chris Mason <[email protected]>
- Re: O_DIRECT question
- From: Michael Tokarev <[email protected]>
- Re: O_DIRECT question
- From: Michael Tokarev <[email protected]>
- Re: O_DIRECT question
- From: Michael Tokarev <[email protected]>
- O_DIRECT question
- Prev by Date: Re: 'struct task_struct' has no member named 'mems_allowed' (was: Re: 2.6.20-rc4-mm1)
- Next by Date: Re: [PATCH] [RFC] remove ext3 inode from orphan list when link and unlink race
- Previous by thread: Re: O_DIRECT question
- Next by thread: Re: Disk Cache, Was: O_DIRECT question
- Index(es):