[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scan_swap_map



Hi :

  Based on the scan_swap_map() code in swapfile.c in Linux 2.4, it seems
to me that the swapmap cannot get fragmented ie there will *ALWAYS* be
contiguous allocation within the swap device.

(1) Within a cluster, there is always contiguous allocation of free swap
entries.

(2) As soon as a cluster is filled with 1's, a new cluster is chosen
HOWEVER, since lowest_bit is marked as the lowest free entry offset,
and assuming that the system started aligned to SWAPFILE_CLUSTER, the new
cluster will again be contigous to the previous cluster.

  If this is true, I dont understand the need for the "fine-grained" for
loop in which a brute force scan is made to find any free entry - it
seems to me like this code will never need to be executed.

  Am I missing something important here?

Thanks,
-----
Anand.

--
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:"aart@kvack.org"> aart@kvack.org </a>