-
Notifications
You must be signed in to change notification settings - Fork 157
selftests/bpf: Fix task_local_data failure with 64K page #10813
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Upstream branch: a32ae26 |
5f0eb13 to
e1cc553
Compare
|
Upstream branch: 82f3b14 |
7a9078f to
f06b3a5
Compare
e1cc553 to
403c46b
Compare
|
Upstream branch: c99225b |
f06b3a5 to
931cb28
Compare
403c46b to
53953d6
Compare
|
Upstream branch: 82f3b14 |
931cb28 to
4fd99d1
Compare
On arm64 systems with 64K pages, the selftest task_local_data has the following failures: ... test_task_local_data_basic:PASS:tld_create_key 0 nsec test_task_local_data_basic:FAIL:tld_create_key unexpected tld_create_key: actual 0 != expected -28 ... test_task_local_data_basic_thread:PASS:run task_main 0 nsec test_task_local_data_basic_thread:FAIL:task_main retval unexpected error: 2 (errno 0) test_task_local_data_basic_thread:FAIL:tld_get_data value0 unexpected tld_get_data value0: actual 0 != expected 6268 ... #447/1 task_local_data/task_local_data_basic:FAIL ... #447/2 task_local_data/task_local_data_race:FAIL #447 task_local_data:FAIL When TLD_DYN_DATA_SIZE is 64K page size, for struct tld_meta_u { _Atomic __u8 cnt; __u16 size; struct tld_metadata metadata[]; }; field 'cnt' would overflow. For example, for 4K page, 'cnt' will be 4096/64 = 64. But for 64K page, 'cnt' will be 65536/64 = 1024 and 'cnt' is not enough for 1024. To accommodate 64K page, '_Atomic __u8 cnt' becomes '_Atomic __u16 cnt'. A few other places are adjusted accordingly. In test_task_local_data.c, the value for TLD_DYN_DATA_SIZE is changed from 4096 to (getpagesize() - 8) since the maximum buffer size for TLD_DYN_DATA_SIZE is (getpagesize() - 8). Reviewed-by: Alan Maguire <[email protected]> Tested-by: Alan Maguire <[email protected]> Cc: Amery Hung <[email protected]> Signed-off-by: Yonghong Song <[email protected]> Acked-by: Amery Hung <[email protected]>
If the argument 'pull_len' of run_test() is 'PULL_MAX' or 'PULL_MAX | PULL_PLUS_ONE', the eventual pull_len size will close to the page size. On arm64 systems with 64K pages, the pull_len size will be close to 64K. But the existing buffer will be close to 9000 which is not enough to pull. For those failed run_tests(), make buff size to pg_sz + (pg_sz / 2) This way, there will be enough buffer space to pull regardless of page size. Tested-by: Alan Maguire <[email protected]> Cc: Amery Hung <[email protected]> Signed-off-by: Yonghong Song <[email protected]> Acked-by: Amery Hung <[email protected]>
|
Upstream branch: 82f3b14 |
4fd99d1 to
278dcb8
Compare
53953d6 to
1682daf
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1046027 irrelevant now. Closing PR. |
Pull request for series with
subject: selftests/bpf: Fix task_local_data failure with 64K page
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1046027