All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] x86: re-order struct arch_domain fields
Date: Mon, 19 Jan 2015 17:52:09 +0000	[thread overview]
Message-ID: <54BD4449.9020906@citrix.com> (raw)
In-Reply-To: <54BD33B902000078000568F7@mail.emea.novell.com>

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 <jbeulich@suse.com>
>
> --- 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

  reply	other threads:[~2015-01-19 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 15:41 [PATCH] x86: re-order struct arch_domain fields Jan Beulich
2015-01-19 17:52 ` Andrew Cooper [this message]
2015-01-20  8:20   ` Jan Beulich
2015-02-03  9:45   ` Jan Beulich
2015-02-04 10:56     ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54BD4449.9020906@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.