参照元

説明

引数

返り値

参考

実装

/*
 * Number of free order-0 pages that should be available above given watermark
 * to make sure compaction has reasonable chance of not running out of free
 * pages that it needs to isolate as migration target during its work.
 */
static inline unsigned long compact_gap(unsigned int order)
{
	/*
	 * Although all the isolations for migration are temporary, compaction
	 * free scanner may have up to 1 << order pages on its list and then
	 * try to split an (order - 1) free page. At that point, a gap of
	 * 1 << order might not be enough, so it's safer to require twice that
	 * amount. Note that the number of pages on the list is also
	 * effectively limited by COMPACT_CLUSTER_MAX, as that's the maximum
	 * that the migrate scanner can have isolated on migrate list, and free
	 * scanner is only invoked when the number of isolated free pages is
	 * lower than that. But it's not worth to complicate the formula here
	 * as a bigger gap for higher orders than strictly necessary can also
	 * improve chances of compaction success.
	 */
	return 2UL << order;
}

(※)元の英文と適当訳です。

(関数の説明) Number of free order-0 pages that should be available above given watermark to make sure compaction has reasonable chance of not running out of free pages that it needs to isolate as migration target during its work.

コンパクション時に空きページ(migration対象として分離する必要があるページ)が足りるように、 watermarkを超えるorder 0の空きページ数。

(2 << orderの説明) Although all the isolations for migration are temporary, compaction free scanner may have up to 1 << order pages on its list and then try to split an (order - 1) free page. At that point, a gap of 1 << order might not be enough, so it's safer to require twice that amount. Note that the number of pages on the list is also effectively limited by COMPACT_CLUSTER_MAX, as that's the maximum that the migrate scanner can have isolated on migrate list, and free scanner is only invoked when the number of isolated free pages is lower than that. But it's not worth to complicate the formula here as a bigger gap for higher orders than strictly necessary can also improve chances of compaction success.

移行のための分離は全て一時的ですが、compactionのフリースキャナリストには最大(1 << order)のページが含まれる場合があり、その後(order - 1)の空きページを分割しようとします。 この観点から(1 << order)ページのギャップでは足りないので、2倍の量が安全です。 フリースキャナリストのページ数も、migrationのスキャナーがmigrateリストに分離できる最大値 (COMPACT_CLUSTER_MAX、値は32)に実質的に制限されることに注意してください。また、分離された空きページの数がこれより少ない場合のみ、空きスキャナーが呼び出されます。 しかし式を複雑にする価値はありません。なぜなら厳密に必要な値より、高い次数へギャップを大きくしたほうが圧縮が成功する可能性が高まるからです。

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS