下面是防止一般oom的方法:
3: 設(shè)置DEF_PRIORITY 比較小的數(shù)值, scan一次掃描更多的頁面,對系統(tǒng)性能影響大嗎 ?
569 /*
570 * The "priority" of VM scanning is how much of the queues we will scan in one
571 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the
572 * queues ("queue_length >> 12") during an aging round.
573 */
574 #define DEF_PRIORITY 12
4:修改zone_watermark_ok算法,拉大watermark_low/watermark_min的差距,盡早啟動kswapd使其有足夠的時間回收頁面