All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	shuah@kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net] selftests: rtnetlink: try double sleep to give WQ a chance
Date: Fri, 11 Jul 2025 07:17:29 -0700	[thread overview]
Message-ID: <20250711071729.14d727f6@kernel.org> (raw)
In-Reply-To: <aHBza5P50wcKjG_h@fedora>

On Fri, 11 Jul 2025 02:14:03 +0000 Hangbin Liu wrote:
> >  	sleep 5
> > +	# Schedule out for a bit, address GC runs from the power efficient WQ
> > +	# if the long sleep above has put the whole system into sleep state
> > +	# the WQ may have not had a chance to run.
> > +	sleep 0.1
> > +  
> 
> How about use slowwait to check if the address still exists.

Weirdly if we read the addresses twice they disappear, I haven't looked
into the code for the why, but seemed like using slowwait could
potentially mask the addresses sticking around when nobody runs 
the Netlink handlers for a while? Dunno..

I queued this debug patch a couple of months ago:

 	sleep 5
-	run_cmd_grep_fail "10.23.11." ip addr show dev "$devdummy"
+	ip addr show dev "$devdummy" > /tmp/a
+	run_cmd_grep_fail "10.23.11." cat /tmp/a
 	if [ $? -eq 0 ]; then
-		check_err 1
-		end_test "FAIL: preferred_lft addresses remaining"
+	    check_err 1
+	    cat /tmp/a
+	    echo "==="
+		ip addr show dev "$devdummy"
+		end_test "FAIL: preferred_lft addresses remaining ($lft)"
 		return
 	fi

And when it flakes the output looks like this:

# 7.23 [+7.00] 297: test-dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
# 7.23 [+0.00]     link/ether 9e:a6:c4:c2:1b:16 brd ff:ff:ff:ff:ff:ff
# 7.23 [+0.00]     inet 10.23.11.81/32 scope global deprecated dynamic test-dummy0
# 7.23 [+0.00]        valid_lft 0sec preferred_lft 0sec
# 7.23 [+0.00]     inet 10.23.11.84/32 scope global deprecated dynamic test-dummy0
# 7.24 [+0.00]        valid_lft 0sec preferred_lft 0sec
# 7.24 [+0.00]     inet 10.23.11.93/32 scope global deprecated dynamic test-dummy0
# 7.24 [+0.00]        valid_lft 0sec preferred_lft 0sec
# 7.24 [+0.00]     inet 10.23.11.94/32 scope global deprecated dynamic test-dummy0
# 7.24 [+0.00]        valid_lft 0sec preferred_lft 0sec
# 7.24 [+0.00]     inet 10.23.11.97/32 scope global deprecated dynamic test-dummy0
# 7.24 [+0.00]        valid_lft 0sec preferred_lft 0sec
# 7.24 [+0.00]     inet 10.23.11.99/32 scope global deprecated dynamic test-dummy0
# 7.24 [+0.00]        valid_lft 0sec preferred_lft 0sec
# 7.24 [+0.00]     inet6 fe80::9ca6:c4ff:fec2:1b16/64 scope link proto kernel_ll 
# 7.24 [+0.00]        valid_lft forever preferred_lft forever
# 7.24 [+0.00] ===
# 7.25 [+0.00] 297: test-dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
# 7.25 [+0.00]     link/ether 9e:a6:c4:c2:1b:16 brd ff:ff:ff:ff:ff:ff
# 7.25 [+0.00]     inet6 fe80::9ca6:c4ff:fec2:1b16/64 scope link proto kernel_ll 
# 7.25 [+0.00]        valid_lft forever preferred_lft forever
# 7.25 [+0.00] FAIL: preferred_lft addresses remaining (1)

  reply	other threads:[~2025-07-11 14:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 14:53 [PATCH net] selftests: rtnetlink: try double sleep to give WQ a chance Jakub Kicinski
2025-07-11  2:14 ` Hangbin Liu
2025-07-11 14:17   ` Jakub Kicinski [this message]
2025-07-14  7:19     ` Hangbin Liu
2025-07-14 22:30       ` Jakub Kicinski

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=20250711071729.14d727f6@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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 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.