Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1674890
| From | David Laight <David.Laight@ACULAB.COM> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies. |
| Date | 2017-06-26 18:00 +0200 |
| Message-ID | <tWEAF-4e5-1@gated-at.bofh.it> (permalink) |
| References | <tWhuq-6If-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Karim Eshapa
> Sent: 25 June 2017 16:14
> Use msleep() instead of stucking with
> long delay will be more efficient.
...
> --- a/drivers/soc/fsl/qbman/qman.c
> +++ b/drivers/soc/fsl/qbman/qman.c
> @@ -1084,11 +1084,7 @@ static int drain_mr_fqrni(struct qm_portal *p)
> * entries well before the ring has been fully consumed, so
> * we're being *really* paranoid here.
> */
> - u64 now, then = jiffies;
> -
> - do {
> - now = jiffies;
> - } while ((then + 10000) > now);
> + msleep(1);
...
How is that in any way equivalent?
If HZ is 1000 the old code loops for 10 seconds.
If HZ is 250 (common for some distros) it loops for 40 seconds.
Clearly both are horrid, but it isn't at all clear that a 1ms sleep
is performing the same job.
My guess is that this code is never called, and broken if actually called.
David
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] soc/qman: Sleep instead of stuck hacking jiffies. Karim Eshapa <karim.eshapa@gmail.com> - 2017-06-25 17:20 +0200
RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies. David Laight <David.Laight@ACULAB.COM> - 2017-06-26 18:00 +0200
RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies. Leo Li <leoyang.li@nxp.com> - 2017-06-27 18:50 +0200
csiph-web