public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] timer_migration: Fix two possible races and an improvement
@ 2024-06-24 14:53 Anna-Maria Behnsen
  2024-06-24 14:53 ` [PATCH v2 1/5] timer_migration: Do not rely always on group->parent Anna-Maria Behnsen
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Anna-Maria Behnsen @ 2024-06-24 14:53 UTC (permalink / raw)
  To: Frederic Weisbecker, Thomas Gleixner, linux-kernel
  Cc: Borislav Petkov, Anna-Maria Behnsen

Borislav reported a warning in timer migration deactive path

  https://lore.kernel.org/r/20240612090347.GBZmlkc5PwlVpOG6vT@fat_crate.local

Sadly it doesn't reproduce directly. But with the change of timing (by
adding a trace prinkt before the warning), it is possible to trigger the
warning reliable at least in my test setup. The problem here is a racy
check agains group->parent pointer. This is also used in other places in
the code and fixing this racy usage is adressed by the first patch.

There was another race reported by Frederic in setup path:

  https://lore.kernel.org/r/ZnWOswTMML6ShzYO@localhost.localdomain

It is addressed patch 2-4. Patch 2 is an already existing patch of v1
(improve tracing) and makes the fix easier. Patch 3 is also a preparation
patch for the final fix and Patch 4 is then the real fix. (I labelled all
those three patches with Fixes tag to be easier selectable.)

While working with the code, I saw that the update of per cpu group wakeup
value could be improved. This improvement is adressed by the last patch.

Patches are available here:

  https://git.kernel.org/pub/scm/linux/kernel/git/anna-maria/linux-devel.git timers/misc

---
Changes in v2:

- Address another possible race in setup code (reported by Frederic) and
  recycle therefore one improvement patch
- Change order and move the already existing improvement patch to the end
  of the queue
- Existing patches didn't change
- Link to v1: https://lore.kernel.org/r/20240621-tmigr-fixes-v1-0-8c8a2d8e8d77@linutronix.de

Thanks,

        Anna-Maria

---
Anna-Maria Behnsen (5):
      timer_migration: Do not rely always on group->parent
      timer_migration: Improve tracing
      timer_migration: Split out state update of tmigr_active_up()
      timer_migration: Fix possible race in tmigr_active_up() in setup path
      timer_migration: Spare write when nothing changed

 kernel/time/timer_migration.c | 137 ++++++++++++++++++++++++------------------
 kernel/time/timer_migration.h |  12 +++-
 2 files changed, 90 insertions(+), 59 deletions(-)


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-06-25  0:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24 14:53 [PATCH v2 0/5] timer_migration: Fix two possible races and an improvement Anna-Maria Behnsen
2024-06-24 14:53 ` [PATCH v2 1/5] timer_migration: Do not rely always on group->parent Anna-Maria Behnsen
2024-06-24 20:29   ` Frederic Weisbecker
2024-06-24 14:53 ` [PATCH v2 2/5] timer_migration: Improve tracing Anna-Maria Behnsen
2024-06-24 20:37   ` Frederic Weisbecker
2024-06-24 14:53 ` [PATCH v2 3/5] timer_migration: Split out state update of tmigr_active_up() Anna-Maria Behnsen
2024-06-24 20:42   ` Frederic Weisbecker
2024-06-24 14:53 ` [PATCH v2 4/5] timer_migration: Fix possible race in tmigr_active_up() in setup path Anna-Maria Behnsen
2024-06-24 22:01   ` Frederic Weisbecker
2024-06-24 22:24     ` Frederic Weisbecker
2024-06-24 14:53 ` [PATCH v2 5/5] timer_migration: Spare write when nothing changed Anna-Maria Behnsen
2024-06-24 22:08   ` Frederic Weisbecker
2024-06-25  0:00 ` [PATCH v2 0/5] timer_migration: Fix two possible races and an improvement Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox