From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754121AbdLHO3v (ORCPT ); Fri, 8 Dec 2017 09:29:51 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:58727 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753608AbdLHO3s (ORCPT ); Fri, 8 Dec 2017 09:29:48 -0500 Date: Fri, 8 Dec 2017 15:29:39 +0100 From: Pavel Machek To: Greg KH Cc: Mikulas Patocka , Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH] schedule: use unlikely() Message-ID: <20171208142939.GG7793@amd> References: <20171125085644.GA1843@kroah.com> <20171128072250.GA10757@kroah.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fnm8lRGFTVS/3GuM" Content-Disposition: inline In-Reply-To: <20171128072250.GA10757@kroah.com> 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 --Fnm8lRGFTVS/3GuM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue 2017-11-28 08:22:50, Greg KH wrote: > On Mon, Nov 27, 2017 at 07:05:22PM -0500, Mikulas Patocka wrote: > >=20 > >=20 > > On Sat, 25 Nov 2017, Greg KH wrote: > >=20 > > > On Mon, Nov 13, 2017 at 02:00:45PM -0500, Mikulas Patocka wrote: > > > > A small patch for schedule(), so that the code goes straght in the = common > > > > case. > > > >=20 > > > > Signed-off-by: Mikulas Patocka > > >=20 > > > Was this a measurable difference? If so, great, please provide the > > > numbers and how you tested in the changelog. If it can't be measured, > > > then it is not worth it to add these markings > >=20 > > It is much easier to make microoptimizations (such as using likely() an= d=20 > > unlikely()) than to measure their effect. > >=20 > > If a programmer were required to measure performance every time he uses= =20 > > likely() or unlikely() in his code, he wouldn't use them at all. >=20 > If you can not measure it, you should not use it. You are forgetting > about the testing that was done a few years ago that found that some > huge percentage (80? 75? 90?) of all of these markings were wrong and > harmful or did absolutely nothing. If Mikulas has enough data that particular if() is usually taken or not, that should be enough. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --Fnm8lRGFTVS/3GuM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAloqodMACgkQMOfwapXb+vJ9hwCgwW/QYRESbGRDI+BO90umwhIj i9oAoIgcAqzak9ePMQECfNvWVsFS9H4F =JJ6E -----END PGP SIGNATURE----- --Fnm8lRGFTVS/3GuM--