mm/swap: add some comments for swap flag/lock usage
Subsystems (5)
PATCH 1/8 mm/swap: add some comments for swap flag/lock usage
The swap flag/lock usage in swapfile.c is lack of clarity and readability, some comments are not correct in other files.
Add some comments to try to make it more clear and readable.
Signed-off-by Weijie Yang <[email protected]>
--- include/linux/blkdev.h | 4 ++- mm/rmap.c | 2 +- mm/swapfile.c | 66 +++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 67 insertions(+), 5 deletions(-)
include/linux/blkdev.h +3 -1
@@ -1575,7 +1575,9 @@ struct block_device_operations {void (*unlock_native_capacity) (struct gendisk *);int (*revalidate_disk) (struct gendisk *);int (*getgeo)(struct block_device *,struct hd_geometry *); -/* this callback is with swap_lock and sometimes page table lock held */ +/* this callback is with swap_info_struct.lock +* and sometimes page table lock held +*/ void (*swap_slot_free_notify) (struct block_device *,unsigned long );struct module *owner; };
mm/rmap.c +1 -1
@@ -27,7 +27,7 @@* anon_vma->rwsem * mm->page_table_lock or pte_lock * zone->lru_lock (in mark_page_accessed, isolate_lru_page) -* swap_lock (in swap_duplicate, swap_info_get) +* swap_info_struct.lock (in swap_duplicate, swap_info_get) * mmlist_lock (in mmput, drain_mmlist and others) * mapping->private_lock (in __set_page_dirty_buffers) * inode->i_lock (in set_page_dirty's __mark_inode_dirty)
mm/swapfile.c +63 -3
104 lines not on this page · raw message
Signature · 1 line
1.7.10.4