Re: [PATCH 01/25] xor: assert that xor_blocks is not called from interrupt context

Christoph Hellwig
2026-03-04T15:07:15Z

On Wed, Mar 04, 2026 at 04:01:42PM +0100, Heiko Carstens wrote:
> > Because of that CPU feature check, I don't think
> > "WARN_ON_ONCE(!may_use_simd())" would actually be correct here.
> >
> > How about "WARN_ON_ONCE(!preemptible())"? I think that covers the union
> > of the context restrictions correctly. (Compared to in_task(), it
> > handles the cases where hardirqs or softirqs are disabled.)
>
> I guess, this is not true, since there is at least one architecture which
> allows to run simd code in interrupt context (but which missed to implement
> may_use_simd()).

I'd rather have a strict upper limit that is generally applicable.
Currently there is no non-task user of this code, and while maybe doing
XOR recovery for tiny blocks from irq context would be nice, let's defer
that until we need it. There is much bigger fish to fry in terms of
raid performance at the moment.