All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhu Yanjun <yanjun.zhu@linux.dev>
To: Andrew Lunn <andrew@lunn.ch>, Heng Qi <hengqi@linux.alibaba.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
	Zhu Yanjun <yanjun.zhu@intel.com>,
	mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	virtualization@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang
Date: Sat, 20 Jan 2024 12:21:05 +0800	[thread overview]
Message-ID: <cb1aed07-47f8-48a2-91e7-a66b3237cb5b@linux.dev> (raw)
In-Reply-To: <430b899c-aed4-419d-8ae8-544bb9bec5d9@lunn.ch>


在 2024/1/20 1:29, Andrew Lunn 写道:
>>>>>        while (!virtqueue_get_buf(vi->cvq, &tmp) &&
>>>>> -           !virtqueue_is_broken(vi->cvq))
>>>>> +           !virtqueue_is_broken(vi->cvq)) {
>>>>> +        if (timeout)
>>>>> +            timeout--;
>>>> This is not really a timeout, just a loop counter. 200 iterations could
>>>> be a very short time on reasonable H/W. I guess this avoid the soft
>>>> lockup, but possibly (likely?) breaks the functionality when we need to
>>>> loop for some non negligible time.
>>>>
>>>> I fear we need a more complex solution, as mentioned by Micheal in the
>>>> thread you quoted.
>>> Got it. I also look forward to the more complex solution to this problem.
>> Can we add a device capability (new feature bit) such as ctrq_wait_timeout
>> to get a reasonable timeout?
> The usual solution to this is include/linux/iopoll.h. If you can sleep
> read_poll_timeout() otherwise read_poll_timeout_atomic().

Thanks. The 2 functions read_poll_timeout() and 
read_poll_timeout_atomic() are interesting.

Zhu Yanjun

>
> 	Andrew

  reply	other threads:[~2024-01-20  4:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15  1:29 [PATCH 1/1] virtio_net: Add timeout handler to avoid kernel hang Zhu Yanjun
2024-01-15  2:20 ` Jason Wang
2024-01-15 10:25   ` Zhu Yanjun
     [not found]   ` <6cf2699a-483d-4124-9782-b6a771a41e70@linux.dev>
2024-01-22  3:06     ` Jason Wang
2024-01-16 12:04 ` Paolo Abeni
2024-01-18 12:01   ` Zhu Yanjun
2024-01-19 14:27     ` Heng Qi
2024-01-19 17:29       ` Andrew Lunn
2024-01-20  4:21         ` Zhu Yanjun [this message]
2024-01-22  2:12         ` Zhu Yanjun
2024-01-22  3:14           ` Jason Wang
2024-01-22  3:58             ` Xuan Zhuo
2024-01-22  4:16               ` Jason Wang
2024-01-22  6:16                 ` Xuan Zhuo
2024-01-22  6:55                   ` Jason Wang
2024-01-22  6:58                     ` Jason Wang
2024-01-22  7:02                       ` Xuan Zhuo
2024-01-22  7:19                         ` Jason Wang
2024-01-22  7:25                           ` Xuan Zhuo
2024-01-22  7:57                             ` Jason Wang
2024-01-22  8:01                               ` Xuan Zhuo
2024-01-22  8:32                                 ` Jason Wang
2024-01-22  9:11                                   ` Xuan Zhuo
     [not found]                         ` <e46d04d7-4eb7-4fcd-821a-d558c07531b7@linux.dev>
2024-01-26  3:13                           ` Zhu Yanjun
2024-01-22  7:01                     ` Xuan Zhuo
2024-01-22  3:08       ` Jason Wang
2024-01-22  4:42         ` Heng Qi
2024-01-18 13:14   ` Michael S. Tsirkin
2024-01-19  1:42     ` Xuan Zhuo

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=cb1aed07-47f8-48a2-91e7-a66b3237cb5b@linux.dev \
    --to=yanjun.zhu@linux.dev \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=yanjun.zhu@intel.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.