[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANDhNCrShVYQ4OXPVq9MAFGZhGqZ1-yEPpe_aCTpWCBRLE2XTA@mail.gmail.com>
Date: Thu, 24 Oct 2024 14:29:38 -0700
From: John Stultz <jstultz@...gle.com>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>
Cc: Frederic Weisbecker <frederic@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Miroslav Lichvar <mlichvar@...hat.com>, Richard Cochran <richardcochran@...il.com>,
Christopher S Hall <christopher.s.hall@...el.com>
Subject: Re: [PATCH v2 12/25] timekeeping: Add struct tk_data as argument to timekeeping_update()
On Wed, Oct 9, 2024 at 1:29 AM Anna-Maria Behnsen
<anna-maria@...utronix.de> wrote:
>
> From: Anna-Maria Behnsen <anna-maria@...utronix.de>
>
> Updates of the timekeeper are done in two ways:
>
> 1. Updating timekeeper and afterwards memcpy()'ing the result into
> shadow_timekeeper using timekeeping_update(). Used everywhere for
> updates except in timekeeping_advance(); the sequence counter protected
> region starts before the first change to the timekeeper is done.
>
> 2. Updating shadow_timekeeper and then memcpy()'ing the result into
> timekeeper. Used only by in timekeeping_advance(); The seqence counter
> protected region is only around timekeeping_update() and the memcpy for
> copy from shadow to timekeeper.
>
> The second option is fast path optimized. The sequence counter protected
> region is as short as possible.
>
> As this behaviour is mainly documented by commit messages, but not in code,
> it makes the not easy timekeeping code more complicated to read.
>
> There is no reason why updates to the timekeeper can't use the optimized
> version everywhere. With this, the code will be cleaner, as code is reused
> instead of duplicated.
>
> To be able to access tk_data which contains all required information, add a
> pointer to tk_data as an argument to timekeeping_update(). With that
> convert the comment about holding the lock into a lockdep assert.
>
> No functional change.
>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
Acked-by: John Stultz <jstultz@...gle.com>
Powered by blists - more mailing lists