mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: bot+bpf-ci@kernel.org, chenhuacai@kernel.org, hengqi.chen@gmail.com
Cc: loongarch@lists.linux.dev, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
	daniel@iogearbox.net, martin.lau@kernel.org, eddyz87@gmail.com,
	yonghong.song@linux.dev, clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH v2 3/4] LoongArch: BPF: Refactor jump offset calculation in tail call
Date: Mon, 6 Jul 2026 13:31:56 +0800	[thread overview]
Message-ID: <544cdfed-a90a-af77-eebd-4031e12f7f4a@loongson.cn> (raw)
In-Reply-To: <4101e743dcdd3be2ff84acb696e37dfe9c67116e89568cbbf985679c8862d047@mail.kernel.org>

On 2026/7/6 下午12:43, bot+bpf-ci@kernel.org wrote:
>> In emit_bpf_tail_call(), the macro-based jmp_offset calculation relies
>> on a fragile prediction equation: "tc_ninsn - (ctx->idx - idx0)". This
>> calculation model utilizes tc_ninsn from the previous pass to estimate
>> the remaining stride of the active tail call code block.

...

> 
> This looks like a fix for wrong branch offsets in the tail call path.
> Should it carry a Fixes: tag?  The tc_ninsn macro and the
> 
>    tc_ninsn = insn ? ctx->offset[insn+1] - ctx->offset[insn] : ctx->offset[0];
> 
> calculation being removed here were introduced by:
> 
>    Fixes: cd39d9e6b7e4 ("LoongArch: BPF: Fix jump offset calculation in tailcall")
> 
> This isn't a bug, but could the changelog be tightened?  Phrases such as
> "rock-solid target label", "deterministic arithmetic model",
> "initialization bottleneck", "eBPF business instruction" and "all code
> size dimensions" read as fairly ornate for an offset-formula refactor.
> 
> Could it just state that the old macro derived jmp_offset from a stale
> prior-pass stride while the new form anchors on ctx->offset[insn + 1],
> with the ctx->image == NULL guard avoiding a false 16-bit range abort
> during size estimation?

OK, I will add the Fixes tag and trim the commit message in v3.

Thanks,
Tiezhu


  reply	other threads:[~2026-07-06  5:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06  3:39 [PATCH v2 0/4] Optimize BPF tailcall for LoongArch Tiezhu Yang
2026-07-06  3:39 ` [PATCH v2 1/4] LoongArch: BPF: Optimize redundant TCC loads in epilogue Tiezhu Yang
2026-07-06  3:39 ` [PATCH v2 2/4] LoongArch: BPF: Move arena register slot below TCC context Tiezhu Yang
2026-07-06  4:29   ` bot+bpf-ci
2026-07-06  5:20     ` Tiezhu Yang
2026-07-06  3:39 ` [PATCH v2 3/4] LoongArch: BPF: Refactor jump offset calculation in tail call Tiezhu Yang
2026-07-06  4:43   ` bot+bpf-ci
2026-07-06  5:31     ` Tiezhu Yang [this message]
2026-07-06  3:39 ` [PATCH v2 4/4] LoongArch: BPF: Implement branchless conditional move for TCC Tiezhu Yang
2026-07-06  4:30   ` bot+bpf-ci
2026-07-06  5:26     ` Tiezhu Yang

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=544cdfed-a90a-af77-eebd-4031e12f7f4a@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bot+bpf-ci@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=hengqi.chen@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --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