linux-5.15/compaction_suitable()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#cb8cc65f]
#backlinks
*説明 [#s64e2f94]
-パス: [[linux-5.15/mm/compaction.c]]
-指定したゾーン、オーダー、割当フラグにおいて、コンパクシ...
**引数 [#c9a3a281]
-struct zone *zone
--メモリゾーン。
--[[linux-5.15/zone]]
-int order
--オーダー
-unsigned int alloc_flags
--割当フラグ
-int highest_zoneidx
--この値以下のゾーンから割り当てる
**返り値 [#wc1d1b93]
-enum compact_result
--COMPACT_SKIPPED - コンパクションするための空きページが...
--COMPACT_SUCCESS - コンパクションしなくても割当が成功す...
--COMPACT_CONTINUE - コンパクションすべき
**参考 [#c767d3fd]
*実装 [#fd42e6cf]
/*
* compaction_suitable: Is this suitable to run compacti...
* Returns
* COMPACT_SKIPPED - If there are too few free pages ...
* COMPACT_SUCCESS - If the allocation would succeed ...
* COMPACT_CONTINUE - If compaction should run now
*/
enum compact_result compaction_suitable(struct zone *zon...
unsigned int alloc_flags,
int highest_zoneidx)
{
enum compact_result ret;
int fragindex;
ret = __compaction_suitable(zone, order, alloc_flags, h...
zone_page_state(zone, NR_FREE_PAGES));
-
--[[linux-5.15/__compaction_suitable()]]
--[[linux-5.15/zone_page_state()]]
/*
* fragmentation index determines if allocation failure...
* low memory or external fragmentation
*
* index of -1000 would imply allocations might succeed...
* watermarks, but we already failed the high-order wat...
* index towards 0 implies failure is due to lack of me...
* index towards 1000 implies failure is due to fragmen...
*
* Only compact if a failure would be due to fragmentat...
* ignore fragindex for non-costly orders where the alt...
* a successful reclaim/compaction is OOM. Fragindex an...
* vm.extfrag_threshold sysctl is meant as a heuristic ...
* excessive compaction for costly orders, but it shoul...
* expense of system stability.
*/
if (ret == COMPACT_CONTINUE && (order > PAGE_ALLOC_COST...
fragindex = fragmentation_index(zone, order);
if (fragindex >= 0 && fragindex <= sysctl_extfrag_thre...
ret = COMPACT_NOT_SUITABLE_ZONE;
}
-
--[[linux-5.15/fragmentation_index()]]
trace_mm_compaction_suitable(zone, order, ret);
if (ret == COMPACT_NOT_SUITABLE_ZONE)
ret = COMPACT_SKIPPED;
return ret;
}
-
--[[linux-5.15/trace_mm_compaction_suitable()]]
*コメント [#cb4b6f63]
終了行:
*参照元 [#cb8cc65f]
#backlinks
*説明 [#s64e2f94]
-パス: [[linux-5.15/mm/compaction.c]]
-指定したゾーン、オーダー、割当フラグにおいて、コンパクシ...
**引数 [#c9a3a281]
-struct zone *zone
--メモリゾーン。
--[[linux-5.15/zone]]
-int order
--オーダー
-unsigned int alloc_flags
--割当フラグ
-int highest_zoneidx
--この値以下のゾーンから割り当てる
**返り値 [#wc1d1b93]
-enum compact_result
--COMPACT_SKIPPED - コンパクションするための空きページが...
--COMPACT_SUCCESS - コンパクションしなくても割当が成功す...
--COMPACT_CONTINUE - コンパクションすべき
**参考 [#c767d3fd]
*実装 [#fd42e6cf]
/*
* compaction_suitable: Is this suitable to run compacti...
* Returns
* COMPACT_SKIPPED - If there are too few free pages ...
* COMPACT_SUCCESS - If the allocation would succeed ...
* COMPACT_CONTINUE - If compaction should run now
*/
enum compact_result compaction_suitable(struct zone *zon...
unsigned int alloc_flags,
int highest_zoneidx)
{
enum compact_result ret;
int fragindex;
ret = __compaction_suitable(zone, order, alloc_flags, h...
zone_page_state(zone, NR_FREE_PAGES));
-
--[[linux-5.15/__compaction_suitable()]]
--[[linux-5.15/zone_page_state()]]
/*
* fragmentation index determines if allocation failure...
* low memory or external fragmentation
*
* index of -1000 would imply allocations might succeed...
* watermarks, but we already failed the high-order wat...
* index towards 0 implies failure is due to lack of me...
* index towards 1000 implies failure is due to fragmen...
*
* Only compact if a failure would be due to fragmentat...
* ignore fragindex for non-costly orders where the alt...
* a successful reclaim/compaction is OOM. Fragindex an...
* vm.extfrag_threshold sysctl is meant as a heuristic ...
* excessive compaction for costly orders, but it shoul...
* expense of system stability.
*/
if (ret == COMPACT_CONTINUE && (order > PAGE_ALLOC_COST...
fragindex = fragmentation_index(zone, order);
if (fragindex >= 0 && fragindex <= sysctl_extfrag_thre...
ret = COMPACT_NOT_SUITABLE_ZONE;
}
-
--[[linux-5.15/fragmentation_index()]]
trace_mm_compaction_suitable(zone, order, ret);
if (ret == COMPACT_NOT_SUITABLE_ZONE)
ret = COMPACT_SKIPPED;
return ret;
}
-
--[[linux-5.15/trace_mm_compaction_suitable()]]
*コメント [#cb4b6f63]
ページ名: