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: <20220204201748.4af2857c@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Fri, 4 Feb 2022 20:17:48 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org,
        "David S. Miller" <davem@...emloft.net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Toke Høiland-Jørgensen 
        <toke@...e.dk>
Subject: Re: [PATCH net-next v2 3/3] net: dev: Make rps_lock() disable
 interrupts.

On Fri,  4 Feb 2022 21:12:59 +0100 Sebastian Andrzej Siewior wrote:
> Disabling interrupts and in the RPS case locking input_pkt_queue is
> split into local_irq_disable() and optional spin_lock().
> 
> This breaks on PREEMPT_RT because the spinlock_t typed lock can not be
> acquired with disabled interrupts.
> The sections in which the lock is acquired is usually short in a sense that it
> is not causing long und unbounded latiencies. One exception is the
> skb_flow_limit() invocation which may invoke a BPF program (and may
> require sleeping locks).
> 
> By moving local_irq_disable() + spin_lock() into rps_lock(), we can keep
> interrupts disabled on !PREEMPT_RT and enabled on PREEMPT_RT kernels.
> Without RPS on a PREEMPT_RT kernel, the needed synchronisation happens
> as part of local_bh_disable() on the local CPU.
> ____napi_schedule() is only invoked if sd is from the local CPU. Replace
> it with __napi_schedule_irqoff() which already disables interrupts on
> PREEMPT_RT as needed. Move this call to rps_ipi_queued() and rename the
> function to napi_schedule_rps as suggested by Jakub.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>

Reviewed-by: Jakub Kicinski <kuba@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ