Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:page_idle_bitmap_read

Proto:static ssize_t page_idle_bitmap_read(struct file *file, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t pos, size_t count)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
struct kobject *kobj
struct bin_attribute *attr
char *buf
loff_tpos
size_tcount
125  out = buf
130  If pos % BITMAP_CHUNK_SIZE || count % BITMAP_CHUNK_SIZE Then Return -EINVAL
133  pfn = pos * BITS_PER_BYTE
134  If pfn >= max_pfn Then Return 0
137  end_pfn = pfn + count * BITS_PER_BYTE
138  If end_pfn > max_pfn Then end_pfn = max_pfn
141  When pfn < end_pfn cycle
142  bit = pfn % BITMAP_CHUNK_BITS
143  If Not bit Then out = 0ULL
145  page = Idle page tracking only considers user memory pages, for other types of* pages the idle flag is always unset and an attempt to set it is silently* ignored
146  If page Then
147  If page_is_idle(page) Then
154  If page_is_idle(page) Then out |= 1ULL << bit
159  If bit == BITMAP_CHUNK_BITS - 1 Then out++
161  cond_resched()
163  Return out - buf