Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760659Ab2FUXSp (ORCPT ); Thu, 21 Jun 2012 19:18:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37942 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759188Ab2FUXSo (ORCPT ); Thu, 21 Jun 2012 19:18:44 -0400 Date: Thu, 21 Jun 2012 16:18:42 -0700 From: Andrew Morton To: "H. Peter Anvin" , mingo@kernel.org, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, torvalds@linux-foundation.org, zheng.z.yan@intel.com, tglx@linutronix.de, linux-tip-commits@vger.kernel.org Subject: Re: [tip:perf/core] perf/x86: Add generic Intel uncore PMU support Message-Id: <20120621161842.9319cb99.akpm@linux-foundation.org> In-Reply-To: <20120621161558.824d7c6b.akpm@linux-foundation.org> References: <1339741902-8449-6-git-send-email-zheng.z.yan@intel.com> <20120621154334.05a74517.akpm@linux-foundation.org> <4FE3A495.1030008@zytor.com> <20120621155159.239aa972.akpm@linux-foundation.org> <4FE3A9DF.20303@zytor.com> <20120621161558.824d7c6b.akpm@linux-foundation.org> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1584 Lines: 39 On Thu, 21 Jun 2012 16:15:58 -0700 Andrew Morton wrote: > On Thu, 21 Jun 2012 16:10:23 -0700 > "H. Peter Anvin" wrote: > > > On 06/21/2012 03:51 PM, Andrew Morton wrote: > > > > > > What *is* significant is the effect of a signedness change upon > > > arithmetic, conversions, warnings, etc. And whether such a change > > > might actually introduce bugs. > > > > > > > > > Back away and ask the broader questions: why did ktime_t choose > > > unsigned? Is time a signed concept? What is the right thing to do > > > here, from a long-term design perspective? > > > > Time is definitely a signed concept -- it has no beginning or end (well, > > the Big Bang, but the __110 Myr or so uncertainty of the exact timing of > > the Big Bang makes it a horridly awkward choice for epoch.) > > > > Now, for some users of time you can inherently guarantee there will > > never be any references to time before a particular event, e.g. system > > boot, in which case an unsigned number might make sense, but as a whole > > I think using a signed type as time_t in nearly all Unix implementation > > was The Right Thing. > > > > So why is ktime_t unsigned? err, actually, it isn't. But lots of the APIs to manipulate ktime_t use u64. Reason? I do agree that time quantities should be signed. -- 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/