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
Subject: Re: [PATCH v3 2/8] timers/migration: Move hierarchy setup into cpuhotplug prepare callback
Date: Mon, 1 Jul 2024 23:49:02 +0200 [thread overview]
Message-ID: <ZoMkTttgF_DgUvGG@pavilion.home> (raw)
In-Reply-To: <20240701-tmigr-fixes-v3-2-25cd5de318fb@linutronix.de>
Le Mon, Jul 01, 2024 at 12:18:38PM +0200, Anna-Maria Behnsen a écrit :
> To prevent those races, the setup of the hierarchy is moved into the
> cpuhotplug prepare callback. The prepare callback is not executed by the
> CPU which will come online, it is executed by the CPU which prepares
> onlining of the other CPU. This CPU will not go idle and so it is ensured,
> that the formerly top level group cannot go idle and change top level group
> state and the propagation could be done without a risk. The direction for
> the updates is now forced to look like "from bottom to top".
You might want to elaborate a bit on those last two sentences. For example:
"""
This CPU is active while it is connecting the formerly top level to the new
one. This prevents from (A) to happen and it also prevents from any further walk
above the formerly top level until that active CPU becomes inactive, releasing
the new ->parent and ->childmask updates to be visible by any subsequent walk
up above the formerly top level hierarchy. This prevents from (B) to happen.
"""
However if the active CPU prevents from tmigr_cpu_(in)active() to walk
up with the update not-or-half visible, nothing prevents walking up to
the new top with a 0 childmask in tmigr_handle_remote_up() or
tmigr_requires_handle_remote_up() if the active CPU doing the prepare is not
the migrator. But then it looks fine because:
* tmigr_check_migrator() should just return false
* The migrator is active and should eventually observe the new childmask
at some point in a future tick.
But still it can be a good idea to mention that somewhere.
> @@ -1540,22 +1600,22 @@ static void tmigr_connect_child_parent(struct tmigr_group *child,
> * child to the new parent. So tmigr_connect_child_parent() is
> * executed with the formerly top level group (child) and the newly
> * created group (parent).
> + *
> + * * It is ensured, that the child is active, as this setup path is
First comma is not needed.
> + * executed in hotplug prepare callback. This is exectued by an
> + * already connected and !idle CPU. Even if all other CPUs go idle,
> + * the CPU executing the setup will be responsible up to current top
> + * level group.
And the next time it goes inactive, it will release the new childmask and parent
to subsequent walkers through this @child.
> + * Therefore propagate active state unconditionally.
As for the change itself:
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Thanks.
next prev parent reply other threads:[~2024-07-01 21:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 10:18 [PATCH v3 0/8] timers/migration: Fix three possible races and some improvements Anna-Maria Behnsen
2024-07-01 10:18 ` [PATCH v3 1/8] timers/migration: Do not rely always on group->parent Anna-Maria Behnsen
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 10:18 ` [PATCH v3 2/8] timers/migration: Move hierarchy setup into cpuhotplug prepare callback Anna-Maria Behnsen
2024-07-01 21:49 ` Frederic Weisbecker [this message]
2024-07-03 20:28 ` [PATCH v4 " Anna-Maria Behnsen
2024-07-03 21:24 ` Frederic Weisbecker
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-11 8:56 ` [PATCH v4 2/8] " Alexander Stein
2024-07-15 10:39 ` Jon Hunter
2024-07-15 10:44 ` Frederic Weisbecker
2024-07-15 13:25 ` Jon Hunter
2024-07-01 10:18 ` [PATCH v3 3/8] timers/migration: Improve tracing Anna-Maria Behnsen
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 10:18 ` [PATCH v3 4/8] timers/migration: Use a single struct for hierarchy walk data Anna-Maria Behnsen
2024-07-02 11:43 ` Frederic Weisbecker
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 10:18 ` [PATCH v3 5/8] timers/migration: Read childmask and parent pointer in a single place Anna-Maria Behnsen
2024-07-02 12:04 ` Frederic Weisbecker
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-15 19:28 ` [PATCH v3 5/8] " Frederic Weisbecker
2024-07-01 10:18 ` [PATCH v3 6/8] timers/migration: Rename childmask by parentmask to make naming more obvious Anna-Maria Behnsen
2024-07-02 12:45 ` Frederic Weisbecker
2024-07-03 20:31 ` [PATCH v4 6/8] timers/migration: Rename childmask by groupmask " Anna-Maria Behnsen
2024-07-03 21:33 ` Frederic Weisbecker
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 10:18 ` [PATCH v3 7/8] timers/migration: Spare write when nothing changed Anna-Maria Behnsen
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-01 10:18 ` [PATCH v3 8/8] timers/migration: Fix grammar in comment Anna-Maria Behnsen
2024-07-02 12:51 ` Frederic Weisbecker
2024-07-04 18:32 ` [tip: timers/core] " tip-bot2 for Anna-Maria Behnsen
2024-07-11 15:44 ` [PATCH v3 0/8] timers/migration: Fix three possible races and some improvements Anna-Maria Behnsen
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=ZoMkTttgF_DgUvGG@pavilion.home \
--to=frederic@kernel.org \
--cc=anna-maria@linutronix.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