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] [day] [month] [year] [list]
Message-ID: <6e55048e-53ed-c196-729d-f7a5ab3c82fe@redhat.com>
Date:   Wed, 25 Nov 2020 14:21:12 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Leon Romanovsky <leon@...nel.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Petr Mladek <pmladek@...e.com>,
        John Ogness <john.ogness@...utronix.de>,
        virtualization@...ts.linux-foundation.org,
        Amit Shah <amit@...nel.org>, Itay Aveksis <itayav@...dia.com>,
        Ran Rozenstein <ranro@...dia.com>,
        netdev <netdev@...r.kernel.org>
Subject: Re: netconsole deadlock with virtnet


On 2020/11/25 上午12:20, Jakub Kicinski wrote:
> On Tue, 24 Nov 2020 11:22:03 +0800 Jason Wang wrote:
>>>> Perhaps you need the trylock in virtnet_poll_tx()?
>>> That could work. Best if we used normal lock if !!budget, and trylock
>>> when budget is 0. But maybe that's too hairy.
>> If we use trylock, we probably lose(or delay) tx notification that may
>> have side effects to the stack.
> That's why I said only trylock with budget == 0. Only netpoll calls with
> budget == 0, AFAIK.


Oh right.

So I think maybe we can switch to use trylock when budget is zero and 
try to schedule another TX NAPI if we trylock fail.


>
>>> I'm assuming all this trickiness comes from virtqueue_get_buf() needing
>>> locking vs the TX path? It's pretty unusual for the completion path to
>>> need locking vs xmit path.
>> Two reasons for doing this:
>>
>> 1) For some historical reason, we try to free transmitted tx packets in
>> xmit (see free_old_xmit_skbs() in start_xmit()), we can probably remove
>> this if we remove the non tx interrupt mode.
>> 2) virtio core requires virtqueue_get_buf() to be synchronized with
>> virtqueue_add(), we probably can solve this but it requires some non
>> trivial refactoring in the virtio core
>>
>> Btw, have a quick search, there are several other drivers that uses tx
>> lock in the tx NAPI.
> Unless they do:
>
> 	netdev->priv_flags |= IFF_DISABLE_NETPOLL;
>
> they are all broken.


Yes.

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ