From: Jani Nikula <jani.nikula@intel.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org,
Thomas Gleixner <tglx@linutronix.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
ville.syrjala@linux.intel.com
Subject: Re: [PATCH] iopoll: use fsleep() instead of usleep_range()
Date: Thu, 03 Jul 2025 15:45:10 +0300 [thread overview]
Message-ID: <d5ab9db3940ae708dcbe784bc2f85563ec9755df@intel.com> (raw)
In-Reply-To: <2axg64hx4qjg3hvk27du4yifoojpemkzht2kuxzecuggomrbyv@difktc36et6m>
On Wed, 02 Jul 2025, Andi Shyti <andi.shyti@kernel.org> wrote:
> Hi Jani,
>
> On Thu, Jun 26, 2025 at 05:51:19PM +0300, Jani Nikula wrote:
>> Sometimes it's necessary to poll with long sleeps, and the accuracy of
>> usleep_range() is overkill. Use the flexible sleep helper fsleep() for
>> sleeping in the read_poll_timeout() family of macros to automatically
>> choose the appropriate method of waiting.
>>
>> Functionally there are a few consequences for existing users:
>>
>> - 10 us and shorter sleeps will use usleep() instead of
>> usleep_range(). Presumably this will not be an issue.
>>
>> - When it leads to a slack of less than 25%, msleep() will be used
>> instead of usleep_range(). Presumably this will not be an issue, given
>> the sleeps will be longer in this case.
>>
>> - Otherwise, the usleep_range() slack gets switched from the begin of
>> the range to the end of the range, i.e. [sleep/2+1..sleep] ->
>> [sleep..sleep+sleep/2]. In theory, this could be an issue in some
>> cases, but difficult to determine before this hits the real world.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> this patch makes sense to me even with the fixes in the commit
> message suggested byt Geert.
>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Thanks! However I think Ville's series [1] should have more priority
here. It's mostly orthogonal, but IMO it's more important and should go
first. I can follow up with this one afterwards.
BR,
Jani.
[1] https://lore.kernel.org/r/20250702223439.19752-1-ville.syrjala@linux.intel.com
--
Jani Nikula, Intel
prev parent reply other threads:[~2025-07-03 12:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 14:51 [PATCH] iopoll: use fsleep() instead of usleep_range() Jani Nikula
2025-06-26 14:59 ` Geert Uytterhoeven
2025-06-26 15:16 ` Jani Nikula
2025-06-26 18:41 ` ✓ i915.CI.BAT: success for " Patchwork
2025-06-27 9:55 ` ✓ i915.CI.Full: " Patchwork
2025-07-02 18:16 ` [PATCH] " Andi Shyti
2025-07-03 12:45 ` Jani Nikula [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=d5ab9db3940ae708dcbe784bc2f85563ec9755df@intel.com \
--to=jani.nikula@intel.com \
--cc=andi.shyti@kernel.org \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=ville.syrjala@linux.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.