All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] iopoll: Use fsleep() instead of usleep_range()
@ 2025-05-02 13:43 Andy Shevchenko
  2025-06-13  8:48 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2025-05-02 13:43 UTC (permalink / raw)
  To: Anna-Maria Behnsen, linux-kernel; +Cc: Andrew Morton, Andy Shevchenko

Use fsleep() instead of usleep_range() to improve small time delays
by avoiding the timer use. With this, use slightly bigger initial
delays then was passed to usleep_range().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/iopoll.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h
index 91324c331a4b..fca50f117fae 100644
--- a/include/linux/iopoll.h
+++ b/include/linux/iopoll.h
@@ -41,7 +41,7 @@
 	ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \
 	might_sleep_if((__sleep_us) != 0); \
 	if (sleep_before_read && __sleep_us) \
-		usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
+		fsleep((__sleep_us >> 1) + 1); \
 	for (;;) { \
 		(val) = op(args); \
 		if (cond) \
@@ -52,7 +52,7 @@
 			break; \
 		} \
 		if (__sleep_us) \
-			usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
+			fsleep((__sleep_us >> 1) + 1); \
 		cpu_relax(); \
 	} \
 	(cond) ? 0 : -ETIMEDOUT; \
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] iopoll: Use fsleep() instead of usleep_range()
  2025-05-02 13:43 [PATCH v1 1/1] iopoll: Use fsleep() instead of usleep_range() Andy Shevchenko
@ 2025-06-13  8:48 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2025-06-13  8:48 UTC (permalink / raw)
  To: Anna-Maria Behnsen, linux-kernel; +Cc: Andrew Morton

On Fri, May 02, 2025 at 04:43:45PM +0300, Andy Shevchenko wrote:
> Use fsleep() instead of usleep_range() to improve small time delays
> by avoiding the timer use. With this, use slightly bigger initial
> delays then was passed to usleep_range().

Any comments anybody?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-13  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 13:43 [PATCH v1 1/1] iopoll: Use fsleep() instead of usleep_range() Andy Shevchenko
2025-06-13  8:48 ` Andy Shevchenko

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.