lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c8ee26af-3bd0-48d6-a130-65ceb56f23e0@linux.dev>
Date: Fri, 13 Sep 2024 12:17:26 -0400
From: Sean Anderson <sean.anderson@...ux.dev>
To: Brett Creeley <bcreeley@....com>, Eric Dumazet <edumazet@...gle.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski
 <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
 Juri Lelli <juri.lelli@...hat.com>, Thomas Gleixner <tglx@...utronix.de>,
 Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: Handle threadirqs in __napi_schedule_irqoff

On 9/13/24 12:08, Brett Creeley wrote:
> 
> 
> On 9/13/2024 8:23 AM, Sean Anderson wrote:
>> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
>>
>>
>> On 9/13/24 11:16, Eric Dumazet wrote:
>>> On Fri, Sep 13, 2024 at 5:10 PM Sean Anderson <sean.anderson@...ux.dev> wrote:
>>>>
>>>> The threadirqs kernel parameter can be used to force threaded IRQs even
>>>> on non-PREEMPT_RT kernels. Use force_irqthreads to determine if we can
>>>> skip disabling local interrupts. This defaults to false on regular
>>>> kernels, and is always true on PREEMPT_RT kernels.
>>>>
>>>> Signed-off-by: Sean Anderson <sean.anderson@...ux.dev>
>>>> ---
>>>>
>>>>   net/core/dev.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/net/core/dev.c b/net/core/dev.c
>>>> index 1e740faf9e78..112e871bc2b0 100644
>>>> --- a/net/core/dev.c
>>>> +++ b/net/core/dev.c
>>>> @@ -6202,7 +6202,7 @@ EXPORT_SYMBOL(napi_schedule_prep);
>>>>    */
>>>>   void __napi_schedule_irqoff(struct napi_struct *n)
>>>>   {
>>>> -       if (!IS_ENABLED(CONFIG_PREEMPT_RT))
>>>> +       if (!force_irqthreads())
>>>>                  ____napi_schedule(this_cpu_ptr(&softnet_data), n);
>>>>          else
>>>>                  __napi_schedule(n);
>>>> -- 
>>>> 2.35.1.1320.gc452695387.dirty
>>>>
>>>
>>> Seems reasonable, can you update the comment (kdoc) as well ?
>>>
>>> It says :
>>>
>>>   * On PREEMPT_RT enabled kernels this maps to __napi_schedule()
>>>   * because the interrupt disabled assumption might not be true
>>>   * due to force-threaded interrupts and spinlock substitution.
>>
>> OK
>>
>>> Also always specify net or net-next for networking patches.
>>
>> Ah, sorry. Should be net-next.
> 
> Is this worthy for a fixes/net tag?

Maybe? Commit 8380c81d5c4f ("net: Treat __napi_schedule_irqoff() as
__napi_schedule() on PREEMPT_RT") originally introduced the condition on
PREEMPT_RT but didn't include any fixes. And that's probably because
there's nothing wrong with the original behavior as long as you add
IRQF_NO_THREAD to your interrupt. Although at the time threadirqs had
existed for a while, so maybe this commit should fix that one.

--Sean

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ