From: Frederic Weisbecker <frederic@kernel.org>
To: Anna-Maria Behnsen <anna-maria@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH v2 1/5] timer_migration: Do not rely always on group->parent
Date: Mon, 24 Jun 2024 22:29:40 +0200 [thread overview]
Message-ID: <ZnnXNCOJ91C_CSZg@pavilion.home> (raw)
In-Reply-To: <20240624-tmigr-fixes-v2-1-3eb4c0604790@linutronix.de>
Le Mon, Jun 24, 2024 at 04:53:53PM +0200, Anna-Maria Behnsen a écrit :
> When reading group->parent without holding the group lock it is racy
> against CPUs coming online the first time and thereby creating another
> level of the hierarchy. This is not a problem when this value is read once
> to decide whether to abort a propagation or not. The worst outcome is an
> unnecessary/early CPU wake up. But it is racy when reading it several times
> during a single 'action' (like activation, deactivation, checking for
> remote timer expiry,...) and relying on the consitency of this value
> without holding the lock. This happens at the moment e.g. in
> tmigr_inactive_up() which is also calling tmigr_udpate_events(). Code relys
> on group->parent not to change during this 'action'.
>
> Update parent struct member description to explain the above only
> once. Remove parent pointer checks when they are not mandatory (like update
> of data->childmask). Remove a warning, which would be nice but the trigger
> of this warning is not reliable and add expand the data structure member
> description instead. Expand a comment, why it is safe to rely on parent
> pointer here (inside hierarchy update).
>
> Fixes: 7ee988770326 ("timers: Implement the hierarchical pull model")
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
next prev parent reply other threads:[~2024-06-24 20:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZnnXNCOJ91C_CSZg@pavilion.home \
--to=frederic@kernel.org \
--cc=anna-maria@linutronix.de \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox