atomic_fetch_andnot() in nohz_idle_balance()
Hi,
The comment for the atomic_fetch_andnot() in nohz_idle_balance() says:
"barrier, pairs with nohz_balance_enter_idle(), ensures ..."
which, well, does sound a note of warning... ;-)
I see that nohz_balance_enter_idle() has an smp_mb__after_atomic() but the comment for the latter suggests that this barrier is pairing with the smp_mb() in _nohz_idle_balance().
So, what is the intended pairing barrier for the atomic_fetch_andnot()? what (which memory accesses) do you want "to order" here?
Thanks,
Andrea
Quoted 6 lines · Andrea Parri
Hi,
The comment for the
atomic_fetch_andnot()innohz_idle_balance()says:"barrier, pairs with
nohz_balance_enter_idle(), ensures ..."
Quoted 8 lines
which, well, does sound a note of warning... ;-)
I see that
nohz_balance_enter_idle()has ansmp_mb__after_atomic()but the comment for the latter suggests that this barrier is pairing with thesmp_mb()in_nohz_idle_balance().So, what is the intended pairing barrier for the
atomic_fetch_andnot()? what (which memory accesses) do you want "to order" here?
I can't seem to make sense of that comment either; the best I can come up with is that it would order the prior NOHZ_KICK_MASK load vs us then changing it.
But that would order against kick_ilb(), not enter_idle.
Vincent?
Quoted 17 lines · Peter Zijlstra
Quoted 6 lines · Andrea Parri
Hi,
The comment for the
atomic_fetch_andnot()innohz_idle_balance()says:"barrier, pairs with
nohz_balance_enter_idle(), ensures ..."Quoted 8 lines
which, well, does sound a note of warning... ;-)
I see that
nohz_balance_enter_idle()has ansmp_mb__after_atomic()but the comment for the latter suggests that this barrier is pairing with thesmp_mb()in_nohz_idle_balance().So, what is the intended pairing barrier for the
atomic_fetch_andnot()? what (which memory accesses) do you want "to order" here?
Quoted 7 lines
I can't seem to make sense of that comment either; the best I can come up with is that it would order the prior
NOHZ_KICK_MASKload vs us then changing it.But that would order against
kick_ilb(), notenter_idle.Vincent?
I can't come with a good explanation.
After looking into my email archive, the only explanation that i have is that the comments remains from a previous iteration of the feature that was based on a nohz.stats_state mechanism
Quoted 22 lines · Vincent Guittot
Quoted 21 lines · Peter Zijlstra
Quoted 6 lines · Andrea Parri
Hi,
The comment for the
atomic_fetch_andnot()innohz_idle_balance()says:"barrier, pairs with
nohz_balance_enter_idle(), ensures ..."Quoted 8 lines
which, well, does sound a note of warning... ;-)
I see that
nohz_balance_enter_idle()has ansmp_mb__after_atomic()but the comment for the latter suggests that this barrier is pairing with thesmp_mb()in_nohz_idle_balance().So, what is the intended pairing barrier for the
atomic_fetch_andnot()? what (which memory accesses) do you want "to order" here?I can't seem to make sense of that comment either; the best I can come up with is that it would order the prior
NOHZ_KICK_MASKload vs us then changing it.
Quoted 8 lines
Quoted 3 lines
But that would order against
kick_ilb(), notenter_idle.Vincent?
I can't come with a good explanation.
After looking into my email archive, the only explanation that i have is that the comments remains from a previous iteration of the feature that was based on a nohz.stats_state mechanism
I'm afraid I still can't help your comment... put in other terms, would you feel "unconfortable" with _relax()ing the andnot()? (and if so ...)
Andrea
Quoted 28 lines · Andrea Parri
Quoted 26 lines · Vincent Guittot
Quoted 24 lines · Peter Zijlstra
Quoted 6 lines · Andrea Parri
Hi,
The comment for the
atomic_fetch_andnot()innohz_idle_balance()says:"barrier, pairs with
nohz_balance_enter_idle(), ensures ..."Quoted 8 lines
which, well, does sound a note of warning... ;-)
I see that
nohz_balance_enter_idle()has ansmp_mb__after_atomic()but the comment for the latter suggests that this barrier is pairing with thesmp_mb()in_nohz_idle_balance().So, what is the intended pairing barrier for the
atomic_fetch_andnot()? what (which memory accesses) do you want "to order" here?I can't seem to make sense of that comment either; the best I can come up with is that it would order the prior
NOHZ_KICK_MASKload vs us then changing it.But that would order against
kick_ilb(), notenter_idle.Vincent?
Quoted 7 lines
Quoted 4 lines
I can't come with a good explanation.
After looking into my email archive, the only explanation that i have is that the comments remains from a previous iteration of the feature that was based on a nohz.stats_state mechanismI'm afraid I still can't help your comment... put in other terms, would you feel "unconfortable" with _relax()ing the
andnot()? (and if so ...)
so I think that the comment is useless and can be removed because it was referring to a line code above the comment that was present in a previous iteration of the patchset. This line disappeared in final version but the comment has stayed.
If your question is: can we use atomic_fetch_andnot_relaxed() instead of atomic_fetch_andnot() in nohz_idle_balance() ?
I think that it's possible
Quoted 2 lines
Andrea
Quoted 38 lines · Vincent Guittot
Quoted 28 lines · Andrea Parri
Quoted 26 lines · Vincent Guittot
Quoted 24 lines · Peter Zijlstra
Quoted 6 lines · Andrea Parri
Hi,
The comment for the
atomic_fetch_andnot()innohz_idle_balance()says:"barrier, pairs with
nohz_balance_enter_idle(), ensures ..."Quoted 8 lines
which, well, does sound a note of warning... ;-)
I see that
nohz_balance_enter_idle()has ansmp_mb__after_atomic()but the comment for the latter suggests that this barrier is pairing with thesmp_mb()in_nohz_idle_balance().So, what is the intended pairing barrier for the
atomic_fetch_andnot()? what (which memory accesses) do you want "to order" here?I can't seem to make sense of that comment either; the best I can come up with is that it would order the prior
NOHZ_KICK_MASKload vs us then changing it.But that would order against
kick_ilb(), notenter_idle.Vincent?
Quoted 7 lines
Quoted 4 lines
I can't come with a good explanation.
After looking into my email archive, the only explanation that i have is that the comments remains from a previous iteration of the feature that was based on a nohz.stats_state mechanismI'm afraid I still can't help your comment... put in other terms, would you feel "unconfortable" with _relax()ing the
andnot()? (and if so ...)
Quoted 8 lines
so I think that the comment is useless and can be removed because it was referring to a line code above the comment that was present in a previous iteration of the patchset. This line disappeared in final version but the comment has stayed.
If your question is: can we use
atomic_fetch_andnot_relaxed()instead ofatomic_fetch_andnot()innohz_idle_balance()?
I think that it's possible
Ah!, thank you for the clarification. Just sent a clean-up patch for the comment (but deferring for the _relaxed() change...).
Andrea
Quoted 3 lines
Quoted 3 lines
Andrea