All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	 Aditya Gupta <adityag@linux.ibm.com>,
	Alexander Graf <graf@amazon.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	 Baoquan He <baoquan.he@linux.dev>,
	"Christophe Leroy (CS GROUP)" <chleroy@kernel.org>,
	 Hari Bathini <hbathini@linux.ibm.com>,
	 Madhavan Srinivasan <maddy@linux.ibm.com>,
	Mahesh Salgaonkar <mahesh@linux.ibm.com>,
	 Michael Ellerman <mpe@ellerman.id.au>,
	 Mike Rapoport <rppt@kernel.org>,
	 Nicholas Piggin <npiggin@gmail.com>,
	 Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	 "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>,
	 Shivang Upadhyay <shivangu@linux.ibm.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	 kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
	Michal Clapinski <mclapinski@google.com>
Subject: Re: [RFC PATCH 3/3] powerpc/kho: exclude THP and HUGETLB_PAGE
Date: Fri, 21 Aug 2026 13:34:48 +0200	[thread overview]
Message-ID: <2vxzecfrzoyv.fsf@kernel.org> (raw)
In-Reply-To: <20260821105609.983622-4-sourabhjain@linux.ibm.com> (Sourabh Jain's message of "Fri, 21 Aug 2026 16:26:09 +0530")

On Fri, Aug 21 2026, Sourabh Jain wrote:

> Enabling CONFIG_KEXEC_HANDOVER together with CONFIG_TRANSPARENT_HUGEPAGE
> or CONFIG_HUGETLB_PAGE on powerpc fails to build:
>
>     kernel/liveupdate/kexec_handover.c:49:39: error: expression in static assertion is not constant
>        49 | static_assert(SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES);
>     ./include/linux/build_bug.h:80:56: note: in definition of macro '__static_assert'
>        80 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
>           |                                                        ^~~~
>     kernel/liveupdate/kexec_handover.c:49:1: note: in expansion of macro 'static_assert'
>        49 | static_assert(SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES);
>
> CMA_MIN_ALIGNMENT_BYTES is derived from pageblock_order, which on
> powerpc is not a compile-time constant when THP or HUGETLB_PAGE is
> enabled -- powerpc can determine huge page size at runtime in that
> configuration, so pageblock_order becomes a variable rather than a
> constant expression. KHO's static_assert() on
> SCRATCH_ALIGNMENT_BYTES >= CMA_MIN_ALIGNMENT_BYTES then fails to
> compile, since it requires both sides to be constant expressions.
>
> Until CMA_MIN_ALIGNMENT_BYTES (or KHO's use of it) is made to handle
> the non-constant pageblock_order case on powerpc, exclude
> TRANSPARENT_HUGEPAGE and HUGETLB_PAGE from ARCH_SUPPORTS_KEXEC_HANDOVER
> so the two can't be enabled together and hit this build failure.

This should be a part of patch 2 I think. It is not a good idea to break
the build in one patch and fix it in the next.

That said, this is a debug check of sorts since SCRATCH_ALIGNMENT_BYTES
is of MAX_ORDER_NR_PAGES, and pageblocks _should_ always be smaller of
equal to this.

Anyway, I don't think this is something you should gate by a config. I
think you should either remove the static_assert(), or turn it into a
runtime check.

+Cc Michal.

>
> Cc: Aditya Gupta <adityag@linux.ibm.com>
> Cc: Alexander Graf <graf@amazon.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Baoquan He <baoquan.he@linux.dev>
> Cc: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
> Cc: Hari Bathini <hbathini@linux.ibm.com>
> Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
> Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Mike Rapoport <rppt@kernel.org>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
> Cc: Pratyush Yadav <pratyush@kernel.org>
> Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> Cc: Shivang Upadhyay <shivangu@linux.ibm.com>
> Cc: Shrikanth Hegde <sshegde@linux.ibm.com>
> Cc: kexec@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> ---
>  arch/powerpc/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index 61350d3e7a19..f68b9fc883ba 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -720,6 +720,7 @@ config ARCH_SUPPORTS_KEXEC_HANDOVER
>  	def_bool y
>  	depends on PPC64
>  	depends on !CRASH_DUMP
> +	depends on !TRANSPARENT_HUGEPAGE && !HUGETLB_PAGE
>  
>  config ARCH_SUPPORTS_CRASH_HOTPLUG
>  	def_bool y

-- 
Regards,
Pratyush Yadav


  reply	other threads:[~2026-08-21 11:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 10:56 [RFC PATCH 0/3] powerpc: initial support for Kexec HandOver (KHO) Sourabh Jain
2026-08-21 10:56 ` [RFC PATCH 1/3] kernel/liveupdate: make KEXEC_HANDOVER depend on KEXEC_FILE instead of selecting it Sourabh Jain
2026-08-21 10:56 ` [RFC PATCH 2/3] powerpc: add support for Kexec HandOver (KHO) Sourabh Jain
2026-08-21 11:56   ` Pratyush Yadav
2026-08-23 15:41     ` Sourabh Jain
2026-09-02 10:34       ` Pratyush Yadav
2026-09-04 14:50         ` Sourabh Jain
2026-09-04 16:22           ` Pratyush Yadav
2026-09-06 10:47             ` Mike Rapoport
2026-09-06 15:32             ` Sourabh Jain
2026-08-26 13:33     ` Sourabh Jain
2026-08-21 10:56 ` [RFC PATCH 3/3] powerpc/kho: exclude THP and HUGETLB_PAGE Sourabh Jain
2026-08-21 11:34   ` Pratyush Yadav [this message]
2026-08-23 13:52     ` Sourabh Jain

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=2vxzecfrzoyv.fsf@kernel.org \
    --to=pratyush@kernel.org \
    --cc=adityag@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=baoquan.he@linux.dev \
    --cc=chleroy@kernel.org \
    --cc=graf@amazon.com \
    --cc=hbathini@linux.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mclapinski@google.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=pasha.tatashin@soleen.com \
    --cc=ritesh.list@gmail.com \
    --cc=rppt@kernel.org \
    --cc=shivangu@linux.ibm.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=sshegde@linux.ibm.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.