*参照元 [#x8596b7f]
#backlinks

*説明 [#kb2ef2cc]
-パス: [[linux-4.4.1/mm/page_alloc.c]]

-FIXME: これは何?
--説明


**引数 [#f49edaa7]
-struct zone *zone
--
--[[linux-4.4.1/zone]]
-struct page *page
--
--[[linux-4.4.1/page]]
-int low
--
-int high
--
-struct free_area *area
--
--[[linux-4.4.1/free_area]]
-int migratetype
--


**返り値 [#ndacdd79]
-void


**参考 [#mea210a4]


*実装 [#efaf0a49]
 /*
  * The order of subdivision here is critical for the IO subsystem.
  * Please do not alter this order without good reasons and regression
  * testing. Specifically, as large blocks of memory are subdivided,
  * the order in which smaller blocks are delivered depends on the order
  * they're subdivided in this function. This is the primary factor
  * influencing the order in which pages are delivered to the IO
  * subsystem according to empirical testing, and this is also justified
  * by considering the behavior of a buddy system containing a single
  * large block of memory acted on by a series of small allocations.
  * This behavior is a critical factor in sglist merging's success.
  *
  * -- nyc
  */
 static inline void expand(struct zone *zone, struct page *page,
 	int low, int high, struct free_area *area,
 	int migratetype)
 {
 	unsigned long size = 1 << high;
 
 	while (high > low) {
 		area--;
 		high--;
 		size >>= 1;
 		VM_BUG_ON_PAGE(bad_range(zone, &page[size]), &page[size]);
 
-
--[[linux-4.4.1/VM_BUG_ON_PAGE()]]
--[[linux-4.4.1/bad_range()]]

 		if (IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) &&
 			debug_guardpage_enabled() &&
 			high < debug_guardpage_minorder()) {
-
--[[linux-4.4.1/IS_ENABLED()]]
--[[linux-4.4.1/CONFIG_DEBUG_PAGEALLOC]]
--[[linux-4.4.1/debug_guardpage_enabled()]]
--[[linux-4.4.1/debug_guardpage_minorder()]]

 			/*
 			 * Mark as guard pages (or page), that will allow to
 			 * merge back to allocator when buddy will be freed.
 			 * Corresponding page table entries will not be touched,
 			 * pages will stay not present in virtual address space
 			 */
 			set_page_guard(zone, &page[size], high, migratetype);
 			continue;
-
--[[linux-4.4.1/set_page_guard()]]

 		}
 		list_add(&page[size].lru, &area->free_list[migratetype]);
 		area->nr_free++;
 		set_page_order(&page[size], high);
-
--[[linux-4.4.1/list_add()]]
--[[linux-4.4.1/set_page_order()]]

 	}
 }


*コメント [#p1172d9c]

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS