All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Zhiquan Li <zhiquan1.li@intel.com>,
	k-hagio-ab@nec.com, yamazaki-msmt@nec.com, lijiang@redhat.com,
	ltao@redhat.com
Cc: akpm@linux-foundation.org, vgoyal@redhat.com, dyoung@redhat.com,
	kirill.shutemov@linux.intel.com, kexec@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 RESEND] crash: Export PAGE_UNACCEPTED_MAPCOUNT_VALUE to vmcoreinfo
Date: Thu, 3 Apr 2025 10:56:32 +0800	[thread overview]
Message-ID: <Z+344FNhxiMonoZb@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20250403030801.758687-1-zhiquan1.li@intel.com>

Add makedumpfile/Crash utilities maintainers to let them know.

On 04/03/25 at 11:08am, Zhiquan Li wrote:
> On Intel TDX guest, unaccepted memory is unusable free memory which is
> not managed by buddy, until it's accepted by guest.  Before that, it
> cannot be accessed by the first kernel as well as the kexec'ed kernel.
> The kexec'ed kernel will skip these pages and fill in zero data for the
> reader of vmcore.
> 
> The dump tool like makedumpfile creates a page descriptor (size 24
> bytes) for each non-free page, including zero data page, but it will not
> create descriptor for free pages.  If it is not able to distinguish
> these unaccepted pages with zero data pages, a certain amount of space
> will be wasted in proportion (~1/170).  In fact, as a special kind of
> free page the unaccepted pages should be excluded, like the real free
> pages.
> 
> Export the page type PAGE_UNACCEPTED_MAPCOUNT_VALUE to vmcoreinfo, so
> that dump tool can identify whether a page is unaccepted.
> 
> Link: https://lore.kernel.org/all/20240809114854.3745464-5-kirill.shutemov@linux.intel.com/
> 
> Signed-off-by: Zhiquan Li <zhiquan1.li@intel.com>
> Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>

Looks good to me.

Acked-by: Baoquan He <bhe@redhat.com>

> 
> ---
> Vmcore size statistic of a freshly booted TD VM with different memory
> sizes:
> 
>   VM.mem | Before  After
>   -------+----------------
>   512G   | ~4.9G   ~2.0G
>   256G   | ~2.0G   ~1.1G
> 
> Most of changes are done by makedumpfile, but the prerequisite is kernel
> needs to export an indicator to identify unaccepted pages in vmcoreinfo.
> 
> V2 RESEND note:
> - No changes on this, just rebasd to v6.14.
> 
> V1: https://lore.kernel.org/all/20250103074941.3651765-1-zhiquan1.li@intel.com/
> 
> Changes since V1:
> - Rebase to v6.14-rc5.
> - Added document into admin-guide/kdump/vmcoreinfo.rst per Dave's
>   suggestion.
> - Add Kirill's Reviewed-by tag.
> ---
>  Documentation/admin-guide/kdump/vmcoreinfo.rst | 2 +-
>  kernel/vmcore_info.c                           | 4 ++++
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/admin-guide/kdump/vmcoreinfo.rst b/Documentation/admin-guide/kdump/vmcoreinfo.rst
> index 0f714fc945ac..3b47916f1856 100644
> --- a/Documentation/admin-guide/kdump/vmcoreinfo.rst
> +++ b/Documentation/admin-guide/kdump/vmcoreinfo.rst
> @@ -331,7 +331,7 @@ PG_lru|PG_private|PG_swapcache|PG_swapbacked|PG_slab|PG_hwpoision|PG_head_mask|P
>  Page attributes. These flags are used to filter various unnecessary for
>  dumping pages.
>  
> -PAGE_BUDDY_MAPCOUNT_VALUE(~PG_buddy)|PAGE_OFFLINE_MAPCOUNT_VALUE(~PG_offline)
> +PAGE_BUDDY_MAPCOUNT_VALUE(~PG_buddy)|PAGE_OFFLINE_MAPCOUNT_VALUE(~PG_offline)|PAGE_OFFLINE_MAPCOUNT_VALUE(~PG_unaccepted)
>  -----------------------------------------------------------------------------
>  
>  More page attributes. These flags are used to filter various unnecessary for
> diff --git a/kernel/vmcore_info.c b/kernel/vmcore_info.c
> index 1fec61603ef3..e066d31d08f8 100644
> --- a/kernel/vmcore_info.c
> +++ b/kernel/vmcore_info.c
> @@ -210,6 +210,10 @@ static int __init crash_save_vmcoreinfo_init(void)
>  	VMCOREINFO_NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE);
>  #define PAGE_OFFLINE_MAPCOUNT_VALUE	(PGTY_offline << 24)
>  	VMCOREINFO_NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE);
> +#ifdef CONFIG_UNACCEPTED_MEMORY
> +#define PAGE_UNACCEPTED_MAPCOUNT_VALUE	(PGTY_unaccepted << 24)
> +	VMCOREINFO_NUMBER(PAGE_UNACCEPTED_MAPCOUNT_VALUE);
> +#endif
>  
>  #ifdef CONFIG_KALLSYMS
>  	VMCOREINFO_SYMBOL(kallsyms_names);
> 
> base-commit: 38fec10eb60d687e30c8c6b5420d86e8149f7557
> -- 
> 2.25.1
> 
> 



  reply	other threads:[~2025-04-03  2:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  3:08 [PATCH v2 RESEND] crash: Export PAGE_UNACCEPTED_MAPCOUNT_VALUE to vmcoreinfo Zhiquan Li
2025-04-03  2:56 ` Baoquan He [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-04  3:02 Zhiquan Li
2025-02-17  2:24 Zhiquan Li

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=Z+344FNhxiMonoZb@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dyoung@redhat.com \
    --cc=k-hagio-ab@nec.com \
    --cc=kexec@lists.infradead.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=lijiang@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ltao@redhat.com \
    --cc=vgoyal@redhat.com \
    --cc=yamazaki-msmt@nec.com \
    --cc=zhiquan1.li@intel.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.