From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86: re-order struct arch_domain fields Date: Mon, 19 Jan 2015 17:52:09 +0000 Message-ID: <54BD4449.9020906@citrix.com> References: <54BD33B902000078000568F7@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDGUo-0007hR-9o for xen-devel@lists.xenproject.org; Mon, 19 Jan 2015 17:52:14 +0000 In-Reply-To: <54BD33B902000078000568F7@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Keir Fraser List-Id: xen-devel@lists.xenproject.org On 19/01/15 15:41, Jan Beulich wrote: > ... to reduce padding holes. While doing this I noticed vtsc_usercount > is a PV-only thing, so it gets moved straight to struct pv_domain. The vtsc_{user,kernel}count split is curious. They are both for stats purposes alone, but there is nothing pv specific about the usercount. It frankly looks as if it has been mis-implemented for HVM, despite the split appearing to be deliberate when it was introduced in c/s bf2c44f8b469. I am really not sure what to make of it. > > Signed-off-by: Jan Beulich > > --- a/xen/arch/x86/time.c > +++ b/xen/arch/x86/time.c > @@ -1767,7 +1767,7 @@ void pv_soft_rdtsc(struct vcpu *v, struc > if ( guest_kernel_mode(v, regs) ) > d->arch.vtsc_kerncount++; > else > - d->arch.vtsc_usercount++; > + d->arch.pv_domain.vtsc_usercount++; > > if ( (int64_t)(now - d->arch.vtsc_last) > 0 ) > d->arch.vtsc_last = now; > @@ -2020,17 +2020,15 @@ static void dump_softtsc(unsigned char k > printk(",khz=%"PRIu32, d->arch.tsc_khz); > if ( d->arch.incarnation ) > printk(",inc=%"PRIu32, d->arch.incarnation); > - if ( !(d->arch.vtsc_kerncount | d->arch.vtsc_usercount) ) > - { > - printk("\n"); > - continue; > - } > - if ( is_hvm_domain(d) ) > + if ( is_hvm_domain(d) && d->arch.vtsc_kerncount ) > printk(",vtsc count: %"PRIu64" total\n", > d->arch.vtsc_kerncount); > - else > + else if ( is_pv_domain(d) && > + (d->arch.vtsc_kerncount | d->arch.pv_domain.vtsc_usercount) ) I realise you are simply rearanging the logic from before, but this should really be a logic or rather than a bitwise or, and is probably worth tweaking with the movement. ~Andrew