bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: Yonghong Song <yonghong.song@linux.dev>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf@vger.kernel.org, Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next 0/4] selftests/bpf: Fix a few test failures with arm64 64KB page
Date: Fri, 6 Jun 2025 10:19:37 -0700	[thread overview]
Message-ID: <766f97fa-0b28-4dcd-ba49-3adee4fe2e80@linux.dev> (raw)
In-Reply-To: <dc7f1234-598e-46a5-afd0-a0de8fba3de9@linux.dev>

On 6/6/25 10:03 AM, Yonghong Song wrote:
> 
> 
> On 6/6/25 9:49 AM, Ihor Solodrai wrote:
>> On 6/6/25 9:43 AM, Yonghong Song wrote:
>>>
>>>
>>> On 6/6/25 9:30 AM, Andrii Nakryiko wrote:
>>>> On Thu, Jun 5, 2025 at 8:23 PM Yonghong Song 
>>>> <yonghong.song@linux.dev> wrote:
>>>>> My local arm64 host has 64KB page size and the VM to run test_progs
>>>>> also has 64KB page size. There are a few self tests assuming 4KB page
>>>>> and hence failed in my envorinment. Patch 1 tries to reduce long 
>>>>> assert
>>>> typo: environment
>>>>
>>>>> logs when tail failed. Patches 2-4 fixed three selftest failures.
>>>> How come our BPF CI doesn't catch this on aarch64?.. Ihor, any 
>>>> thoughts?
>>>
>>> In CI for aarch64, the page size is 4KB. For example, for this link:
>>>
>>> https://github.com/kernel-patches/bpf/actions/runs/15482212552/ 
>>> job/43590176563?pr=9053
>>>
>>> Find the kconfig, and we have
>>>
>>>    CONFIG_ARM64_4K_PAGES=y
>>>    # CONFIG_ARM64_16K_PAGES is not set
>>>    # CONFIG_ARM64_64K_PAGES is not set
>>>
>>> and for 4K page, all these tests are fine, but not for 64K page.
>>
>> Ah right, I just realized the host pagesize doesn't matter, the kernel
>> we are running tests against needs to be re-compiled with the right
>> config.
> 
> Actually, the host pagesize matters too.
> 
> For example, for trace_printk.lskel.h which is used to build bpf binary at
> an aarch64 host and that aarch64 host is 64KB page.
> In trace_printk.lskel.h, we have
>     ...
>     skel->bss = skel_finalize_map_data(&skel->maps.bss.initial_value,
>         65536, PROT_READ | PROT_WRITE, skel->maps.bss.map_fd);
>     ...
> 
> Note that the number '65536' is used here to do mmap.
> 
> For an x86 host, the number will be 4096 (4KB) instead of 64KB.
> 
> For this bpf prog on aarch64, if the VM has page size 4KB,
> something could go wrong.
> 
> So the best is to have the same page size for host and VM for selftests.

If the host/vm page size difference only impacts certain tests, we
could denylist them. But if it makes the kernel or selftests more
unstable in general, then we'll have to switch the hosts.

I don't know how difficult it is to get a 64k page machine on AWS,
could be a challenge.

> 
> 
>>
>> If this is important to test on CI, it can be another matrix dimension
>> with customized kconfig. Do we want to do that?
>>
>>
>>>
>>>
>>>>
>>>>> Yonghong Song (4):
>>>>>    selftests/bpf: Reduce test_xdp_adjust_frags_tail_grow logs
>>>>>    selftests/bpf: Fix bpf_mod_race test failure with arm64 64KB 
>>>>> page size
>>>>>    selftests/bpf: Fix ringbuf/ringbuf_write test failure with arm64 
>>>>> 64KB
>>>>>      page size
>>>>>    selftests/bpf: Fix a user_ringbuf failure with arm64 64KB page size
>>>>>
>>>>>   .../selftests/bpf/prog_tests/bpf_mod_race.c    |  2 +-
>>>>>   .../testing/selftests/bpf/prog_tests/ringbuf.c |  5 +++--
>>>>>   .../selftests/bpf/prog_tests/user_ringbuf.c    |  6 ++++--
>>>>>   .../selftests/bpf/prog_tests/xdp_adjust_tail.c | 18 +++++++++++ 
>>>>> +------
>>>>>   .../selftests/bpf/progs/test_ringbuf_write.c   |  5 +++--
>>>>>   5 files changed, 23 insertions(+), 13 deletions(-)
>>>>>
>>>>> -- 
>>>>> 2.47.1
>>>>>
>>>
>>
> 


  reply	other threads:[~2025-06-06 17:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-06  3:23 [PATCH bpf-next 0/4] selftests/bpf: Fix a few test failures with arm64 64KB page Yonghong Song
2025-06-06  3:23 ` [PATCH bpf-next 1/4] selftests/bpf: Reduce test_xdp_adjust_frags_tail_grow logs Yonghong Song
2025-06-06  3:23 ` [PATCH bpf-next 2/4] selftests/bpf: Fix bpf_mod_race test failure with arm64 64KB page size Yonghong Song
2025-06-06  3:23 ` [PATCH bpf-next 3/4] selftests/bpf: Fix ringbuf/ringbuf_write " Yonghong Song
2025-06-06  3:23 ` [PATCH bpf-next 4/4] selftests/bpf: Fix a user_ringbuf " Yonghong Song
2025-06-06  5:52   ` Yonghong Song
2025-06-06  6:00     ` Yonghong Song
2025-06-06 16:30 ` [PATCH bpf-next 0/4] selftests/bpf: Fix a few test failures with arm64 64KB page Andrii Nakryiko
2025-06-06 16:37   ` Ihor Solodrai
2025-06-06 16:43   ` Yonghong Song
2025-06-06 16:49     ` Ihor Solodrai
2025-06-06 16:57       ` Andrii Nakryiko
2025-06-06 17:15         ` Ihor Solodrai
2025-06-06 18:21           ` Andrii Nakryiko
2025-06-06 17:03       ` Yonghong Song
2025-06-06 17:19         ` Ihor Solodrai [this message]
2025-06-06 18:11           ` Yonghong Song

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=766f97fa-0b28-4dcd-ba49-3adee4fe2e80@linux.dev \
    --to=ihor.solodrai@linux.dev \
    --cc=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@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;
as well as URLs for NNTP newsgroup(s).