[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201116104340.60692716@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 16 Nov 2020 10:43:40 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Martin KaFai Lau <kafai@...com>
Cc: <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>, <kernel-team@...com>,
<netdev@...r.kernel.org>, Song Liu <songliubraving@...com>
Subject: Re: [PATCH v2 bpf-next 3/4] bpf: Allow using bpf_sk_storage in
FENTRY/FEXIT/RAW_TP
On Mon, 16 Nov 2020 10:37:49 -0800 Martin KaFai Lau wrote:
> On Mon, Nov 16, 2020 at 10:00:04AM -0800, Jakub Kicinski wrote:
> > Locks that can run in any context but preempt disabled or softirq
> > disabled?
> Not exactly. e.g. running from irq won't work.
>
> > Let me cut to the chase. Are you sure you didn't mean to check
> > if (irq_count()) ?
> so, no.
>
> From preempt.h:
>
> /*
> * ...
> * in_interrupt() - We're in NMI,IRQ,SoftIRQ context or have BH disabled
> * ...
> */
> #define in_interrupt() (irq_count())
Right, as I said in my correction (in_irq() || in_nmi()).
Just to spell it out AFAIU in_serving_softirq() will return true when
softirq is active and interrupted by a hard irq or an NMI.
Powered by blists - more mailing lists