Linux-内存
kswapd_init
kswapd_run
kswapd
kswapd_try_to_sleep
prepare_kswapd_sleep
pgdat_balanced
zone_watermark_ok_safe
balance_pgdat
kswapd_shrink_node
shrink_node
allow_direct_reclaim
//////////////////////////////////////////
alloc_page
alloc_pages
alloc_pages_node
__alloc_pages_nodemask
get_page_from_freelist
zone_watermark_fast
zone_watermark_ok
__alloc_pages_slowpath
wake_all_kswapds
__alloc_pages_direct_reclaim
__alloc_pages_may_oom
out_of_memory
/////////////////////////////////////////
out_of_memory
select_bad_process
oom_evaluate_task
oom_badness
oom_kill_process
/////////////////////////////////////////
drop_caches_sysctl_handler
drop_pagecache_sb
invalidate_mapping_pages
invalidate_inode_page
remove_mapping
/////////////////////////////////////////
__setup_per_zone_wmarks()
{
unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10)
...
for_each_zone(zone)
{
u64 tmp;
tmp = (u64)pages_min * zone->managed_pages;
do_div(tmp, lowmem_pages);
zone->watermark[WMARK_MIN] = tmp;
tmp = max_t(u64, tmp >> 2,
mult_frac(zone->managed_pages,
watermark_scale_factor, 10000));
zone->watermark[WMARK_LOW] = min_wmark_pages(zone) + tmp;
zone->watermark[WMARK_HIGH] = min_wmark_pages(zone) + tmp * 2;
}
}