Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kswapd_try_to_sleep

Proto:static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_order, unsigned int classzone_idx)

Type:void

Parameter:

TypeParameterName
pg_data_t *pgdat
intalloc_order
intreclaim_order
unsigned intclasszone_idx
3796  remaining = 0
3797  DEFINE_WAIT(wait)
3799  If freezing(current process) || 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 Return
3802  Note: we use "set_current_state()" _after_ the wait-queue add,* because we need a memory barrier there on SMP, so that any* wake-function that tests for the wait-queue being active* will be guaranteed to see waitqueue addition _or_ subsequent
3811  If Prepare kswapd for sleeping. This verifies that there are no processes* waiting in throttle_direct_reclaim() and that watermarks have been met.* Returns true if kswapd is ready to sleep Then
3818  reset_isolation_suitable(pgdat)
3824  wakeup_kcompactd(pgdat, alloc_order, classzone_idx)
3826  remaining = schedule_timeout - sleep until timeout*@timeout: timeout value in jiffies* Make the current task sleep until @timeout jiffies have* elapsed
3833  If remaining Then
3838  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
3839  Note: we use "set_current_state()" _after_ the wait-queue add,* because we need a memory barrier there on SMP, so that any* wake-function that tests for the wait-queue being active* will be guaranteed to see waitqueue addition _or_ subsequent
3846  If Not remaining && Prepare kswapd for sleeping. This verifies that there are no processes* waiting in throttle_direct_reclaim() and that watermarks have been met.* Returns true if kswapd is ready to sleep Then
3848  trace_mm_vmscan_kswapd_sleep(node_id)
3860  If Not 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 schedule()
3864  Else
3865  If remaining Then Disable counters
3867  Else Disable counters
3870  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
Caller
NameDescribe
kswapdThe 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