From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752179AbdALKcS (ORCPT ); Thu, 12 Jan 2017 05:32:18 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:55192 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbdALKcP (ORCPT ); Thu, 12 Jan 2017 05:32:15 -0500 Date: Thu, 12 Jan 2017 11:32:07 +0100 From: Pavel Machek To: Nicholas Mc Guire Cc: Nicholas Mc Guire , Thomas Gleixner , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH] doc: add note on usleep_range range Message-ID: <20170112103207.GG29366@amd> References: <1481601523-14004-1-git-send-email-hofrat@osadl.org> <20161227215626.GA5336@amd> <20170107194150.GA22557@osadl.at> <20170110212529.GC25738@amd> <20170111085007.GA13195@osadl.at> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zGQnqpIoxlsbsOfg" Content-Disposition: inline In-Reply-To: <20170111085007.GA13195@osadl.at> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zGQnqpIoxlsbsOfg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2017-01-11 08:50:07, Nicholas Mc Guire wrote: > On Tue, Jan 10, 2017 at 10:25:29PM +0100, Pavel Machek wrote: > > Hi! > >=20 > > > > "to have zero jitter" at least. I believe it is "does not". > > > >=20 > > > > I don't see how atomic vs. non-atomic context makes difference. The= re > > > > are sources of jitter that affect atomic context... > > >=20 > > > The relevance is that while there is jitter in atomic context it can > > > be quite small (depending on your hardware and the specifics of system > > > config) but in non-atomic context the jitter is so large that it > > > makes no relevant difference if you give usleep_range slack of a few > > > microseconds. > >=20 > > I disagree here. Even in non-atomic code, you'll get _no_ jitter most > > of the time. If you care about average case, small slack may still > > make sense. >=20 > yes - thats what the results say - the mean does not differe significantly > so if you care about average case - it makes no difference. You did not demonstrate that. > > > usleep_range() 5000 samples - idle system=20 > > > 100,100 200,200 190,200 > > > Min. :188481 Min. :201917 Min. :197793 > > > 1st Qu.:207062 1st Qu.:207057 1st Qu.:207051 > > > Median :207139 Median :207133 Median :207133 > > > Mean :207254 Mean :207233 Mean :207244 > > > 3rd Qu.:207341 erd Qu.:207262 3rd Qu.:207610 > > > Max. :225340 Max. :214222 Max. :214885 > > >=20 > > > 100,200 to 200,200 is maybe relevant impact for > > > some systems with respect to the outliers, but > > > mean and median are almost the same, for > > > 190,200 to 200,200 there is statistically no > > > significant difference with respect to performance > > > Note that the timestamp before and after also has > > > jitter - so only part of the jitter can be attributed > > > to usleep_range() it self. But idle system optimization > > > is not that interesting for most systems. > >=20 > > I disagree here. Most of systems are idle, most of the time. You say > > that basically everyone should provide 50 usec of slack... So I guess > > I'd like to see comparisons for 200,200 and 200,250 (and perhaps also > > 200,500 or something). > > > I did not say that everyone should use 50us of slack - rather the stateme= nt=20 > was "makes no relevant difference if you give usleep_range slack of a few > microseconds." and that min=3D=3Dmax makes *no* sense and that providing= =20 > even just small slack (in 10s of us range) makes a relevant difference=20 > at system level. You did not demonstrate any "relevant difference at system level". Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --zGQnqpIoxlsbsOfg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlh3WycACgkQMOfwapXb+vL5cQCgoQxcayfHZ6LVHBhIWIrkLFhk pXsAn2gsODeYY11CeVxn3czD2KEBgr+Q =E8ar -----END PGP SIGNATURE----- --zGQnqpIoxlsbsOfg--