From: "Michael S. Tsirkin" <mst@redhat.com>
To: Mirza Ishan Beg <seedandsyntax@gmail.com>
Cc: virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, "Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>
Subject: Re: [PATCH] virtio_pci_modern: replace msleep(1) with usleep_range(1000, 2000)
Date: Mon, 17 Aug 2026 15:55:16 -0400 [thread overview]
Message-ID: <20260817155125-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260817170331.219615-2-seedandsyntax@gmail.com>
On Mon, Aug 17, 2026 at 10:33:31PM +0530, Mirza Ishan Beg wrote:
> On Sun, Aug 16, 2026 at 05:38:06PM -0400, Michael S. Tsirkin wrote:
> > why do we care?
>
> Hi Michael,
>
> The motivation originally came from a checkpatch.pl warning, but looking directly at Documentation/timers/timers-howto.rst,
> there is a practical penalty here.
>
> The documentation explicitly notes for the 1-20ms range: "msleep(1~20) may not do what the caller intends, and will often sleep longer (~20 ms actual sleep for any value given in the 1~20ms range)."
>
> In these queue reset loops, using msleep(1) means each iteration may be extended to 10-20ms depending on HZ and timer slack. The document recommends using usleep_range() to avoid this overhead and provide the intended precision.
>
> Let me know if you'd like this explanation folded into a v2 commit message.
>
> --
> Mirza
I don't think we care anyway. We probably just want fsleep?
prev parent reply other threads:[~2026-08-17 19:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-16 9:43 [PATCH] virtio_pci_modern: replace msleep(1) with usleep_range(1000, 2000) Mirza Ishan Beg
2026-08-16 21:38 ` Michael S. Tsirkin
2026-08-17 17:03 ` Mirza Ishan Beg
2026-08-17 19:55 ` Michael S. Tsirkin [this message]
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=20260817155125-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=seedandsyntax@gmail.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xuanzhuo@linux.alibaba.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.