函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmscan.c Create Date:2022-07-27 15:43:58
Last Modify:2022-05-23 13:41:30 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kswapd_try_to_sleep

函数原型:static void kswapd_try_to_sleep(pg_data_t *pgdat, int alloc_order, int reclaim_order, unsigned int classzone_idx)

返回类型:void

参数:

类型参数名称
pg_data_t *pgdat
intalloc_order
intreclaim_order
unsigned intclasszone_idx
3796  remaining等于0
3797  DEFINE_WAIT(wait)
3799  如果freezing(当前进程)或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().则返回
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  如果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
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  如果remaining
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  如果非remainingPrepare 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
3848  trace_mm_vmscan_kswapd_sleep(全局结点ID)
3860  如果非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().进程调度
3864  否则
3865  如果remainingDisable counters
3867  否则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.
调用者
名称描述
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