From: Hao Lee <haolee.swjtu@gmail.com>
To: linux-mm@kvack.org
Subject: node_pagecache_reclaimable() seems not accurate
Date: Fri, 17 Jan 2020 06:44:14 +0000 [thread overview]
Message-ID: <20200117064414.GA22642@haolee.github.io> (raw)
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
reply other threads:[~2020-01-17 6:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200117064414.GA22642@haolee.github.io \
--to=haolee.swjtu@gmail.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.