Re: [PATCH] RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y

2019-01-23 Thread Vincent Chen
On Wed, Jan 23, 2019 at 02:58:51AM +0800, Palmer Dabbelt wrote: > On Wed, 02 Jan 2019 21:45:55 PST (-0800), li...@roeck-us.net wrote: > > On Thu, Jan 03, 2019 at 11:32:33AM +0800, Vincent Chen wrote: > >> The cond_resched() can be used to yield the CPU resource if > >> CONFIG_PREEMPT is not

Re: [PATCH] RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y

2019-01-22 Thread Palmer Dabbelt
On Wed, 02 Jan 2019 21:45:55 PST (-0800), li...@roeck-us.net wrote: On Thu, Jan 03, 2019 at 11:32:33AM +0800, Vincent Chen wrote: 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

Re: [PATCH] RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y

2019-01-02 Thread Guenter Roeck
On Thu, Jan 03, 2019 at 11:32:33AM +0800, Vincent Chen wrote: > 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

[PATCH] RISC-V: Add _TIF_NEED_RESCHED check for kernel thread when CONFIG_PREEMPT=y

2019-01-02 Thread Vincent Chen
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.