Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This is the main entry point to direct page reclaim

Proto:static unsigned long do_try_to_free_pages(struct zonelist *zonelist, struct scan_control *sc)

Type:unsigned long

Parameter:

TypeParameterName
struct zonelist *zonelist
struct scan_control *sc
3038  initial_priority = Scan (total_size >> priority) pages at once
3042  retry :
3043  delayacct_freepages_start()
3045  If Not cgroup_reclaim(sc) Then __count_zid_vm_events(ALLOCSTALL, The highest zone to isolate pages for reclaim from , 1)
3048  Do
3049  vmpressure_prio( This context's GFP mask , * The memory cgroup that hit its limit and as a result is the * primary target of this reclaim invocation., Scan (total_size >> priority) pages at once )
3051  Incremented by the number of inactive pages that were scanned = 0
3052  This is the direct reclaim path, for page-allocating processes. We only* try to reclaim pages from zones which will satisfy the caller's allocation* request.* If a zone is deemed to be full of pinned pages then just give it a light
3054  If Number of pages freed so far during a call to shrink_zones() >= How many pages shrink_list() should reclaim Then Break
3057  If One of the zones is ready for compaction Then Break
3064  If Scan (total_size >> priority) pages at once < The "priority" of VM scanning is how much of the queues we will scan in one* go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the* queues ("queue_length >> 12") during an aging round. - 2 Then Writepage batching in laptop mode; RECLAIM_WRITE = 1
3066  When -- Scan (total_size >> priority) pages at once >= 0 cycle
3068  last_pgdat = NULL
3071  If zone_pgdat == last_pgdat Then Continue
3073  last_pgdat = zone_pgdat
3075  snapshot_refaults(* The memory cgroup that hit its limit and as a result is the * primary target of this reclaim invocation., zone_pgdat)
3077  If cgroup_reclaim(sc) Then
3080  lruvec = mem_cgroup_lruvec - get the lru list vector for a memcg & node*@memcg: memcg of the wanted lruvec* Returns the lru list vector holding pages for a given @memcg &*@node combination. This can be the node lruvec, if the memory* controller is disabled.
3082  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
3086  delayacct_freepages_end()
3088  If Number of pages freed so far during a call to shrink_zones() Then Return Number of pages freed so far during a call to shrink_zones()
3092  If One of the zones is ready for compaction Then Return 1
3104  If skipped_deactivate Then
3105  Scan (total_size >> priority) pages at once = initial_priority
3106  force_deactivate = 1
3107  skipped_deactivate = 0
3108  Go to retry
3112  If memcg_low_skipped Then
3113  Scan (total_size >> priority) pages at once = initial_priority
3114  force_deactivate = 0
3115  skipped_deactivate = 0
3116  * Cgroups are not reclaimed below their configured memory.low, * unless we threaten to OOM. If any cgroups are skipped due to * memory.low and nothing was reclaimed, go back for memory.low. = 1
3117  memcg_low_skipped = 0
3118  Go to retry
3121  Return 0
Caller
NameDescribe
try_to_free_pages
try_to_free_mem_cgroup_pages