All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Malovitsa <igor.malovitsa@gmail.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf@vger.kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	 martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
	yonghong.song@linux.dev,  jolsa@kernel.org, memxor@gmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH bpf 1/2] bpf: Load ringbuf consumer_pos under the spinlock
Date: Fri, 16 Oct 2026 19:12:57 +0000	[thread overview]
Message-ID: <atJ3KJn1TVK8Oo-h@corey> (raw)
In-Reply-To: <DM6EA4NZEW6T.1QXD6YWB6J9JZ@gmail.com>

On Fri, Oct 16, 2026 at 16:14:44 +0000, Alexei Starovoitov wrote:

> libbpf writes consumer_pos after every record, so this load is
> a cache miss most of the time.
> Today it's done before the lock. With this patch all other producers
> spin on the lock while this cpu waits for it. On 64-bit too.
> So "Neither changes anything on 64-bit" in the cover letter is not correct.
>
> imo it's not worth slowing down everyone for that.

Thank you for the quick review. I do agree that a bug limited to 32-bit,
requiring 4GB of traffic to reproduce is not worth the trouble.
The reason I raised this patch is building a formal model and
discovering there's technically a bug. If this corner case is
not a concern, I can abandon this patch.
The second patch is zero cost, though.

  reply	other threads:[~2026-10-16 19:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16  0:33 [PATCH bpf 0/2] bpf: Fix ring buffer checks on 32-bit position wrap Igor Malovitsa
2026-10-16  0:33 ` [PATCH bpf 1/2] bpf: Load ringbuf consumer_pos under the spinlock Igor Malovitsa
2026-10-16  0:47   ` sashiko-bot
2026-10-16 16:14   ` Alexei Starovoitov
2026-10-16 19:12     ` Igor Malovitsa [this message]
2026-10-16  0:33 ` [PATCH bpf 2/2] bpf: Fix user ringbuf empty check on 32-bit position wrap Igor Malovitsa

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=atJ3KJn1TVK8Oo-h@corey \
    --to=igor.malovitsa@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.