The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] lib/raid6: Replace custom zero page with ZERO_PAGE
@ 2025-03-15  8:06 Herbert Xu
  2025-03-16  4:06 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2025-03-15  8:06 UTC (permalink / raw)
  To: Andrew Morton, Linux Kernel Mailing List, Song Liu, Yu Kuai,
	linux-raid

Use the system-wide zero page instead of a custom zero page.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index 98030accf641..1460c15dea63 100644
--- 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)))
 
 #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
 
 struct raid6_calls raid6_call;
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-16  6:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-15  8:06 [PATCH] lib/raid6: Replace custom zero page with ZERO_PAGE Herbert Xu
2025-03-16  4:06 ` Andrew Morton
2025-03-16  5:51   ` Herbert Xu
2025-03-16  6:33     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox