Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\readahead.c Create Date:2022-07-28 14:12:06
Last Modify:2020-03-17 21:13:07 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:page cache context based read-ahead

Proto:static int try_context_readahead(struct address_space *mapping, struct file_ra_state *ra, unsigned long offset, unsigned long req_size, unsigned long max)

Type:int

Parameter:

TypeParameterName
struct address_space *mapping
struct file_ra_state *ra
unsigned longoffset
unsigned longreq_size
unsigned longmax
355  size = Count contiguously cached pages from @offset-1 to @offset-@max,* this count is a conservative estimation of* - length of the sequential read sequence, or* - thrashing threshold in memory tight systems
361  If size <= req_size Then Return 0
368  If size >= offset Then size *= 2
371  where readahead started = offset
372  # of readahead pages = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(size + req_size, max)
373  do asynchronous readahead whenthere are only # of pages ahead = 1
375  Return 1
Caller
NameDescribe
ondemand_readaheadA minimal readahead algorithm for trivial sequential/random reads.