[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [REGRESSION][BISECTED] Long boot time with Xen HVM guests during PV spinlock initialization



On Tue, Jun 09 2026 at 11:27, Teddy Astie wrote:
> Le 08/06/2026 à 17:15, Thomas Gleixner a écrit :
>>   struct clocksource * __init __weak clocksource_default_clock(void)
>>   {
>> +    clocksource_register(&clocksource_jiffies);
>>      return &clocksource_jiffies;
>>   }
>>   
>> 
>> 
>
> Hmm, there's a case where clocksource_mutex gets taken twice (both in 
> __clocksource_register_scale() (through clocksource_register()) and 
> clocksource_done_booting()).

Bah.

> What about making clocksource_jiffies gain ->enable() to setup what ever 
> needs to be (like calling __clocksource_update_freq_scale()) ?

Doesn't work either.

Updated version below. It's not pretty, but it should cure your
problem. If that's confirmed I think about a less ugly solution.

Thanks,

        tglx
---
--- a/kernel/time/jiffies.c
+++ b/kernel/time/jiffies.c
@@ -60,15 +60,14 @@ EXPORT_SYMBOL(get_jiffies_64);
 
 EXPORT_SYMBOL(jiffies);
 
-static int __init init_jiffies_clocksource(void)
-{
-       return __clocksource_register(&clocksource_jiffies);
-}
-
-core_initcall(init_jiffies_clocksource);
+static bool cs_jiffies_registered __initdata;
 
 struct clocksource * __init __weak clocksource_default_clock(void)
 {
+       if (!cs_jiffies_registered) {
+               __clocksource_register(&clocksource_jiffies);
+               cs_jiffies_registered = true;
+       }
        return &clocksource_jiffies;
 }
 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.