[PATCH 03/14] arm64/fpsimd: Remove redundant clearing of TIF_SVE
Mark Brown
broonie at kernel.org
Tue Apr 8 07:53:29 PDT 2025
On Tue, Apr 08, 2025 at 02:03:39PM +0100, Mark Rutland wrote:
> Yes; we really must handle this consistently at the point the allocation
> fails. It's rather annoying that unchecked allocations got introduced
> since commit:
> 7559b7d7d651d397d ("arm64/sve: Better handle failure to allocate SVE register storage")
> ... since after that point we really should have known better.
Yes, indeed. That whole API being written the way it is really helps
nothing here, we should have a return value we check directly on the
function.
> TBH, I don't think we should *ever* change the stored representation as
> a result of failing to allocate memory. We should be able to allocate
> the new buffer before freeing the old one, and if we cannot allocate the
> new buffer we can return -ENOMEM without discarding the old state.
That's probably the one thing we can do consistently. There are the
cases where we're only doing the allocation as an optimisation but I've
never been able to convince myself it's worth the complexity.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20250408/d6cf349a/attachment.sig>
More information about the linux-arm-kernel
mailing list