Re: [PATCH v2 2/2] powerpc: Large user copy aware of full:rt:lazy preemption
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2024-11-20 08:03:15
Also in:
lkml
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2024-11-20 08:03:15
Also in:
lkml
On 2024-11-19 13:08:31 [-0800], Ankur Arora wrote:
Shrikanth Hegde [off-list ref] writes:quoted
Large user copy_to/from (more than 16 bytes) uses vmx instructions to speed things up. Once the copy is done, it makes sense to try schedule as soon as possible for preemptible kernels. So do this for preempt=full/lazy and rt kernel.Note that this check will also fire for PREEMPT_DYNAMIC && preempt=none. So when power supports PREEMPT_DYNAMIC this will need to change to preempt_model_*() based checks.quoted
Not checking for lazy bit here, since it could lead to unnecessary context switches.Maybe: Not checking for lazy bit here, since we only want to schedule when a context switch is imminently required.
Isn't his behaviour here exactly what preempt_enable() would do? If the LAZY bit is set, it is delayed until return to userland or an explicit schedule() because it is done. If this LAZY bit turned into an actual scheduling request then it is acted upon. Sebastian