Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmscan.c Create Date:2022-07-28 14:20:05
Last Modify:2022-05-23 13:41:30 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:The background pageout daemon, started as a kernel thread* from the init process.* This basically trickles out pages so that we have _some_* free memory available even if there is no other activity* that frees anything up

Proto:static int kswapd(void *p)

Type:int

Parameter:

TypeParameterName
void *p
3889  classzone_idx = MAX_NR_ZONES - 1
3890  pgdat = p
3891  tsk = current process
3892  cpumask = Returns a pointer to the cpumask of CPUs on Node 'node'.
3894  If Not pumask_empty - *srcp == 0*@srcp: the cpumask to that all cpus < nr_cpu_ids are clear. Then set_cpus_allowed_ptr(tsk, cpumask)
3909  flags |= Allocating memory | Allowed to write to swap | I am kswapd
3910  set_freezable()
3912  kswapd_order = 0
3913  kswapd_classzone_idx = MAX_NR_ZONES
3914  cycle
3917  alloc_order = reclaim_order = kswapd_order
3918  classzone_idx = kswapd_classzone_idx(pgdat, classzone_idx)
3920  kswapd_try_sleep :
3921  kswapd_try_to_sleep(pgdat, alloc_order, reclaim_order, classzone_idx)
3925  alloc_order = reclaim_order = kswapd_order
3926  classzone_idx = kswapd_classzone_idx(pgdat, classzone_idx)
3927  kswapd_order = 0
3928  kswapd_classzone_idx = MAX_NR_ZONES
3930  ret = try_to_freeze()
3931  If kthread_should_stop - should this kthread return now?* When someone calls kthread_stop() on your kthread, it will be woken* and this will return true. You should then return, and your return* value will be passed through to kthread_stop(). Then Break
3938  If ret Then Continue
3949  trace_mm_vmscan_kswapd_wake(node_id, classzone_idx, alloc_order)
3951  reclaim_order = For kswapd, balance_pgdat() will reclaim pages across a node from zones* that are eligible for use by the caller until at least one zone is* balanced.* Returns the order kswapd finished reclaiming at.
3952  If reclaim_order < alloc_order Then Go to kswapd_try_sleep
3956  flags &= ~( Allocating memory | Allowed to write to swap | I am kswapd )
3958  Return 0