From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751827AbcGMOcY (ORCPT ); Wed, 13 Jul 2016 10:32:24 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35458 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751117AbcGMOcQ (ORCPT ); Wed, 13 Jul 2016 10:32:16 -0400 From: Nicolai Stange To: Paolo Bonzini Cc: Peter Zijlstra , Nicolai Stange , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Borislav Petkov , Viresh Kumar , Hidehiro Kawai , Len Brown , "Christopher S. Hall" , Adrian Hunter , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/3] arch, x86, tsc deadline clockevent dev: reduce frequency roundoff error References: <20160713130344.8319-1-nicstange@gmail.com> <20160713130344.8319-2-nicstange@gmail.com> <20160713134900.GU30154@twins.programming.kicks-ass.net> Date: Wed, 13 Jul 2016 16:31:51 +0200 In-Reply-To: (Paolo Bonzini's message of "Wed, 13 Jul 2016 15:51:57 +0200") Message-ID: <8737ndtxrc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.94 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Paolo Bonzini writes: > On 13/07/2016 15:49, Peter Zijlstra wrote: >> On Wed, Jul 13, 2016 at 03:03:42PM +0200, Nicolai Stange wrote: >> >>> clockevents_config_and_register(levt, >>> + (u32)(((u64)tsc_khz * 1000) / >>> + TSC_DIVISOR), >>> 0xF, ~0UL); >> >> div_u64() perhaps ? > > Or just squash together the two patches and do > > tsc_khz * (1000 / TSC_DIVISOR) > > because with TSC_DIVISOR equal to 2/4/8 there is no error from > reassociating the operation. Oh great, I didn't see this. Will resend. Thanks, Nicolai