linux-5.15/prepare_kswapd_sleep()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#wb9298a6]
#backlinks
*説明 [#yf3fc2ce]
-パス: [[linux-5.15/mm/vmscan.c]]
-FIXME: これは何?
--説明
**引数 [#kd646170]
-pg_data_t *pgdat
--メモリノード。
--[[linux-5.15/pg_data_t]]
-int order
--オーダー。
-int highest_zoneidx
--メモリを確保する最大のゾーンインデックス値。この値以下...
**返り値 [#d0ef6884]
-bool
--sleepするならtrue、しないならfalse。
**参考 [#f0d4ed02]
*実装 [#uf6ad46c]
/*
* Prepare kswapd for sleeping. This verifies that there...
* waiting in throttle_direct_reclaim() and that waterma...
*
* Returns true if kswapd is ready to sleep
*/
static bool prepare_kswapd_sleep(pg_data_t *pgdat, int o...
int highest_zoneidx)
{
/*
* The throttled processes are normally woken up in bal...
* soon as allow_direct_reclaim() is true. But there is...
* race between when kswapd checks the watermarks and a...
* throttled. There is also a potential race if process...
* throttled, kswapd wakes, a large process exits there...
* zones, which causes kswapd to exit balance_pgdat() b...
* the wake up checks. If kswapd is going to sleep, no ...
* be sleeping on pfmemalloc_wait, so wake them now if ...
* the wake up is premature, processes will wake kswapd...
* throttled again. The difference from wake ups in bal...
* that here we are under prepare_to_wait().
*/
if (waitqueue_active(&pgdat->pfmemalloc_wait))
wake_up_all(&pgdat->pfmemalloc_wait);
-最初にdirect reclaimを待っているプロセスを起こします。
--[[linux-5.15/waitqueue_active()]]
--[[linux-5.15/wake_up_all()]]
/* Hopeless node, leave it to direct reclaim */
if (pgdat->kswapd_failures >= MAX_RECLAIM_RETRIES)
return true;
-過去にページ回収を失敗しすぎていたら(今回も成功する可能...
if (pgdat_balanced(pgdat, order, highest_zoneidx)) {
clear_pgdat_congested(pgdat);
return true;
}
-ノードがバランス状態であればページ回収は不要なのでsleep...
--[[linux-5.15/pgdat_balanced()]]
--[[linux-5.15/clear_pgdat_congested()]]
return false;
}
*コメント [#t71b4489]
終了行:
*参照元 [#wb9298a6]
#backlinks
*説明 [#yf3fc2ce]
-パス: [[linux-5.15/mm/vmscan.c]]
-FIXME: これは何?
--説明
**引数 [#kd646170]
-pg_data_t *pgdat
--メモリノード。
--[[linux-5.15/pg_data_t]]
-int order
--オーダー。
-int highest_zoneidx
--メモリを確保する最大のゾーンインデックス値。この値以下...
**返り値 [#d0ef6884]
-bool
--sleepするならtrue、しないならfalse。
**参考 [#f0d4ed02]
*実装 [#uf6ad46c]
/*
* Prepare kswapd for sleeping. This verifies that there...
* waiting in throttle_direct_reclaim() and that waterma...
*
* Returns true if kswapd is ready to sleep
*/
static bool prepare_kswapd_sleep(pg_data_t *pgdat, int o...
int highest_zoneidx)
{
/*
* The throttled processes are normally woken up in bal...
* soon as allow_direct_reclaim() is true. But there is...
* race between when kswapd checks the watermarks and a...
* throttled. There is also a potential race if process...
* throttled, kswapd wakes, a large process exits there...
* zones, which causes kswapd to exit balance_pgdat() b...
* the wake up checks. If kswapd is going to sleep, no ...
* be sleeping on pfmemalloc_wait, so wake them now if ...
* the wake up is premature, processes will wake kswapd...
* throttled again. The difference from wake ups in bal...
* that here we are under prepare_to_wait().
*/
if (waitqueue_active(&pgdat->pfmemalloc_wait))
wake_up_all(&pgdat->pfmemalloc_wait);
-最初にdirect reclaimを待っているプロセスを起こします。
--[[linux-5.15/waitqueue_active()]]
--[[linux-5.15/wake_up_all()]]
/* Hopeless node, leave it to direct reclaim */
if (pgdat->kswapd_failures >= MAX_RECLAIM_RETRIES)
return true;
-過去にページ回収を失敗しすぎていたら(今回も成功する可能...
if (pgdat_balanced(pgdat, order, highest_zoneidx)) {
clear_pgdat_congested(pgdat);
return true;
}
-ノードがバランス状態であればページ回収は不要なのでsleep...
--[[linux-5.15/pgdat_balanced()]]
--[[linux-5.15/clear_pgdat_congested()]]
return false;
}
*コメント [#t71b4489]
ページ名: