Thread (9 messages) 9 messages, 4 authors, 2024-11-15

Re: [PATCH] powerpc: Add preempt lazy support

From: Shrikanth Hegde <hidden>
Date: 2024-11-15 07:04:33


On 11/14/24 07:31, Michael Ellerman wrote:
Shrikanth Hegde [off-list ref] writes:
quoted
Thank you Sebastian for taking a look and rwb tag.
quoted
On 2024-11-08 15:48:53 [+0530], Shrikanth Hegde wrote:
quoted
Define preempt lazy bit for Powerpc. Use bit 9 which is free and within
16 bit range of NEED_RESCHED, so compiler can issue single andi.

Since Powerpc doesn't use the generic entry/exit, add lazy check at exit
to user. CONFIG_PREEMPTION is defined for lazy/full/rt so use it for
return to kernel.

Ran a few benchmarks and db workload on Power10. Performance is close to
preempt=none/voluntary. It is possible that some patterns would
differ in lazy[2]. More details of preempt lazy is here [1]

Since Powerpc system can have large core count and large memory,
preempt lazy is going to be helpful in avoiding soft lockup issues.

[1]: https://lore.kernel.org/lkml/20241007074609.447006177@infradead.org/ (local)
[2]: https://lore.kernel.org/all/1a973dda-c79e-4d95-935b-e4b93eb077b8@linux.ibm.com/ (local)
The lazy bits are only in tip.
I have added change suggested by sebastian. I think it makes sense since 
the large user copy using vmx could take sometime and in preemptible 
kernel it needs to resched as soon as possible. However i am not making 
it consider lazy since it would lead to quite a bit of context switches 
which is not necessary.

-       if (IS_ENABLED(CONFIG_PREEMPT) && need_resched())
+       if (IS_ENABLED(CONFIG_PREEMPTION) && need_resched())
                 set_dec(1);
         return 0;

quoted
Hi Michael, I sent it to powerpc tree since all the changes were in
arch/powerpc. Please let me know if i have send it to tip tree instead.
I think I'd like it to have a full cycle of testing in next before going
into mainline. So I'll plan to take this via the powerpc tree for the
next cycle.
Make sense.
I assume you haven't tested 32-bit at all?
Yes, 32 bit isn't tested.  it would be better if it goes through  a test 
cycle. I will send out v2 soon.
cheers
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help