RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y
authorVincent Chen <vincentc@andestech.com>
Thu, 3 Jan 2019 03:32:33 +0000 (11:32 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Wed, 23 Jan 2019 20:56:19 +0000 (12:56 -0800)
commit99fd6e875d0c24448a5e2c241422a691be46b241
tree4b253b38db1d5a3653ef38fd01d3fb0599c877de
parent49a57857aeea06ca831043acbb0fa5e0f50602fd
RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y

The cond_resched() can be used to yield the CPU resource if
CONFIG_PREEMPT is not defined. Otherwise, cond_resched() is a dummy
function. In order to avoid kernel thread occupying entire CPU,
when CONFIG_PREEMPT=y, the kernel thread needs to follow the
rescheduling mechanism like a user thread.

Signed-off-by: Vincent Chen <vincentc@andestech.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/asm-offsets.c
arch/riscv/kernel/entry.S