From: Leon Hwang <leon.hwang@linux•dev>
To: bot+bpf-ci@kernel•org, bpf@vger•kernel.org
Cc: ast@kernel•org, daniel@iogearbox•net, andrii@kernel•org,
martin.lau@linux•dev, eddyz87@gmail•com, song@kernel•org,
yonghong.song@linux•dev, john.fastabend@gmail•com,
kpsingh@kernel•org, sdf@fomichev•me, haoluo@google•com,
jolsa@kernel•org, puranjay@kernel•org, xukuohai@huaweicloud•com,
catalin.marinas@arm•com, will@kernel•org, davem@davemloft•net,
dsahern@kernel•org, tglx@linutronix•de, mingo@redhat•com,
bp@alien8•de, dave.hansen@linux•intel.com, x86@kernel•org,
hpa@zytor•com, akpm@linux-foundation•org,
linux-arm-kernel@lists•infradead.org,
linux-kernel@vger•kernel.org, netdev@vger•kernel.org,
kernel-patches-bot@fb•com, martin.lau@kernel•org, clm@meta•com,
ihor.solodrai@linux•dev
Subject: Re: [PATCH bpf-next 1/4] bpf: tailcall: Introduce bpf_arch_tail_call_prologue_offset
Date: Fri, 2 Jan 2026 23:38:25 +0800 [thread overview]
Message-ID: <883a21af-750c-49df-88c6-47bd642e03d4@linux.dev> (raw)
In-Reply-To: <45f1e1978b7dc28e522dcc0a72954d892b37a85220749bd027c7395edb01d991@mail.kernel.org>
On 2026/1/2 23:21, bot+bpf-ci@kernel•org wrote:
>> diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
>> index 1eeb31c5b317..beedd1281c22 100644
>> --- a/kernel/bpf/arraymap.c
>> +++ b/kernel/bpf/arraymap.c
>> @@ -127,6 +127,9 @@ static struct bpf_map *array_map_alloc(union bpf_attr *attr)
>> array_size += (u64) max_entries * elem_size;
>> }
>> }
>> + if (attr->map_type == BPF_MAP_TYPE_PROG_ARRAY && bpf_arch_tail_call_prologue_offset())
>> + /* Store tailcall targets */
>> + array_size += (u64) max_entries * sizeof(void *);
>
> Should array_map_mem_usage() also account for this additional space?
> Currently array_map_mem_usage() handles special cases for percpu arrays
> and mmapable arrays, but has no corresponding check for PROG_ARRAY maps
> when bpf_arch_tail_call_prologue_offset() is non-zero. This would cause
> the reported memory usage to be lower than the actual allocation when
> an architecture implements this function (e.g., x86_64 and arm64 in the
> subsequent patches of this series).
>
> [ ... ]
>
You are right, array_map_mem_usage() needs to stay in sync with the
allocation logic to avoid under-reporting memory.
I will include this fix in the next revision after I’ve collected more
feedback.
Thanks,
Leon
next prev parent reply other threads:[~2026-01-02 15:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 15:00 [PATCH bpf-next 0/4] bpf: tailcall: Eliminate max_entries and bpf_func access at runtime Leon Hwang
2026-01-02 15:00 ` [PATCH bpf-next 1/4] bpf: tailcall: Introduce bpf_arch_tail_call_prologue_offset Leon Hwang
2026-01-02 15:21 ` bot+bpf-ci
2026-01-02 15:38 ` Leon Hwang [this message]
2026-01-02 15:00 ` [PATCH bpf-next 2/4] bpf, x64: tailcall: Eliminate max_entries and bpf_func access at runtime Leon Hwang
2026-01-02 15:00 ` [PATCH bpf-next 3/4] bpf, arm64: " Leon Hwang
2026-01-02 15:00 ` [PATCH bpf-next 4/4] bpf, lib/test_bpf: Fix broken tailcall tests Leon Hwang
2026-01-03 0:10 ` [PATCH bpf-next 0/4] bpf: tailcall: Eliminate max_entries and bpf_func access at runtime Alexei Starovoitov
2026-01-14 11:28 ` Jiri Olsa
2026-01-14 16:04 ` Alexei Starovoitov
2026-01-14 21:00 ` Jiri Olsa
2026-01-14 21:56 ` Alexei Starovoitov
2026-01-15 18:00 ` Jiri Olsa
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=883a21af-750c-49df-88c6-47bd642e03d4@linux.dev \
--to=leon.hwang@linux$(echo .)dev \
--cc=akpm@linux-foundation$(echo .)org \
--cc=andrii@kernel$(echo .)org \
--cc=ast@kernel$(echo .)org \
--cc=bot+bpf-ci@kernel$(echo .)org \
--cc=bp@alien8$(echo .)de \
--cc=bpf@vger$(echo .)kernel.org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=clm@meta$(echo .)com \
--cc=daniel@iogearbox$(echo .)net \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=davem@davemloft$(echo .)net \
--cc=dsahern@kernel$(echo .)org \
--cc=eddyz87@gmail$(echo .)com \
--cc=haoluo@google$(echo .)com \
--cc=hpa@zytor$(echo .)com \
--cc=ihor.solodrai@linux$(echo .)dev \
--cc=john.fastabend@gmail$(echo .)com \
--cc=jolsa@kernel$(echo .)org \
--cc=kernel-patches-bot@fb$(echo .)com \
--cc=kpsingh@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=martin.lau@kernel$(echo .)org \
--cc=martin.lau@linux$(echo .)dev \
--cc=mingo@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=puranjay@kernel$(echo .)org \
--cc=sdf@fomichev$(echo .)me \
--cc=song@kernel$(echo .)org \
--cc=tglx@linutronix$(echo .)de \
--cc=will@kernel$(echo .)org \
--cc=x86@kernel$(echo .)org \
--cc=xukuohai@huaweicloud$(echo .)com \
--cc=yonghong.song@linux$(echo .)dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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