[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250315210631.d79637b9c55c7ee3287aa426@linux-foundation.org>
Date: Sat, 15 Mar 2025 21:06:31 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>, Song Liu
<song@...nel.org>, Yu Kuai <yukuai3@...wei.com>, linux-raid@...r.kernel.org
Subject: Re: [PATCH] lib/raid6: Replace custom zero page with ZERO_PAGE
On Sat, 15 Mar 2025 16:06:22 +0800 Herbert Xu <herbert@...dor.apana.org.au> wrote:
> Use the system-wide zero page instead of a custom zero page.
>
I'll assume the MD maintainers will process this.
> --- a/include/linux/raid/pq.h
> +++ b/include/linux/raid/pq.h
> @@ -11,8 +11,9 @@
> #ifdef __KERNEL__
>
> #include <linux/blkdev.h>
> +#include <linux/mm.h>
>
> -extern const char raid6_empty_zero_page[PAGE_SIZE];
> +#define raid6_empty_zero_page ((const char *)page_address(ZERO_PAGE(0)))
This will of course meet the aligned(256) requirement.
I do think it would be nicer to write this as a real inlined C function
and to convert usage sites to raid6_empty_zero_page(). IOW, let's tell
the truth rather than pretending that raid6_empty_zero_page is a global
variable.
> #else /* ! __KERNEL__ */
> /* Used for testing in user space */
> diff --git a/lib/raid6/algos.c b/lib/raid6/algos.c
> index cd2e88ee1f14..03f1a8c179f7 100644
> --- a/lib/raid6/algos.c
> +++ b/lib/raid6/algos.c
> @@ -18,9 +18,6 @@
> #else
> #include <linux/module.h>
> #include <linux/gfp.h>
> -/* In .bss so it's zeroed */
> -const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
> -EXPORT_SYMBOL(raid6_empty_zero_page);
> #endif
Is there any possibility that the MD drivers will point DMA hardware at
the global zero page, thereby invalidating that page from CPU caches in
some manner?
Powered by blists - more mailing lists