diff options
Diffstat (limited to 'Documentation/vm')
-rw-r--r-- | Documentation/vm/locking | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Documentation/vm/locking b/Documentation/vm/locking index c3ef09ae3bb1..f366fa956179 100644 --- a/Documentation/vm/locking +++ b/Documentation/vm/locking | |||
@@ -83,19 +83,18 @@ single address space optimization, so that the zap_page_range (from | |||
83 | vmtruncate) does not lose sending ipi's to cloned threads that might | 83 | vmtruncate) does not lose sending ipi's to cloned threads that might |
84 | be spawned underneath it and go to user mode to drag in pte's into tlbs. | 84 | be spawned underneath it and go to user mode to drag in pte's into tlbs. |
85 | 85 | ||
86 | swap_list_lock/swap_device_lock | 86 | swap_lock |
87 | ------------------------------- | 87 | -------------- |
88 | The swap devices are chained in priority order from the "swap_list" header. | 88 | The swap devices are chained in priority order from the "swap_list" header. |
89 | The "swap_list" is used for the round-robin swaphandle allocation strategy. | 89 | The "swap_list" is used for the round-robin swaphandle allocation strategy. |
90 | The #free swaphandles is maintained in "nr_swap_pages". These two together | 90 | The #free swaphandles is maintained in "nr_swap_pages". These two together |
91 | are protected by the swap_list_lock. | 91 | are protected by the swap_lock. |
92 | 92 | ||
93 | The swap_device_lock, which is per swap device, protects the reference | 93 | The swap_lock also protects all the device reference counts on the |
94 | counts on the corresponding swaphandles, maintained in the "swap_map" | 94 | corresponding swaphandles, maintained in the "swap_map" array, and the |
95 | array, and the "highest_bit" and "lowest_bit" fields. | 95 | "highest_bit" and "lowest_bit" fields. |
96 | 96 | ||
97 | Both of these are spinlocks, and are never acquired from intr level. The | 97 | The swap_lock is a spinlock, and is never acquired from intr level. |
98 | locking hierarchy is swap_list_lock -> swap_device_lock. | ||
99 | 98 | ||
100 | To prevent races between swap space deletion or async readahead swapins | 99 | To prevent races between swap space deletion or async readahead swapins |
101 | deciding whether a swap handle is being used, ie worthy of being read in | 100 | deciding whether a swap handle is being used, ie worthy of being read in |