lkml.org 
[lkml]   [2017]   [Dec]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] schedule: use unlikely()
On Tue 2017-11-28 08:22:50, Greg KH wrote:
> On Mon, Nov 27, 2017 at 07:05:22PM -0500, Mikulas Patocka wrote:
> >
> >
> > On Sat, 25 Nov 2017, Greg KH wrote:
> >
> > > 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.
> > > >
> > > > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> > >
> > > 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
> >
> > It is much easier to make microoptimizations (such as using likely() and
> > unlikely()) than to measure their effect.
> >
> > If a programmer were required to measure performance every time he uses
> > likely() or unlikely() in his code, he wouldn't use them at all.
>
> 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
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-12-08 15:31    [W:0.388 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site