From: "Jan Beulich" Subject: Re: [PATCH v2 1/5] x86/hpet: Pre cleanup Date: Fri, 08 Nov 2013 11:40:34 +0000 Message-ID: <527CDBC20200007800101298@nat28.tlf.novell.com> References: <1383838105-9775-1-git-send-email-andrew.cooper3@citrix.com> <1383838105-9775-2-git-send-email-andrew.cooper3@citrix.com> <527CC1A602000078001011B7@nat28.tlf.novell.com> <527CBED9.7060706@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VekQX-0003gA-Vy for xen-devel@lists.xenproject.org; Fri, 08 Nov 2013 11:40:38 +0000 In-Reply-To: <527CBED9.7060706@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Keir Fraser , Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 08.11.13 at 11:37, Andrew Cooper wrote: > On 08/11/13 09:49, Jan Beulich wrote: >>>>> On 07.11.13 at 16:28, Andrew Cooper wrote: >>> * Change some instances of per_cpu($foo, cpu) to this_cpu($foo). It is >>> cleaner to read, and makes it more obvious when the code is poking around >>> in >>> another cpus data. >> Documentation wise this is certainly desirable, but since our this_cpu(), >> other than e.g. Linux'es equivalents, internally does another >> smp_processor_id(), generate code becomes worse. > > with an "unsigned int cpu = smp_processor_id()" in context, the > generated code appears to be identical. In the case here yes. But that changes if there's e.g. a function call between the two accesses. >>> * Convert hpet_next_event() to taking a struct hpet_event_channel *, and >>> rename to __hpet_set_counter() for a more accurate description of its >>> actions. >> I very much think we should get away from the habit of prefixing >> symbols with two underscores: Such names are reserved to the >> compiler/platform, and the standard specifically reserves names >> starting with one underscore (and not followed by an upper case >> letter) for use a file scope symbols. This is what I'd like to request >> be done here. > > So what would you suggest? Here, all the __$foo() are designed to end > up similar to large swathes of other Xen code, implying that the > appropriate spinlock should be held by the caller. > > I am not too fussed which convention we use, so long as it is used > consistently. We obviously can't switch to the single-underscore model in one go. But there are examples of this in the tree already, and I'm trying to stick to this unless someone tells me not to. In the end it'll really depend on others' opinions (albeit avoiding to violate the standard is imo sufficiently strong an argument by itself). Jan