Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933799AbcKPUBB (ORCPT ); Wed, 16 Nov 2016 15:01:01 -0500 Received: from mail-yw0-f181.google.com ([209.85.161.181]:35768 "EHLO mail-yw0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752894AbcKPUA6 (ORCPT ); Wed, 16 Nov 2016 15:00:58 -0500 MIME-Version: 1.0 In-Reply-To: <295ab33e-45da-af64-6716-c8f387a0cb20@mellanox.com> References: <1479315472-5245-1-git-send-email-cmetcalf@mellanox.com> <295ab33e-45da-af64-6716-c8f387a0cb20@mellanox.com> From: John Stultz Date: Wed, 16 Nov 2016 12:00:56 -0800 Message-ID: Subject: Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits To: Chris Metcalf Cc: Thomas Gleixner , Salman Qazi , Paul Turner , Tony Lindgren , Steven Miao , lkml Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1553 Lines: 40 On Wed, Nov 16, 2016 at 11:56 AM, Chris Metcalf wrote: > On 11/16/2016 2:45 PM, John Stultz wrote: >> >> On Wed, Nov 16, 2016 at 11:30 AM, Chris Metcalf >> wrote: >>> >>> diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h >>> index 08398182f56e..5444429884b8 100644 >>> --- a/include/linux/clocksource.h >>> +++ b/include/linux/clocksource.h >>> @@ -171,6 +171,10 @@ static inline u32 clocksource_hz2mult(u32 hz, u32 >>> shift_constant) >>> * >>> * Converts cycles to nanoseconds, using the given mult and shift. >>> * >>> + * The code is optimized for performance and not intended to work >>> + * with absolute clocksource cycles, as it will easily overflow, >>> + * but just intended for relative (delta) clocksource cycles. >>> + * >>> * XXX - This could use some mult_lxl_ll() asm optimization >> >> Just as a heads up, it seems your working against an older kernel, as >> this didn't apply. Its simple enough to fix up, so I'll do so, but in >> the future, please submit patches against something close to Linus >> HEAD. > > > Oops, sorry; it wasn't version skew (I'm at v4.9-rc4) but whitespace damage. > I assumed if I just pasted the patch into Thunderbird it would work, since > it had > no tabs. But bizarrely, if I look at the patch in the mailer, it shows a > two-space > prefix, but when I save the email to a file, it has a three-space prefix. > WTF? Yea. Not many mailers can be trusted with sending patches. I'd recommend git-send-email. :) thanks -john