Some VM subsystem important knobs

There are at least two hysteresis-like cycles in the VM code.

One regulates when the page daemon performs paging out.

The other regulates when page allocation succeeds.

Important levels of available pages (v_free_count + v_cache_count), from higher to lower.

Prior to http://svnweb.freebsd.org/changeset/base/254304:

Threshold

Sample values from untuned amd64 system with 8GB RAM

Description and useful information

Page daemon active

Normal requests are satisfied

Normal waiters waken up

v_cache_min + v_free_target

104572 = 52286 + 52286

a level that a page scan pass tries to reach; at this level and above vm_paging_target() == 0, below it is 1.

X

X

v_cache_min + v_free_reserved

54904 = 52286 + 2618

a level below which vm_page_alloc() still succeeds for all request classes, but sets vm_pages_needed flag and triggers a page scan; vm_paging_needed() == 1 below this level.

X

X

X

v_free_min

12417

at this level threads waiting for pages in VM_WAIT are waken up after page shortage (and vm_pages_needed flag is reset) in vm_page_free_wakeup(); vm_page_count_min() == 1 below this level. vm_page_free_wakeup() is called by vm_page_free_toq() and vm_page_cache(), that is, upon increasing available pages count.

X

X

X

v_free_severe

7517

below this level some users of vm_page_alloc() decide to not call it and instead voluntary wait until more pages are available. Important cases of this check are: vm_fault() and vm_forkproc(). vm_page_count_severe() == 1 below this level.

X

X

v_free_reserved

2618

at this level vm_page_alloc() would return NULL for normal requests; threads needing (M_WAITOK) memory would call VM_WAIT before retrying.

X

v_pageout_free_min

34

if the page daemon thread runs into a page shortage and ends up in VM_WAIT, then it would be waken up when this threshold is exceeded

X

v_interrupt_free_min

2

at this level vm_page_alloc() would fail even for VM_ALLOC_SYSTEM requests, only VM_ALLOC_INTERRUPT requests can succeed

X

zero

0

with zero available pages vm_page_alloc() would fail for all requests, all memory is exhausted

X

After http://svnweb.freebsd.org/changeset/base/254304:

Threshold

Sample values from untuned amd64 system with 8GB RAM

Description and useful information

Page daemon active

Normal requests are satisfied

Normal waiters waken up

v_free_target

40536

a level that a page scan pass tries to reach; at this level and above vm_paging_target() == 0, below it is 1.

X

X

vm_pageout_wakeup_thresh

13233

a level below which vm_page_alloc() still succeeds for all request classes, but sets vm_pages_needed flag and triggers a page scan; vm_paging_needed() == 1 below this level.

X

X

X

v_free_min

12417

at this level threads waiting for pages in VM_WAIT are waken up after page shortage (and vm_pages_needed flag is reset) in vm_page_free_wakeup(); vm_page_count_min() == 1 below this level. vm_page_free_wakeup() is called by vm_page_free_toq() and vm_page_cache(), that is, upon increasing available pages count.

X

X

X

v_free_severe

7517

below this level some users of vm_page_alloc() decide to not call it and instead voluntary wait until more pages are available. Important cases of this check are: vm_fault() and vm_forkproc(). vm_page_count_severe() == 1 below this level.

X

X

v_free_reserved

2618

at this level vm_page_alloc() would return NULL for normal requests; threads needing (M_WAITOK) memory would call VM_WAIT before retrying.

X

v_pageout_free_min

34

if the page daemon thread runs into a page shortage and ends up in VM_WAIT, then it would be waken up when this threshold is exceeded

X

v_interrupt_free_min

2

at this level vm_page_alloc() would fail even for VM_ALLOC_SYSTEM requests, only VM_ALLOC_INTERRUPT requests can succeed

X

zero

0

with zero available pages vm_page_alloc() would fail for all requests, all memory is exhausted

X

AndriyGapon/AvgPageoutAlgorithm (last edited 2016-07-21T11:05:11+0000 by KubilayKocak)