Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf-tools/readahead: Fix low page usage count since v5.15 #5257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

B106Roger
Copy link

Since Linux 5.15, mark_page_accessed is no longer called in filemap_read, which causes increased counts of unused page cache.
(For more detail, please refers to mark_page_accessed in Linux Patch1 and filemap_read in Linux Patch2.)

This patch attempts to attach mark_accessed to folio_mark_accessed if it is available; otherwise, it falls back to using mark_page_accessed.

Linux Patch1: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76580b65
Linux Patch2: torvalds/linux@6020c20#diff-6f046052d9af59ceb36616faffd8b1920c28195619803cfdb25df7271200ba5e

Since Linux 5.15, `mark_page_accessed` is no longer called in
`filemap_read`, which causes increased counts of unused page cache.

This patch attempts to attach `mark_accessed` to `folio_mark_accessed`
if it is available; otherwise, it falls back to using
`mark_page_accessed`.

Signed-off-by: B106Roger <[email protected]>
SEC("fentry/folio_mark_accessed")
int BPF_PROG(folio_mark_accessed, struct folio *folio)
{
mark_accessed(&folio->page);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'return mark_accessed(&folio->page)'? Similar issue below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants