Small swapfile.c patch

Jeff Haumont (operator@abel-jhaumont.unl.edu)
Sun, 28 Apr 1996 15:49:05 -0500 (CDT)


After reading the message about how to enable striped swapping a while
ago, I tried it and it made an absolutely tremendous difference for me.
(It doubled the performance of the stupid little benchmark I was using)
Because of this I suggest:

diff linux/mm/swapfile.c linux/mm/swapfile.c.old
427c427
< p->prio = least_priority;

---
>               p->prio = --least_priority;
507c507
<       printk("Adding Swap: %dk swap-space (Priority %d)\n",
j<<(PAGE_SHIFT-10), p->prio);
---
>       printk("Adding Swap: %dk swap-space\n",j<<(PAGE_SHIFT-10));

The first change will give all swap partitions the same priority if they are not set explicitly or set incorrectly, basically enabling striping by default. The only time that I can think of that this would not give a performance increase would be when more than one swap partition exists on a drive. Most people do not set it up this way. (kind of silly to do this, just wastes partition table space)

The second change is pretty obvious. Its nice to see the priority when you are trying to set this up and want to make sure the kernel is getting the message. It also might help more people become aware of this feature.

Thanks, Jeff Haumont

----------------------------------------------------- Jeff Haumont - jhaumont@cse.unl.edu Mail also forwarded to operator@vorlon.unl.edu finger jhaumont@cse.unl.edu for PGP public key