All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Sitnicki <jakub@cloudflare.com>
To: Yaniv Agman <yanivagman@gmail.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>,
	bpf <bpf@vger.kernel.org>, Yonghong Song <yhs@meta.com>
Subject: Re: Are BPF programs preemptible?
Date: Mon, 23 Jan 2023 22:22:27 +0100	[thread overview]
Message-ID: <87k01dvt83.fsf@cloudflare.com> (raw)
In-Reply-To: <CAMy7=ZWi35SKj9rcKwj0eyH+xY8ZBgiX_vpF=mydxFDahK6trg@mail.gmail.com>

On Mon, Jan 23, 2023 at 11:01 PM +02, Yaniv Agman wrote:
> ‫בתאריך יום ב׳, 23 בינו׳ 2023 ב-22:06 מאת ‪Martin KaFai Lau‬‏
> <‪martin.lau@linux.dev‬‏>:‬
>>
>> On 1/23/23 9:32 AM, Yaniv Agman wrote:
>> >>> interrupted the first one. But even then, I will need to find a way to
>> >>> know if my program currently interrupts the run of another program -
>> >>> is there a way to do that?
>> May be a percpu atomic counter to see if the bpf prog has been re-entered on the
>> same cpu.
>
> Not sure I understand how this will help. If I want to save local
> program data on a percpu map and I see that the counter is bigger then
> zero, should I ignore the event?

map_update w/ BPF_F_LOCK disables preemption, if you're after updating
an entry atomically. But it can't be used with PERCPU maps today.
Perhaps that's needed now too.

  reply	other threads:[~2023-01-23 21:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-23  9:21 Are BPF programs preemptible? Yaniv Agman
2023-01-23 10:46 ` Jakub Sitnicki
2023-01-23 12:30   ` Yaniv Agman
2023-01-23 17:02     ` Yonghong Song
2023-01-23 17:32       ` Yaniv Agman
2023-01-23 20:06         ` Martin KaFai Lau
2023-01-23 21:01           ` Yaniv Agman
2023-01-23 21:22             ` Jakub Sitnicki [this message]
2023-01-23 21:56               ` Yaniv Agman
2023-01-24 12:30                 ` Alexei Starovoitov
2023-01-24 15:47                   ` Yaniv Agman
2023-01-24 17:24                     ` Alexei Starovoitov
2023-01-24 17:38                       ` Yaniv Agman
2023-01-25  0:04                         ` Alexei Starovoitov
2023-01-25 16:39                           ` Yaniv Agman
2023-01-25 18:52                             ` Alexei Starovoitov
2023-01-25 19:59                               ` Yaniv Agman
2023-01-26  2:22                                 ` Alexei Starovoitov
2023-01-26  6:59                                   ` Yaniv Agman
2023-01-26 15:29                                     ` Alexei Starovoitov
2023-01-26 17:51                                       ` Yaniv Agman

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=87k01dvt83.fsf@cloudflare.com \
    --to=jakub@cloudflare.com \
    --cc=bpf@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=yanivagman@gmail.com \
    --cc=yhs@meta.com \
    /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.