Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1674890

RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies.

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From David Laight <David.Laight@ACULAB.COM>
Newsgroups linux.kernel
Subject RE: [PATCH] soc/qman: Sleep instead of stuck hacking jiffies.
Date Mon, 26 Jun 2017 18:00:01 +0200
Message-ID <tWEAF-4e5-1@gated-at.bofh.it> (permalink)
References <tWhuq-6If-15@gated-at.bofh.it>
X-Original-To 'Karim Eshapa' <karim.eshapa@gmail.com>, "oss@buserror.net" <oss@buserror.net>
Thread-Topic [PATCH] soc/qman: Sleep instead of stuck hacking jiffies.
Thread-Index AQHS7cXVh/2WCtpWx0e0tdxY1qDPZKI3TJ3A
Accept-Language en-GB, en-US
Content-Language en-US
X-Originating-IP [10.202.99.200]
Content-Type text/plain; charset="Windows-1252"
Content-Transfer-Encoding 8BIT
MIME-Version 1.0
X-Outbound-IP 156.67.243.126
X-Env-From David.Laight@ACULAB.COM
X-Proto esmtps
X-Helo AcuExch.aculab.com
X-Tls TLSv1:AES128-SHA:128
X-Policysmart 3396946, 3397078
X-Virus-Status Scanned by VirusSMART (c)
X-Virus-Status Scanned by VirusSMART (s)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 28
Organization linux.* mail to news gateway
X-Original-Cc "roy.pledge@nxp.com" <roy.pledge@nxp.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "claudiu.manoil@nxp.com" <claudiu.manoil@nxp.com>, "colin.king@canonical.com" <colin.king@canonical.com>, "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>
X-Original-Date Mon, 26 Jun 2017 15:54:30 +0000
X-Original-Message-ID <063D6719AE5E284EB5DD2968C1650D6DD002B1A5@AcuExch.aculab.com>
X-Original-References <1498403622-2878-1-git-send-email-karim.eshapa@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1674890

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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