From: Stephen Brennan <stephen.s.brennan@oracle.com>
To: yamazaki-msmt@nec.com, k-hagio-ab@nec.com, kexec@lists.infradead.org
Cc: ltao@redhat.com
Subject: Re: [PATCH makedumpfile 7/9] Add PG_INCLUDE_HEAD extension return status
Date: Fri, 07 Aug 2026 09:24:16 -0700 [thread overview]
Message-ID: <87y0eh3nm7.fsf@oracle.com> (raw)
In-Reply-To: <20260714004550.3698175-8-stephen.s.brennan@oracle.com>
Stephen Brennan <stephen.s.brennan@oracle.com> writes:
> This allows an extension to request that only the head page of a
> compound page be included in the dump.
Hello Kazu,
Here's a more complete message which you can use to replace what's here:
---
Prior to patch "Do not call extensions for tail pages", extensions were
called for every page (including tail and head pages), yet their
decisions on tail pages were not respected when they conflicted with
makedumpfile's decision on the head page. Since that patch, we only call
extensions for head pages, and we use their decision for the entirety of
the compound page, which is at least consistent.
However, some extensions may want more fine-grained control. One such
policy may be to include only the head page, excluding tail pages. For
example, this is useful for an extension which includes just the first
page of ELF file headers within the page cache. Since page cache data
frequently uses larger folios, including just the head can avoid
unnecessary overhead.
So, add a new return status PG_INCLUDE_HEAD, which behaves as described,
including just the head of a compound page.
---
Thank you,
Stephen
> Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> ---
> extension.c | 2 +-
> extension.h | 7 ++++---
> makedumpfile.c | 9 +++++++++
> 3 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/extension.c b/extension.c
> index 9b29f0c..a7360d0 100644
> --- a/extension.c
> +++ b/extension.c
> @@ -314,7 +314,7 @@ int run_extension_callback(unsigned long pfn, const void *pcache, const struct p
> for (int i = 0; i < handle_cbs_len; i++) {
> if (handle_cbs[i]->cb) {
> result = handle_cbs[i]->cb(pfn, pcache, inf);
> - if (result == PG_INCLUDE) {
> + if (result == PG_INCLUDE || result == PG_INCLUDE_HEAD) {
> ret = result;
> goto out;
> } else if (result == PG_EXCLUDE) {
> diff --git a/extension.h b/extension.h
> index 22af9a6..3edfbeb 100644
> --- a/extension.h
> +++ b/extension.h
> @@ -4,9 +4,10 @@
>
> struct pginfo;
> enum {
> - PG_INCLUDE, // Exntesion will keep the page
> - PG_EXCLUDE, // Exntesion will discard the page
> - PG_UNDECID, // Exntesion makes no decision
> + PG_INCLUDE, // Extension will keep the full page
> + PG_INCLUDE_HEAD, // Extension will keep just the head page
> + PG_EXCLUDE, // Extension will discard the full page
> + PG_UNDECID, // Extension makes no decision
> };
> int run_extension_callback(unsigned long pfn, const void *pcache, const struct pginfo *i);
> void init_extensions(void);
> diff --git a/makedumpfile.c b/makedumpfile.c
> index f277360..69abb17 100644
> --- a/makedumpfile.c
> +++ b/makedumpfile.c
> @@ -6667,6 +6667,15 @@ check_order:
> * retained by an extension. */
> num_extension_retained += nr_pages;
> continue;
> + } else if (filter_pg == PG_INCLUDE_HEAD) {
> + num_extension_retained += 1;
> + if (nr_pages == 1)
> + continue;
> +
> + /* FALL THROUGH and exclude tail pages */
> + pfn++;
> + mem_map += SIZE(page);
> + nr_pages--;
> }
>
> /*
> --
> 2.47.3
next prev parent reply other threads:[~2026-08-07 16:24 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 0:45 [PATCH makedumpfile 0/9] Improvements to makedumpfile extensions, plus userspace stack tracing extension Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 1/9] Do not call extensions for tail pages Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 2/9] Honor CFLAGS in extension/Makefile Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 3/9] Share page information with extension callbacks Stephen Brennan
2026-08-12 4:01 ` Tao Liu
2026-07-14 0:45 ` [PATCH makedumpfile 4/9] Introduce a stat for pages retained by extension Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 5/9] Move page checks into makedumpfile.h Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 6/9] Simplify arguments for page checks Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 7/9] Add PG_INCLUDE_HEAD extension return status Stephen Brennan
2026-08-07 16:24 ` Stephen Brennan [this message]
2026-07-14 0:45 ` [PATCH makedumpfile 8/9] Add userstack extension Stephen Brennan
2026-07-14 0:45 ` [PATCH makedumpfile 9/9] Add elfheader extension Stephen Brennan
2026-08-03 15:55 ` [PATCH makedumpfile 0/9] Improvements to makedumpfile extensions, plus userspace stack tracing extension Stephen Brennan
2026-08-04 4:43 ` Tao Liu
2026-08-07 1:52 ` HAGIO KAZUHITO(萩尾 一仁)
2026-08-07 7:57 ` Tao Liu
2026-08-07 21:24 ` Stephen Brennan
2026-08-08 4:44 ` HAGIO KAZUHITO(萩尾 一仁)
2026-08-11 6:11 ` Tao Liu
2026-08-12 1:31 ` HAGIO KAZUHITO(萩尾 一仁)
2026-08-12 5:07 ` Tao Liu
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=87y0eh3nm7.fsf@oracle.com \
--to=stephen.s.brennan@oracle.com \
--cc=k-hagio-ab@nec.com \
--cc=kexec@lists.infradead.org \
--cc=ltao@redhat.com \
--cc=yamazaki-msmt@nec.com \
/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.