From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mlroi-00043B-84 for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:08:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mlrod-00040u-Oo for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:08:35 -0400 Received: from [199.232.76.173] (port=35645 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mlrod-00040p-Io for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:08:31 -0400 Received: from mail-yw0-f203.google.com ([209.85.211.203]:60422) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mlrod-0007ma-7r for qemu-devel@nongnu.org; Thu, 10 Sep 2009 18:08:31 -0400 Received: by ywh41 with SMTP id 41so764746ywh.19 for ; Thu, 10 Sep 2009 15:08:30 -0700 (PDT) Message-ID: <4AA978DB.90301@codemonkey.ws> Date: Thu, 10 Sep 2009 17:08:27 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 05/26] Unexport ticks_per_sec variable. Create get_ticks_per_sec() function References: <4AA939B3.6000103@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org, Juan Quintela malc wrote: > On Thu, 10 Sep 2009, Anthony Liguori wrote: > > >> malc wrote: >> >>> My problem with this patch is that it is completely pointless, touches >>> a gob of places and the fact that you apparently never seen what a >>> function call entails on PPC64 (any ABI). >>> >>> >> But there is nothing to suggest this variable is every in the fast path >> so any overhead argument is unfounded. >> >> More importantly, using a function to access this variable gives us the >> ability to change how the behavior is implemented without touching a gob of >> places. >> >> > > Untill such an ability is needed, the patch adds nothing, Except that it eliminates the possibility of misusing the interface and setting it somewhere it shouldn't be. It makes the code more defensive because you cannot accidentally use it like it's a local variable. The key bit of the patch is: -int64_t ticks_per_sec; +static int64_t ticks_per_sec; That is *always* a worthwhile change to make. We need more patches like this. Regards, Anthony Liguori