MCPcopy Create free account
hub / github.com/F-Stack/f-stack / uma_reclaim

Function uma_reclaim

freebsd/vm/uma_core.c:4957–4990  ·  view source on GitHub ↗

See uma.h */

Source from the content-addressed store, hash-verified

4955
4956/* See uma.h */
4957void
4958uma_reclaim(int req)
4959{
4960
4961 CTR0(KTR_UMA, "UMA: vm asked us to release pages!");
4962 sx_xlock(&uma_reclaim_lock);
4963 bucket_enable();
4964
4965 switch (req) {
4966 case UMA_RECLAIM_TRIM:
4967 zone_foreach(zone_trim, NULL);
4968 break;
4969 case UMA_RECLAIM_DRAIN:
4970 case UMA_RECLAIM_DRAIN_CPU:
4971 zone_foreach(zone_drain, NULL);
4972 if (req == UMA_RECLAIM_DRAIN_CPU) {
4973 pcpu_cache_drain_safe(NULL);
4974 zone_foreach(zone_drain, NULL);
4975 }
4976 break;
4977 default:
4978 panic("unhandled reclamation request %d", req);
4979 }
4980
4981 /*
4982 * Some slabs may have been freed but this zone will be visited early
4983 * we visit again so that we can free pages that are empty once other
4984 * zones are drained. We have to do the same for buckets.
4985 */
4986 zone_drain(slabzones[0], NULL);
4987 zone_drain(slabzones[1], NULL);
4988 bucket_zone_drain();
4989 sx_xunlock(&uma_reclaim_lock);
4990}
4991
4992static volatile int uma_reclaim_needed;
4993

Callers 4

kmem_reapFunction · 0.85
vnlru_procFunction · 0.85
vm_pageout_lowmemFunction · 0.85
uma_reclaim_workerFunction · 0.85

Calls 6

bucket_enableFunction · 0.85
zone_foreachFunction · 0.85
pcpu_cache_drain_safeFunction · 0.85
zone_drainFunction · 0.85
bucket_zone_drainFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected