#author("2025-09-10T19:34:04+09:00","default:guest","guest")

#author("2025-09-10T19:35:17+09:00","default:guest","guest")
*参照元 [#ie68ed1b]
#backlinks

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

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


**引数 [#ic7439d0]
-
-struct zone *zone
--
--[[linux-5.15/zone]]
-unsigned long pfn
--
-bool check_source
--
-bool check_target
--


**返り値 [#f7cffdda]
-
-bool
--


**参考 [#q7f7b49e]


*実装 [#kd86fe30]

 static bool
 __reset_isolation_pfn(struct zone *zone, unsigned long pfn, bool check_source,
 							bool check_target)
 {
 	struct page *page = pfn_to_online_page(pfn);
 	struct page *block_page;
 	struct page *end_page;
 	unsigned long block_pfn;
 
 	if (!page)
 		return false;
 	if (zone != page_zone(page))
 		return false;
 	if (pageblock_skip_persistent(page))
 		return false;
 
-
--[[linux-5.15/pfn_to_online_page()]]
--[[linux-5.15/page_zone()]]
--[[linux-5.15/pageblock_skip_persistent()]]

 	/*
 	 * If skip is already cleared do no further checking once the
 	 * restart points have been set.
 	 */
 	if (check_source && check_target && !get_pageblock_skip(page))
 		return true;
 
-
--[[linux-5.15/get_pageblock_skip()]]

 	/*
 	 * If clearing skip for the target scanner, do not select a
 	 * non-movable pageblock as the starting point.
 	 */
 	if (!check_source && check_target &&
 	    get_pageblock_migratetype(page) != MIGRATE_MOVABLE)
 		return false;
 
-
--[[linux-5.15/get_pageblock_migratetype()]]

 	/* Ensure the start of the pageblock or zone is online and valid */
 	block_pfn = pageblock_start_pfn(pfn);
 	block_pfn = max(block_pfn, zone->zone_start_pfn);
 	block_page = pfn_to_online_page(block_pfn);
 	if (block_page) {
 		page = block_page;
 		pfn = block_pfn;
 	}
 
-
--[[linux-5.15/pageblock_start_pfn()]]
--[[linux-5.15/pfn_to_online_page()]]

 	/* Ensure the end of the pageblock or zone is online and valid */
 	block_pfn = pageblock_end_pfn(pfn) - 1;
 	block_pfn = min(block_pfn, zone_end_pfn(zone) - 1);
 	end_page = pfn_to_online_page(block_pfn);
 	if (!end_page)
 		return false;
 
-
--[[linux-5.15/pageblock_end_pfn()]]
--[[linux-5.15/zone_end_pfn()]]
--[[linux-5.15/pfn_to_online_page()]]

 	/*
 	 * Only clear the hint if a sample indicates there is either a
 	 * free page or an LRU page in the block. One or other condition
 	 * is necessary for the block to be a migration source/target.
 	 */
 	do {
 		if (check_source && PageLRU(page)) {
 			clear_pageblock_skip(page);
 			return true;
 		}
 
 		if (check_target && PageBuddy(page)) {
 			clear_pageblock_skip(page);
 			return true;
 		}
 
 		page += (1 << PAGE_ALLOC_COSTLY_ORDER);
 		pfn += (1 << PAGE_ALLOC_COSTLY_ORDER);
 	} while (page <= end_page);
 
 	return false;
 }

-
--[[linux-5.15/PageLRU()]]
--[[linux-5.15/clear_pageblock_skip()]]
--[[linux-5.15/PageBuddy()]]


*コメント [#xe423354]

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