Re: [PATCH] mm/page_alloc: Work around a pahole limitation with zero-sized struct pagesets

From: Christoph Hellwig
Date: Thu May 27 2021 - 04:05:14 EST


On Wed, May 26, 2021 at 09:07:41AM +0100, Mel Gorman wrote:
> + !defined(CONFIG_DEBUG_LOCK_ALLOC) && \
> + !defined(CONFIG_PAHOLE_HAS_ZEROSIZE_PERCPU_SUPPORT)
> + /*
> + * pahole 1.21 and earlier gets confused by zero-sized per-CPU
> + * variables and produces invalid BTF. Ensure that
> + * sizeof(struct pagesets) != 0 for older versions of pahole.
> + */
> + char __pahole_hack;
> + #warning "pahole too old to support zero-sized struct pagesets"
> +#endif

Err, hell no. We should not mess up the kernel for broken tools that
are not relevant to the kernel build itself ever.