Thread (4 messages) 4 messages, 3 authors, 2008-07-12

Re: swapon/swapoff in a loop -- ever-decreasing priority field

From: KOSAKI Motohiro <hidden>
Date: 2008-07-12 06:28:39

On Fri, 11 Jul 2008, KOSAKI Motohiro wrote:
quoted
quoted
I find that running swapon/swapoff in a loop will decrement the
"Priority" field of the swap partition once per iteration. This
doesn't seem quite correct, as it will eventually lead to an
underflow.

(Though, by my calculations, it would take around 620 days of constant
swapoff/swapon to reach this condition, so it's hardly a real-life
problem.)

Is this something that should be fixed, though?
I am not sure about your intention.
Do following patch fill your requirement?
I believe that only handles a simple swapon/swapoff of one area:
once you have a pair of them (which is very useful for swapoff
testing: swapon Y before swapoff X so you can be sure there will
be enough space) their priorities will again decrement indefinitely.
Here's my version...
Yeah, I ignored intentionally its corner case.
I thought it is artificial issue, not real problem.
but yes, two swap test should be allowed.

your patch is better, of cource.
it works well on my sevarl test and I found no bug in my review.

Thanks!

	Reviewed-by: KOSAKI Motohiro [off-list ref]



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help