From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758726Ab2CJAfe (ORCPT ); Fri, 9 Mar 2012 19:35:34 -0500 Received: from e37.co.us.ibm.com ([32.97.110.158]:38077 "EHLO e37.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756821Ab2CJAfd (ORCPT ); Fri, 9 Mar 2012 19:35:33 -0500 Message-ID: <1331339714.26253.139.camel@work-vm> Subject: Re: [PATCH] sched, x86: fix overflow in cyc2ns_offset From: john stultz To: Salman Qazi Cc: Ingo Molnar , Paul Turner , Peter Zijlstra , LKML Date: Fri, 09 Mar 2012 16:35:14 -0800 In-Reply-To: References: <20120309235944.12863.28602.stgit@dungbeetle.mtv.corp.google.com> <1331339140.26253.134.camel@work-vm> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12031000-7408-0000-0000-0000035766BB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2012-03-09 at 16:28 -0800, Salman Qazi wrote: > On Fri, Mar 9, 2012 at 4:25 PM, john stultz wrote: > > So... Sorry, why did you change it from the shifted logic? > > > > It's more generally applicable. The compiler is smart enough to do > the right thing in the power-of-two > constant case. > > > > > Is the compiler really smart enough to avoid the divides? > > Yes, it is. I verified that. Ok, great! Thanks again! (Although I probably need to put rewriting the the big x86/include/asm/timer.h comment on my TODO, since its not as relevant anymore) Acked-by: John Stultz Ingo/Thomas, this should probably go tip/timers/urgent & be marked for stable. I can queue it and send you a pull request, but it might be just easier to just pick up the patch. thanks -john