Lennart Sorensen wrote: > On Wed, Jan 20, 2010 at 01:19:54PM +0000, Jamie Lokier wrote: > > > We are working with this workaround: > > > echo 3 > /proc/sys/vm/drop_caches > > > > > > This clears all the cache. We even write this value to that file within > > > our application start routine to be sure our main application gets all > > > the memory it needs. It seems to be working > > > > It's good to know that works, thanks. > > > > Another trick is to divide your application into several shared > > libraries which are significantly smaller than the original, if your > > toolchain supports it. > > I would love to find a way to just disable the cache. I tftp boot with > a ramdisk, and would love to stop the stupid kernel from caching the > ramdisk which seems incredibly pointless.
If you're using ramfs/tmpfs, it doesn't - there is no extra caching. It looks like cache, but that's because the ramfs uses the cache to hold its data. If you're using "RAM block device" (drivers/block/brd.c), it does, but you would probably only be using that with a compressed filesystem, in which case the caching is useful. Unfortunately for your wish, the page cache is too closely related to the way I/O works to eliminate it. Realistically all you could do would be to discard it shortly after using it for I/O. That is possible by tweaking the heuristics in mm/. You can use O_DIRECT to bypass page cache, but there are too many restrictions to use that for general application I/O, and it's not clear if it's reliable on all architectures anyway due to DMA coherence issues. -- Jamie _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev