Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_margin - calculate chargeable space of a memory cgroup*@memcg: the memory cgroup* Returns the maximum amount of memory @mem can be charged with, in* pages.

Proto:static unsigned long mem_cgroup_margin(struct mem_cgroup *memcg)

Type:unsigned long

Parameter:

TypeParameterName
struct mem_cgroup *memcg
1291  margin = 0
1295  count = page_counter_read( & Accounted resources )
1296  limit = READ_ONCE(max)
1297  If count < limit Then margin = limit - count
1300  If Whether legacy memory+swap accounting is active Then
1301  count = page_counter_read( & Legacy consumer-oriented counters )
1302  limit = READ_ONCE(max)
1303  If count <= limit Then margin = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(margin, limit - count)
1305  Else margin = 0
1309  Return margin
Caller
NameDescribe
try_charge