标题: 页面分配函数_alloc_pages()中shrink_zone()函数的各种变量的意义? [打印本页] 作者: kimyoung 时间: 2006-01-06 17:57 标题: 页面分配函数_alloc_pages()中shrink_zone()函数的各种变量的意义? /*
* This is a basic per-zone page freer. Used by both kswapd and direct reclaim.
*/
static void
shrink_zone(struct zone *zone, struct scan_control *sc)
{
unsigned long nr_active;
unsigned long nr_inactive;
atomic_inc(&zone->reclaim_in_progress);
/*
* Add one to `nr_to_scan' just to make sure that the kernel will
* slowly sift through the active list.
*/
/////////////////////////////////////////////////////////////////
//从这里开始就晕,很多参数都不知道有什么意义? 比如 sc->priority ,swap_cluster_max
//nr_scan_active ,nr_active 等等? 望大侠帮忙解释
zone->nr_scan_active += (zone->nr_active >> sc->priority) + 1;
nr_active = zone->nr_scan_active;
if (nr_active >= sc->swap_cluster_max)
zone->nr_scan_active = 0;
else
nr_active = 0;