#author("2025-09-13T01:35:25+09:00","default:guest","guest")

#author("2025-09-13T01:36:49+09:00","default:guest","guest")
*参照元 [#aff2b156]
#backlinks

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

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


**引数 [#c24b9195]
-
-struct zone *zone
--
--[[linux-5.15/zone]]
-unsigned int order
--
-int migratetype
--
-unsigned int alloc_flags
--
-struct per_cpu_pages *pcp
--
--[[linux-5.15/per_cpu_pages]]
-struct list_head *list
--
--[[linux-5.15/list_head]]


**返り値 [#tc1d50a3]
-
-struct page *
--
--[[linux-5.15/page]]


**参考 [#l601bc98]


*実装 [#ga564ae3]

 /* Remove page from the per-cpu list, caller must protect the list */
 static inline
 struct page *__rmqueue_pcplist(struct zone *zone, unsigned int order,
 			int migratetype,
 			unsigned int alloc_flags,
 			struct per_cpu_pages *pcp,
 			struct list_head *list)
 {
 	struct page *page;
 
 	do {
 		if (list_empty(list)) {
 			int batch = READ_ONCE(pcp->batch);
 			int alloced;
 
-
--[[linux-5.15/page]]
--[[linux-5.15/list_empty()]]
--[[linux-5.15/READ_ONCE()]]

 			/*
 			 * Scale batch relative to order if batch implies
 			 * free pages can be stored on the PCP. Batch can
 			 * be 1 for small zones or for boot pagesets which
 			 * should never store free pages as the pages may
 			 * belong to arbitrary zones.
 			 */
 			if (batch > 1)
 				batch = max(batch >> order, 2);
 			alloced = rmqueue_bulk(zone, order,
 					batch, list,
 					migratetype, alloc_flags);
 
 			pcp->count += alloced << order;
 			if (unlikely(list_empty(list)))
 				return NULL;
 		}
 
-
--[[linux-5.15/rmqueue_bulk()]]
--[[linux-5.15/unlikely()]]
--[[linux-5.15/list_empty()]]

 		page = list_first_entry(list, struct page, lru);
 		list_del(&page->lru);
 		pcp->count -= 1 << order;
 	} while (check_new_pcp(page));
 
 	return page;
 }

-
--[[linux-5.15/list_first_entry()]]
--[[linux-5.15/list_del()]]
--[[linux-5.15/check_new_pcp()]]


*コメント [#h187e972]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS