Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page-writeback.c Create Date:2022-07-28 14:10:41
Last Modify:2022-05-23 13:25:58 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alance_dirty_pages_ratelimited - balance dirty memory state*@mapping: address_space which was dirtied* Processes which are dirtying memory should call in here once for each page* which was newly dirtied. The function will periodically check the system's

Proto:void balance_dirty_pages_ratelimited(struct address_space *mapping)

Type:void

Parameter:

TypeParameterName
struct address_space *mapping
1866  inode = host
1867  bdi = inode_to_bdi(inode)
1868  struct bdi_writeback * wb = NULL
1872  If Not bdi_cap_account_dirty(bdi) Then Return
1875  If inode_cgwb_enabled(inode) Then wb = wb_get_create_current(bdi, GFP_KERNEL)
1877  If Not wb Then wb = the root writeback info for this bdi
1880  ratelimit = nr_dirtied_pause
1881  If dirty_exceeded Then ratelimit = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(ratelimit, 32 >> (PAGE_SHIFT determines the page size - 10))
1884  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
1891  p = this_cpu_ptr( & bdp_ratelimits)
1892  If Value for the false possibility is greater at compile time(nr_dirtied >= ratelimit) Then p = 0
1894  Else if Value for the false possibility is greater at compile time( * p >= After a CPU has dirtied this many pages, balance_dirty_pages_ratelimited* will look to see if it needs to force writeback or throttling.) Then
1895  p = 0
1896  ratelimit = 0
1903  p = this_cpu_ptr( & Normal tasks are throttled by* loop {* dirty tsk->nr_dirtied_pause pages;* take a snap in balance_dirty_pages();* }* However there is a worst case)
1904  If p > 0 && nr_dirtied < ratelimit Then
1906  nr_pages_dirtied = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value( * p, ratelimit - nr_dirtied)
1907  p -= nr_pages_dirtied
1908  nr_dirtied += nr_pages_dirtied
1910  preempt_enable()
1912  If Value for the false possibility is greater at compile time(nr_dirtied >= ratelimit) Then alance_dirty_pages() must be called by processes which are generating dirty* data
1915  wb_put(wb)
Caller
NameDescribe
fault_dirty_shared_pageHandle dirtying of a page in shared file mapping on a write fault.* The function expects the page to be locked and unlocks it.
iomap_write_actor
iomap_unshare_actor