All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* The rdp->gpwrap behavior
@ 2025-02-13 18:30 Joel Fernandes
  2025-02-14  8:20 ` Paul E. McKenney
  0 siblings, 1 reply; 10+ messages in thread
From: Joel Fernandes @ 2025-02-13 18:30 UTC (permalink / raw)
  To: rcu, paulmck

+rcu for archives

Hi,

Following up about our gpwrap discussions, I did some tracing of rdp->gpwrap
with just boot testing.

I actually never see it set because rdp->gp_seq and rnp->gp_seq are usually
very close.

Example trace:

# rnp->gp_seq starts with -1200 on boot and then right around the wrap:

178.096329: rcu_gpnum_ovf: CPU: 2, rnp->gp_seq: -3 (0xfffffffffffffffd), rdp->gp_seq: -3 (0xfffffffffffffffd), wrap before: 0
178.096330: rcu_gpnum_ovf: CPU: 2, rnp->gp_seq: -3 (0xfffffffffffffffd), rdp->gp_seq: -3 (0xfffffffffffffffd), wrap after: 0
178.100327: rcu_gpnum_ovf: CPU: 2, rnp->gp_seq: 1 (0x1), rdp->gp_seq: 1 (0x1), wrap before: 0
178.100328: rcu_gpnum_ovf: CPU: 2, rnp->gp_seq: 1 (0x1), rdp->gp_seq: 1 (0x1), wrap after: 0

The wrap "before" and "after" are the value of gpwrap before and after
calling rcu_gpnum_ovf().

Closer look at the _ovf() shows it should be only set if rdp->gp_seq and
rnp->gp_seq are quite a distance apart (say if the CPU was idle for too long
and many GPs have passed. This can happen both with/without wrap. So imminent
wrapping seems not necessary for ->gpwrap to be even set AFAICS.

I think the problem is ULONG_CMP_LT is not really "<" so even after wrap, it
can false. i.e if rdp->gpseq + ULONG/4 wraps, it could still return false.

From a testing POV, the example shows it is not set even when around when a
wrap actually happened.  So may be, we are not testing gpwrap much, or at
all, with rcutorture?

But before that, I am feeling it is not behaving correctly. I'd expect it to
be set even if rnp and rdp values are close but we are actually about to
wrap.  So most likely I am missing something.

thanks,

 - Joel


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

end of thread, other threads:[~2025-02-19 17:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-13 18:30 The rdp->gpwrap behavior Joel Fernandes
2025-02-14  8:20 ` Paul E. McKenney
2025-02-14 18:03   ` Joel Fernandes
2025-02-15 10:28     ` Paul E. McKenney
2025-02-16 12:23       ` Joel Fernandes
2025-02-18 13:17         ` Paul E. McKenney
2025-02-18 22:50           ` Joel Fernandes
2025-02-19 13:54             ` Paul E. McKenney
2025-02-19 15:57               ` Joel Fernandes
2025-02-19 17:02                 ` Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.