netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
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 02:14:03 +0000	[thread overview]
Message-ID: <aHBza5P50wcKjG_h@fedora> (raw)
In-Reply-To: <20250710145312.3361964-1-kuba@kernel.org>

On Thu, Jul 10, 2025 at 07:53:12AM -0700, Jakub Kicinski wrote:
> The rtnetlink test for preferred lifetime of an address is quite flaky.
> Problems started around the 6.16 merge window in May. The test fails
> with:
> 
>    FAIL: preferred_lft addresses remaining
> 
> and unlike most of our flakes this one fails on the "normal" kernel
> builds, not the builds with kernel/configs/debug.config. I suspect
> the flakes may be related to power saving, since the expirations
> run from a "power efficient" workqueue. Adding a short sleep seems
> to decrease the flakes by 8x but they still happen. With this
> patch in place we get a flake every couple of weeks, not every
> couple of days. Better ideas welcome..
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: liuhangbin@gmail.com
> CC: shuah@kernel.org
> CC: linux-kselftest@vger.kernel.org
> ---
>  tools/testing/selftests/net/rtnetlink.sh | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index 2e8243a65b50..b9e1497ea27a 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -299,6 +299,11 @@ kci_test_addrlft()
>  	done
>  
>  	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. e.g.

check_addr_not_exist()
{
	dev=$1
	addr=$2
	if ip addr show dev $dev | grep -q $addr; then
		return 1
	else
		return 0
}

	slowwait 5 check_addr_not_exist "$devdummy" "10.23.11."

>  	run_cmd_grep_fail "10.23.11." ip addr show dev "$devdummy"
>  	if [ $? -eq 0 ]; then
>  		check_err 1
> -- 
> 2.50.0
> 

  reply	other threads:[~2025-07-11  2:14 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 [this message]
2025-07-11 14:17   ` Jakub Kicinski
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=aHBza5P50wcKjG_h@fedora \
    --to=liuhangbin@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).