Skip to contentSkip to conversation

mm/swap: add some comments for swap flag/lock usage

PATCH In review Weijie Yang 1 participant 1 message Jan 27, 2014

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

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.

---
 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
index 1b135d4..fa11ef6 100644
@@ -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
index d9d4231..1d31ba7 100644
@@ -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