mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hou Tao <houtao@huaweicloud.com>
To: Jiayuan Chen <jiayuan.chen@linux.dev>, bpf@vger.kernel.org
Cc: john.fastabend@gmail.com, davem@davemloft.net, kuba@kernel.org,
	andrii@kernel.org, eddyz87@gmail.com, mykolal@fb.com,
	ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	song@kernel.org, yonghong.song@linux.dev, kpsingh@kernel.org,
	sdf@fomichev.me, haoluo@google.com, jolsa@kernel.org,
	shuah@kernel.org, hawk@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	mrpre@163.com
Subject: Re: [PATCH bpf-next v1 3/3] selftests/bpf: Fixes for test_maps test
Date: Sat, 1 Mar 2025 09:31:57 +0800	[thread overview]
Message-ID: <69d3cd4f-3ea3-78c5-59ea-d4a1185a4251@huaweicloud.com> (raw)
In-Reply-To: <20250227142646.59711-4-jiayuan.chen@linux.dev>

Hi,

On 2/27/2025 10:26 PM, Jiayuan Chen wrote:
> BPF CI has failed 3 times in the last 24 hours. Add retry for ENOMEM.
> It's similar to the optimization plan:
> commit 2f553b032cad ("selftsets/bpf: Retry map update for non-preallocated per-cpu map")
>
> Failed CI:
> https://github.com/kernel-patches/bpf/actions/runs/13549227497/job/37868926343
> https://github.com/kernel-patches/bpf/actions/runs/13548089029/job/37865812030
> https://github.com/kernel-patches/bpf/actions/runs/13553536268/job/37883329296

Er, it is suspicious that the allocation of htab_elem failed, because
the size of key and value is small in these cases. It usually means that
there is something wrong with bpf mem allocator or the slub, therefore,
I think it is a bad idea to retry for ENOMEM in this case. Will try to
reproduce the problem first when get some time.
>
> selftests/bpf: Fixes for test_maps test
> Fork 100 tasks to 'test_update_delete'
> Fork 100 tasks to 'test_update_delete'
> Fork 100 tasks to 'test_update_delete'
> Fork 100 tasks to 'test_update_delete'
> ......
> test_task_storage_map_stress_lookup:PASS
> test_maps: OK, 0 SKIPPED
>
> Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
> ---
>  tools/testing/selftests/bpf/test_maps.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
> index 8b40e9496af1..986ce32b113a 100644
> --- a/tools/testing/selftests/bpf/test_maps.c
> +++ b/tools/testing/selftests/bpf/test_maps.c
> @@ -1396,9 +1396,10 @@ static void test_map_stress(void)
>  #define MAX_DELAY_US 50000
>  #define MIN_DELAY_RANGE_US 5000
>  
> -static bool retry_for_again_or_busy(int err)
> +static bool can_retry(int err)
>  {
> -	return (err == EAGAIN || err == EBUSY);
> +	return (err == EAGAIN || err == EBUSY ||
> +		(err == ENOMEM && map_opts.map_flags == BPF_F_NO_PREALLOC));
>  }
>  
>  int map_update_retriable(int map_fd, const void *key, const void *value, int flags, int attempts,
> @@ -1451,12 +1452,12 @@ static void test_update_delete(unsigned int fn, void *data)
>  
>  		if (do_update) {
>  			err = map_update_retriable(fd, &key, &value, BPF_NOEXIST, MAP_RETRIES,
> -						   retry_for_again_or_busy);
> +						   can_retry);
>  			if (err)
>  				printf("error %d %d\n", err, errno);
>  			assert(err == 0);
>  			err = map_update_retriable(fd, &key, &value, BPF_EXIST, MAP_RETRIES,
> -						   retry_for_again_or_busy);
> +						   can_retry);
>  			if (err)
>  				printf("error %d %d\n", err, errno);
>  			assert(err == 0);


  reply	other threads:[~2025-03-01  1:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27 14:26 [PATCH bpf-next v1 0/3] Optimize bpf selftest to increase CI success rate Jiayuan Chen
2025-02-27 14:26 ` [PATCH bpf-next v1 1/3] selftests/bpf: Allow auto port binding for cgroup connect Jiayuan Chen
2025-02-27 14:26 ` [PATCH bpf-next v1 2/3] selftests/bpf: Allow auto port binding for bpf nf Jiayuan Chen
2025-02-27 14:26 ` [PATCH bpf-next v1 3/3] selftests/bpf: Fixes for test_maps test Jiayuan Chen
2025-03-01  1:31   ` Hou Tao [this message]
2025-02-27 16:17 ` [PATCH bpf-next v1 0/3] Optimize bpf selftest to increase CI success rate Alexei Starovoitov
2025-02-27 16:20 ` patchwork-bot+netdevbpf

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=69d3cd4f-3ea3-78c5-59ea-d4a1185a4251@huaweicloud.com \
    --to=houtao@huaweicloud.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mrpre@163.com \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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

all inboxes | Powered by JetHome®