summaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2009-01-06 14:39:54 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-06 15:59:05 -0800
commit20137a490f397d9c01fc9fadd83a8d198bda4477 (patch)
tree38e2d904e06f576a825cca3e1eaad7da6fd55947 /mm/mmap.c
parent7992fde72ce06c73280a1939b7a1e903bc95ef85 (diff)
downloadblackbird-op-linux-20137a490f397d9c01fc9fadd83a8d198bda4477.tar.gz
blackbird-op-linux-20137a490f397d9c01fc9fadd83a8d198bda4477.zip
swapfile: swapon randomize if nonrot
Swap allocation has always started from the beginning of the swap area; but if we're dealing with a solidstate swap device which can only remap blocks within limited zones, that would sooner wear out the first zone. Therefore sys_swapon() test whether blk_queue is non-rotational, and if so randomize the cluster_next starting position for allocation. If blk_queue is nonrot, note SWP_SOLIDSTATE for later use, and report it with an "SS" at the right end of the kernel's "Adding ... swap" message (so that if it's both nonrot and discardable, "SSD" will be shown there). Perhaps something should be shown in /proc/swaps (swapon -s), but we have to be more cautious before making any addition to that format. Signed-off-by: Hugh Dickins <hugh@veritas.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Joern Engel <joern@logfs.org> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Donjun Shin <djshin90@gmail.com> Cc: Tejun Heo <teheo@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mmap.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud