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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Dec 2020 10:04:25 +0800
From:   Yejune Deng <yejune.deng@...il.com>
To:     davem@...emloft.net, kuba@...nel.org, ast@...nel.org,
        andriin@...com, jiri@...lanox.com, edumazet@...gle.com,
        ap420073@...il.com, bjorn.topel@...el.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        yejune.deng@...il.com
Subject: [PATCH] net: core: fix msleep() is not accurate

See Documentation/timers/timers-howto.rst, msleep() is not
for (1ms - 20ms), use usleep_range() instead.

Signed-off-by: Yejune Deng <yejune.deng@...il.com>
---
 net/core/dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index d33099f..c0aa52f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6726,9 +6726,9 @@ void napi_disable(struct napi_struct *n)
 	set_bit(NAPI_STATE_DISABLE, &n->state);
 
 	while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
-		msleep(1);
+		usleep_range(10, 200);
 	while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
-		msleep(1);
+		usleep_range(10, 200);
 
 	hrtimer_cancel(&n->timer);
 
-- 
1.9.1

Powered by blists - more mailing lists