linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* node_pagecache_reclaimable() seems not accurate
@ 2020-01-17  6:44 Hao Lee
  0 siblings, 0 replies; only message in thread
From: Hao Lee @ 2020-01-17  6:44 UTC (permalink / raw)
  To: linux-mm

Hi, I have found the node_pagecache_reclaimable() function can't calculate
reclaimable pages accurately.

If reclaim mode doesn't allow UNMAP and WRITE operations, this function will
perform the following calculation:

reclaimable file pages = total unmapped file pages - vm_stat[NR_FILE_DIRTY]

If NR_FILE_DIRTY only counts unmapped dirty pages, the result will be
unmapped clean pages. This indeed makes sense.

However, I find vm_stat[NR_FILE_DIRTY] also counts some *mapped* dirty
pages. If we subtract these mapped pages from unmapped pages, I don't
think this is reasonable.

This code path can account dirty pages into NR_FILE_DIRTY:

account_page_dirtied+0x0/0x2d8
mark_buffer_dirty+0x16c/0x1a0
__block_commit_write.isra.11+0xa8/0xf0
block_write_end+0x58/0xb0
generic_write_end+0x5c/0xc0
ext4_da_write_end+0x128/0x2e8 [ext4]
generic_perform_write+0x108/0x1a8
__generic_file_write_iter+0x158/0x1c8
ext4_file_write_iter+0x120/0x3e8 [ext4]
__vfs_write+0x11c/0x190
vfs_write+0xac/0x1c0
ksys_write+0x74/0xf0
__arm64_sys_write+0x24/0x30
el0_svc_common+0x78/0x130
el0_svc_handler+0x38/0x78
el0_svc+0x8/0xc

Regards,
Hao Lee


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-17  6:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17  6:44 node_pagecache_reclaimable() seems not accurate Hao Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox