Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751618AbZGSGM4 (ORCPT ); Sun, 19 Jul 2009 02:12:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750715AbZGSGMz (ORCPT ); Sun, 19 Jul 2009 02:12:55 -0400 Received: from casper.infradead.org ([85.118.1.10]:54179 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbZGSGMz convert rfc822-to-8bit (ORCPT ); Sun, 19 Jul 2009 02:12:55 -0400 Date: Sat, 18 Jul 2009 23:14:29 -0700 From: Arjan van de Ven To: Chris Snook Cc: john stultz , lkml , Thomas Gleixner , Ingo Molnar , Andi Kleen , nikolag@ca.ibm.com, Darren Hart Subject: Re: [RFC][PATCH] Introduce CLOCK_REALTIME_COARSE Message-ID: <20090718231429.7ddea95f@infradead.org> In-Reply-To: <13a12eea0907182000v654e38a5l265ae5bdadb1a175@mail.gmail.com> References: <1247873945.8334.67.camel@localhost.localdomain> <13a12eea0907182000v654e38a5l265ae5bdadb1a175@mail.gmail.com> Organization: Intel X-Mailer: Claws Mail 3.7.1 (GTK+ 2.14.7; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1697 Lines: 37 On Sat, 18 Jul 2009 23:00:55 -0400 Chris Snook wrote: > On Fri, Jul 17, 2009 at 7:39 PM, john stultz > wrote: > > -       if (likely(gtod->sysctl_enabled && gtod->clock.vread)) > > +       if (likely(gtod->sysctl_enabled)) > > This irks me. If the sysctl is enabled and the codepath is getting > used often enough that we care about performance, branch prediction > should do the right thing without compiler hints. On the other hand, > if the sysctl is disabled, and the compiler is telling the cpu to > ignore its branch predictor, it'll hurt. I don't think we should be > wrapping (un)likely annotations around configuration options, unless > we're biasing against debug conditions where we definitely don't care > about performance. The patch is certainly no worse than the existing > code, but while we have the hood up, it might be nice to remove the > annotation, unless we're sure that it does no harm, and does some > good. it's on x86.. likely/unlikely don't impact the CPU (since there are no "ignore the branch predictor" hints), only the code placement..... (and that's probably a good thing; CPU branch predictors are pretty good, I'd not be surprised if they're at least as good as the programmers who think how they code is used) -- Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/