Re: [PATCH] lib/raid6: Replace custom zero page with ZERO_PAGE

From: Herbert Xu
Date: Sun Mar 16 2025 - 01:52:10 EST


On Sat, Mar 15, 2025 at 09:06:31PM -0700, Andrew Morton wrote:
>
> 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.

OK I can do that.

> 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?

The only spots that can hand this off to DMA are:

crypto/async_tx/async_pq.c: srcs[i] = (void*)raid6_empty_zero_page;
crypto/async_tx/async_raid6_recov.c: ptrs[i] = (void *) raid6_empty_zero_page;
crypto/async_tx/async_raid6_recov.c: ptrs[i] = (void*)raid6_empty_zero_page;

But they all turn out to be synchronous fallback code paths that
do not involve DMA at all.

Cheers,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt