]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: assembler: add cond_yield macro
authorArd Biesheuvel <ardb@kernel.org>
Wed, 3 Feb 2021 11:36:18 +0000 (12:36 +0100)
committerWill Deacon <will@kernel.org>
Wed, 3 Feb 2021 20:48:02 +0000 (20:48 +0000)
commit28f07d962f389bb70ed87d07e2768cd904357d6f
tree1460b7bd70176eefcf74869c55d31e15908e4535
parent703b4aaeda226c411ae7e592fdcf61efe00c01a0
arm64: assembler: add cond_yield macro

Add a macro cond_yield that branches to a specified label when called if
the TIF_NEED_RESCHED flag is set and decreasing the preempt count would
make the task preemptible again, resulting in a schedule to occur. This
can be used by kernel mode SIMD code that keeps a lot of state in SIMD
registers, which would make chunking the input in order to perform the
cond_resched() check from C code disproportionately costly.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210203113626.220151-2-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/assembler.h