-
由 Ard Biesheuvel 提交于
mainline inclusion from mainline-v5.12-rc1 commit d13c613f category: bugfix bugzilla: 172149 https://gitee.com/openeuler/kernel/issues/I4CZ7H CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d13c613f136c ----------------------------------------------- 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: NArd Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20210203113626.220151-2-ardb@kernel.orgSigned-off-by: NWill Deacon <will@kernel.org> Signed-off-by: NWei Li <liwei391@huawei.com> Reviewed-by: NJason Yan <yanaijie@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NChen Jun <chenjun102@huawei.com> Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
7c8417dd