linux-5.15/__rmqueue_fallback()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#r0997772]
#backlinks
*説明 [#g9831878]
-パス: [[linux-5.15/mm/page_alloc.c]]
-FIXME: これは何?
--説明
**引数 [#be4802db]
-struct zone *zone
--
--[[linux-5.15/zone]]
-int order
--
-int start_migratetype
--
-unsigned int alloc_flags
--
**返り値 [#s5f4f672]
-bool
--
**参考 [#v9edcf02]
*実装 [#g0e41b38]
/*
* Try finding a free buddy page on the fallback list an...
* list of requested migratetype, possibly along with ot...
* block, depending on fragmentation avoidance heuristic...
* fallback was found so that __rmqueue_smallest() can g...
*
* The use of signed ints for order and current_order is...
* deviation from the rest of this file, to make the for...
* condition simpler.
*/
static __always_inline bool
__rmqueue_fallback(struct zone *zone, int order, int sta...
unsigned int alloc_flags)
{
struct free_area *area;
int current_order;
int min_order = order;
struct page *page;
int fallback_mt;
bool can_steal;
/*
* Do not steal pages from freelists belonging to other...
* i.e. orders < pageblock_order. If there are no local...
* the zonelists will be reiterated without ALLOC_NOFRA...
*/
if (alloc_flags & ALLOC_NOFRAGMENT)
min_order = pageblock_order;
-
--[[linux-5.15/free_area]]
--[[linux-5.15/page]]
/*
* Find the largest available free page in the other li...
* approximates finding the pageblock with the most fre...
* would be too costly to do exactly.
*/
for (current_order = MAX_ORDER - 1; current_order >= mi...
--current_order) {
area = &(zone->free_area[current_order]);
fallback_mt = find_suitable_fallback(area, current_ord...
start_migratetype, false, &can_steal);
if (fallback_mt == -1)
continue;
/*
* We cannot steal all free pages from the pageblock a...
* requested migratetype is movable. In that case it's...
* steal and split the smallest available page instead...
* largest available page, because even if the next mo...
* allocation falls back into a different pageblock th...
* one, it won't cause permanent fragmentation.
*/
if (!can_steal && start_migratetype == MIGRATE_MOVABLE
&& current_order > order)
goto find_smallest;
goto do_steal;
}
return false;
-
--[[linux-5.15/find_suitable_fallback()]]
find_smallest:
for (current_order = order; current_order < MAX_ORDER;
current_order++) {
area = &(zone->free_area[current_order]);
fallback_mt = find_suitable_fallback(area, current_ord...
start_migratetype, false, &can_steal);
if (fallback_mt != -1)
break;
}
/*
* This should not happen - we already found a suitable...
* when looking for the largest page.
*/
VM_BUG_ON(current_order == MAX_ORDER);
-
--[[linux-5.15/find_suitable_fallback()]]
--[[linux-5.15/VM_BUG_ON()]]
do_steal:
page = get_page_from_free_area(area, fallback_mt);
steal_suitable_fallback(zone, page, alloc_flags, start_...
can_steal);
trace_mm_page_alloc_extfrag(page, order, current_order,
start_migratetype, fallback_mt);
return true;
}
-
--[[linux-5.15/get_page_from_free_area()]]
--[[linux-5.15/steal_suitable_fallback()]]
--[[linux-5.15/trace_mm_page_alloc_extfrag()]]
*コメント [#f99b50c1]
終了行:
*参照元 [#r0997772]
#backlinks
*説明 [#g9831878]
-パス: [[linux-5.15/mm/page_alloc.c]]
-FIXME: これは何?
--説明
**引数 [#be4802db]
-struct zone *zone
--
--[[linux-5.15/zone]]
-int order
--
-int start_migratetype
--
-unsigned int alloc_flags
--
**返り値 [#s5f4f672]
-bool
--
**参考 [#v9edcf02]
*実装 [#g0e41b38]
/*
* Try finding a free buddy page on the fallback list an...
* list of requested migratetype, possibly along with ot...
* block, depending on fragmentation avoidance heuristic...
* fallback was found so that __rmqueue_smallest() can g...
*
* The use of signed ints for order and current_order is...
* deviation from the rest of this file, to make the for...
* condition simpler.
*/
static __always_inline bool
__rmqueue_fallback(struct zone *zone, int order, int sta...
unsigned int alloc_flags)
{
struct free_area *area;
int current_order;
int min_order = order;
struct page *page;
int fallback_mt;
bool can_steal;
/*
* Do not steal pages from freelists belonging to other...
* i.e. orders < pageblock_order. If there are no local...
* the zonelists will be reiterated without ALLOC_NOFRA...
*/
if (alloc_flags & ALLOC_NOFRAGMENT)
min_order = pageblock_order;
-
--[[linux-5.15/free_area]]
--[[linux-5.15/page]]
/*
* Find the largest available free page in the other li...
* approximates finding the pageblock with the most fre...
* would be too costly to do exactly.
*/
for (current_order = MAX_ORDER - 1; current_order >= mi...
--current_order) {
area = &(zone->free_area[current_order]);
fallback_mt = find_suitable_fallback(area, current_ord...
start_migratetype, false, &can_steal);
if (fallback_mt == -1)
continue;
/*
* We cannot steal all free pages from the pageblock a...
* requested migratetype is movable. In that case it's...
* steal and split the smallest available page instead...
* largest available page, because even if the next mo...
* allocation falls back into a different pageblock th...
* one, it won't cause permanent fragmentation.
*/
if (!can_steal && start_migratetype == MIGRATE_MOVABLE
&& current_order > order)
goto find_smallest;
goto do_steal;
}
return false;
-
--[[linux-5.15/find_suitable_fallback()]]
find_smallest:
for (current_order = order; current_order < MAX_ORDER;
current_order++) {
area = &(zone->free_area[current_order]);
fallback_mt = find_suitable_fallback(area, current_ord...
start_migratetype, false, &can_steal);
if (fallback_mt != -1)
break;
}
/*
* This should not happen - we already found a suitable...
* when looking for the largest page.
*/
VM_BUG_ON(current_order == MAX_ORDER);
-
--[[linux-5.15/find_suitable_fallback()]]
--[[linux-5.15/VM_BUG_ON()]]
do_steal:
page = get_page_from_free_area(area, fallback_mt);
steal_suitable_fallback(zone, page, alloc_flags, start_...
can_steal);
trace_mm_page_alloc_extfrag(page, order, current_order,
start_migratetype, fallback_mt);
return true;
}
-
--[[linux-5.15/get_page_from_free_area()]]
--[[linux-5.15/steal_suitable_fallback()]]
--[[linux-5.15/trace_mm_page_alloc_extfrag()]]
*コメント [#f99b50c1]
ページ名: