Thread (40 messages) 40 messages, 3 authors, 2026-03-24

Re: [PATCH 04/15] powerpc/time: Prepare to stop elapsing in dynticks-idle

From: Shrikanth Hegde <hidden>
Date: 2026-02-26 04:07:57
Also in: linux-pm, linux-s390, lkml


On 2/25/26 11:29 PM, Christophe Leroy (CS GROUP) wrote:

Le 25/02/2026 à 18:47, Shrikanth Hegde a écrit :
quoted
Hi Christophe.
quoted
I think I'm starting to understand now.

I think the problem is that acct->starttime has an invalid value the 
very first time it is used.

We are probably lacking an initial value in paca->accounting.starttime.
This should likely be initialised from mftb in head_64.S in 
start_here_common for main CPU and __secondary_start for other CPUs 
or maybe at higher level in C in setup_arch() and start_secondary()

Christophe
How about below? this works too.
Fine it is works, it means we found the real problem.

What about using the newly added vtime_reset() ? See below (untested)
Thanks Christophe for helping.

This works too. vtime_reset does the exact same thing.
Let me write a changelog and a comment on vtime_reset and send it.
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 9b3167274653..f4aef85106ac 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -377,7 +377,6 @@ void vtime_task_switch(struct task_struct *prev)
      }
  }

-#ifdef CONFIG_NO_HZ_COMMON
  /**
   * vtime_reset - Fast forward vtime entry clocks
   *
@@ -394,6 +393,7 @@ void vtime_reset(void)
  #endif
  }

+#ifdef CONFIG_NO_HZ_COMMON
  /**
   * vtime_dyntick_start - Inform vtime about entry to idle-dynticks
   *
@@ -931,6 +931,7 @@ static void __init set_decrementer_max(void)
  static void __init init_decrementer_clockevent(void)
  {
      register_decrementer_clockevent(smp_processor_id());
+    vtime_reset();
  }

  void secondary_cpu_time_init(void)
@@ -946,6 +947,7 @@ void secondary_cpu_time_init(void)
      /* FIME: Should make unrelated change to move snapshot_timebase
       * call here ! */
      register_decrementer_clockevent(smp_processor_id());
+    vtime_reset();
  }

  /*
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help