Subject: [PATCH 2/2] powerpc: Large user copy aware of full:rt:lazy preemption
From: Shrikanth Hegde <[email-masked]>
Date: Sun, 17 Nov 2024 00:53:06 +0530

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.

Not checking for lazy bit here, since it could lead to unnecessary
context switches.

Suggested-by: Sebastian Andrzej Siewior <[email-masked]>
Signed-off-by: Shrikanth Hegde <[email-masked]>
Signed-off-by: Madhavan Srinivasan <[email-masked]>
Link: https://patch.msgid.link/[email-masked]
Signed-off-by: Sebastian Andrzej Siewior <[email-masked]>
---
 arch/powerpc/lib/vmx-helper.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/lib/vmx-helper.c
+++ b/arch/powerpc/lib/vmx-helper.c
@@ -45,7 +45,7 @@ int exit_vmx_usercopy(void)
 	 * set and we are preemptible. The hack here is to schedule a
 	 * decrementer to fire here and reschedule for us if necessary.
 	 */
-	if (IS_ENABLED(CONFIG_PREEMPT) && need_resched())
+	if (IS_ENABLED(CONFIG_PREEMPTION) && need_resched())
 		set_dec(1);
 	return 0;
 }