Boots and seems to work with PREEMPT enabled

Anton Ivanov anton.ivanov at kot-begemot.co.uk
Wed Sep 20 06:02:09 PDT 2023



On 20/09/2023 13:30, Anton Ivanov wrote:
> 
> 
> On 20/09/2023 12:14, Anton Ivanov wrote:
>> Added support for kernel side fpu store/restore and real kernel_fpu_begin/kernel_fpu_end using gcc intrinsics. Enabled PREEMPT.
>>
>> It boots and seems to be alive and kicking. I do not notice any significant effect on performance either.
>>
> 
> I take my words back - I was testing with VOLUNTARY which seems to provide a difference withing the margin of error.
> 
> Enabling forced preemption drops the time for
> 
> find /usr -type f -exec cat {} > /dev/null \;
> 
> from
> 
> real    19m11.207s
> user    0m0.180s
> sys    2m41.160s
> 
> to
> 
> real    3m13.647s
> user    0m0.000s
> sys    2m58.270s
> 
> And boot time from 11.5s to 6s.
> 
> It did complain on shutdown though with some traces. Nothing while running.

The complaint I get is from here: https://elixir.bootlin.com/linux/v6.6-rc2/source/kernel/sched/core.c#L5229

This looks broken for UP. On UP the preempt count is not inc-ed twice, because the UP version of _raw_spin_lock_irq does not touch it, hence it is odd, not even.

Other than that it all works. Some decrease in total network throughput (expected), serious increase in userspace responsiveness (more than expected). No crashes.

This leaves opened two questions:

1. Do we do anything about this one
2. How do we enable preemption for voluntary.

> 
> The patch will hit the mailing list shortly.
> 
> 
>> How do I test it from here onwards?
> 
> The question still stands. Can we use anything as a specific test suite? It is not an area I am familiar with, so any pointers will be welcome.
> 
>>
>> I am happy to throw the patches on the list as an RFC, though I would prefer to test first :)
>>
> 

-- 
Anton R. Ivanov
https://www.kot-begemot.co.uk/



More information about the linux-um mailing list