netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yejune Deng <yejune.deng@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, ast@kernel.org,
	andriin@fb.com, daniel@iogearbox.net, edumazet@google.com,
	ap420073@gmail.com, bjorn.topel@intel.com,
	xiyou.wangcong@gmail.com, jiri@mellanox.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	yejune.deng@gmail.com
Subject: [PATCH] net: core: fix msleep() is not accurate
Date: Thu, 10 Dec 2020 17:35:18 +0800	[thread overview]
Message-ID: <1607592918-14356-1-git-send-email-yejune.deng@gmail.com> (raw)

See Documentation/timers/timers-howto.rst, msleep() is not
for (1ms - 20ms), There is a more advanced API is used.

Signed-off-by: Yejune Deng <yejune.deng@gmail.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..6e83ee03 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);
+		fsleep(1000);
 	while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
-		msleep(1);
+		fsleep(1000);
 
 	hrtimer_cancel(&n->timer);
 
-- 
1.9.1


             reply	other threads:[~2020-12-10  9:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10  9:35 Yejune Deng [this message]
2020-12-10 10:19 ` [PATCH] net: core: fix msleep() is not accurate Eric Dumazet
2020-12-11  2:43   ` Yejune Deng
  -- strict thread matches above, loose matches on Subject: below --
2020-12-15  2:04 Yejune Deng
2020-12-16 19:33 ` Jakub Kicinski

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=1607592918-14356-1-git-send-email-yejune.deng@gmail.com \
    --to=yejune.deng@gmail.com \
    --cc=andriin@fb.com \
    --cc=ap420073@gmail.com \
    --cc=ast@kernel.org \
    --cc=bjorn.topel@intel.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).