On Fri, 24 Oct 2003 01:03, Con Kolivas wrote: > On Friday 24 October 2003 00:42, Martin J. Bligh wrote: > > It seems that you don't need si_swapinfo here, do you? i.freeram, > > i.bufferram, and i.totalram all come from meminfo, as far as I can > > see? Maybe I'm missing a bit ... > > Well I did do it a while ago and it seems I got carried away adding and > subtracting info indeed. :-) Here's a simpler patch that does the same > thing. The off-list enthusiasm has been rather strong so here is a patch done the right way (tm). There is no need for the check of totalram being zero (the original version of this patch modified the swappiness every tick which was wasteful and had a divide by zero on init). Adjusting vm_swappiness only when there is pressure to swap means totalram shouldn't be ever be zero. The sysctl is made read only since writing to it would be ignored now. Con