On Tue, 2006-02-14 at 16:57 -0800, Bryce Harrington wrote: > On Mon, Feb 13, 2006 at 01:23:33PM -0500, Silbermann, Martine wrote: > > * From memory hotplug test plan to scripts - discussion > > Here's some answers to questions that came up today. [snip] > 4. How to control swapping > > As a sysctl, the swappiness can be set at runtime with either of the > following commands: > > sysctl -w vm.swappiness=30 > echo 30 >/proc/sys/vm/swappiness > > For more info see the 'Swappiness' section on this page: > http://gentoo-wiki.com/FAQ_Linux_Memory_Management This parameter is part of it. Assuming that all of physical memory is consumed, if the OS gets a request to read part of a file that is not yet in the file system buffer cache (as an example), it has to either page something out of the buffer cache to make room, or it can take some process pages and move them to the swap space to make room. This parameter helps the OS determine which to do. What I was looking for was the parameter that determines how much physical memory can be consumed before the system will preemptively start to free up physical memory (from buffer cache/process pages) before running out of memory. What we want is for this amount to be zero for this test (bad idea for real life), in other words, we need the system to let us consume everything. My idea was that we should use memtoy to consume every last drop of physical memory (without going over), add more memory, then try to consume exactly the amount of memory we just added. The system should not page or write anything from the buffer cache to disk (no I/O should occur). That should be easy to spot. If it did I/O and it left the memory unused, we would have to worry that the added memory was not being utilized. I think we need to adjust this one: vm.min_free_kbytes "Forces the Linux VM (virtual memory manager) to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. The default value is in respect to the total memory on the machine." To avoid any IO, we also have to be sure that no dirty memory gets written due to the dirty writeback counter expiring. We can set that so that it never expires. It's one of these two that you set to zero, I always forget which (just a quick look at the code makes me think its dirty_writeback_centisecs): vm.dirty_expire_centisecs = 3000 (default) vm.dirty_writeback_centisecs = 500 (default) dirty_expire_centisecs ? Defines when dirty in-memory data is old enough to be eligible for writeout. Data which has been dirty in-memory for longer than this interval is written out next time a pdflush daemon wakes up. The default value is 3000, expressed in hundredths of a second. dirty_writeback_centisecs ? Defines the interval between pdflush daemon wakeups, which periodically writes dirty in-memory data out to disk. The default value is 500, expressed in hundredths of a second. -Mary > > > > 5. What tools may be affected by changes in memory? > > Several tools off the top of my head: > > top, sar, ps, top, free, vmstat, pmap > > There's probably a lot more... > > Bryce > _______________________________________________ > Hotplug_sig mailing list > Hotplug_sig@xxxxxxxxxxxxxx > https://lists.osdl.org/mailman/listinfo/hotplug_sig -- Mary Edie Meredith Initiative Manager Open Source Development Labs maryedie@xxxxxxxx 503-906-1942