Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\vmpressure.c Create Date:2022-07-28 16:15:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:vmpressure() - Account memory pressure through scanned/reclaimed ratio*@gfp: reclaimer's gfp mask*@memcg: cgroup memory controller handle*@tree: legacy subtree mode*@scanned: number of pages scanned*@reclaimed: number of pages reclaimed* This function

Proto:void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree, unsigned long scanned, unsigned long reclaimed)

Type:void

Parameter:

TypeParameterName
gfp_tgfp
struct mem_cgroup *memcg
booltree
unsigned longscanned
unsigned longreclaimed
243  vmpr = Some nice accessors for the vmpressure.
256  If Not (gfp & ( __GFP_HIGHMEM | ZONE_MOVABLE allowed | DOC: Reclaim modifiers* Reclaim modifiers* ~~~~~~~~~~~~~~~~~* %__GFP_IO can start physical IO.* %__GFP_FS can call down to the low-level FS. Clearing the flag avoids the* allocator recursing into the filesystem which might already be holding* locks. | __GFP_FS)) Then Return
267  If Not scanned Then Return
270  If tree Then
271  spin_lock( & The lock is used to keep the scanned/reclaimed above in sync. )
272  scanned = tree_scanned += scanned
273  tree_reclaimed += reclaimed
274  spin_unlock( & The lock is used to keep the scanned/reclaimed above in sync. )
276  If scanned < The window size (vmpressure_win) is the number of scanned pages before* we try to analyze scanned/reclaimed ratio. So the window is used as a* rate-limit tunable for the "low" level notification, and also for Then Return
278  schedule_work - put work task in global workqueue*@work: job to be done* Returns %false if @work was already on the kernel-global workqueue and* %true otherwise
279  Else
283  If Not memcg || memcg == root_mem_cgroup Then Return
286  spin_lock( & The lock is used to keep the scanned/reclaimed above in sync. )
287  scanned = scanned += scanned
288  reclaimed = reclaimed += reclaimed
291  Return
293  scanned = reclaimed = 0
294  spin_unlock( & The lock is used to keep the scanned/reclaimed above in sync. )
296  level = vmpressure_calc_level(scanned, reclaimed)
298  If level > VMPRESSURE_LOW Then
Caller
NameDescribe
shrink_node
vmpressure_priovmpressure_prio() - Account memory pressure through reclaimer priority level*@gfp: reclaimer's gfp mask*@memcg: cgroup memory controller handle*@prio: reclaimer's priority* This function should be called from the reclaim path every time when