Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:mem_cgroup_resize_max

Proto:static int mem_cgroup_resize_max(struct mem_cgroup *memcg, unsigned long max, bool memsw)

Type:int

Parameter:

TypeParameterName
struct mem_cgroup *memcg
unsigned longmax
boolmemsw
2992  bool enlarge = false
2993  bool drained = false
2996  counter = If memsw Then Legacy consumer-oriented counters Else Accounted resources
2998  Do
3000  ret = -EINTR
3001  Break
3004  mutex_lock( & memcg_max_mutex)
3009  limits_invariant = If memsw Then max >= max Else max <= max
3011  If Not limits_invariant Then
3013  ret = -EINVAL
3014  Break
3016  If max > max Then enlarge = true
3018  ret = page_counter_set_max - set the maximum number of pages allowed*@counter: counter*@nr_pages: limit to set* Returns 0 on success, -EBUSY if the current number of pages on the* counter already exceeds the specified limit.
3019  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
3021  If Not ret Then Break
3024  If Not drained Then
3026  drained = true
3027  Continue
3032  ret = -EBUSY
3033  Break
3035  When (true) cycle
3037  If Not ret && enlarge Then memcg_oom_recover(memcg)
3040  Return ret
Caller
NameDescribe
mem_cgroup_writeThe user of this function is...* RES_LIMIT.