]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - mm/internal.h
mm: improve documentation of page_order
[mirror_ubuntu-bionic-kernel.git] / mm / internal.h
index 7e145e8cd1e6ffadcd86ca0f2c2a30c7ac9ba027..612c14f5e0f570159fcf775991e88615fca26606 100644 (file)
@@ -143,9 +143,11 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
 #endif
 
 /*
- * function for dealing with page's order in buddy system.
- * zone->lock is already acquired when we use these.
- * So, we don't need atomic page->flags operations here.
+ * This function returns the order of a free page in the buddy system. In
+ * general, page_zone(page)->lock must be held by the caller to prevent the
+ * page from being allocated in parallel and returning garbage as the order.
+ * If a caller does not hold page_zone(page)->lock, it must guarantee that the
+ * page cannot be allocated or merged in parallel.
  */
 static inline unsigned long page_order(struct page *page)
 {