xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Luwei Kang <luwei.kang@intel.com>
Cc: andrew.cooper3@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2] x86/vpmu: add cpu hot unplug notifier for vpmu
Date: Thu, 18 May 2017 09:03:23 -0400	[thread overview]
Message-ID: <07f2ab1f-e850-f8ac-99e3-8503cbe464fb@oracle.com> (raw)
In-Reply-To: <591D8063020000780015AC63@prv-mh.provo.novell.com>

On 05/18/2017 05:07 AM, Jan Beulich wrote:
>>>> On 17.05.17 at 17:57, <luwei.kang@intel.com> wrote:
>> @@ -581,9 +582,14 @@ static void vpmu_arch_destroy(struct vcpu *v)
>>  
>>      if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_destroy )
>>      {
>> -        /* Unload VPMU first. This will stop counters */
>> -        on_selected_cpus(cpumask_of(vcpu_vpmu(v)->last_pcpu),
>> -                         vpmu_save_force, v, 1);
>> +        /*
>> +         * Unload VPMU first if VPMU_CONTEXT_LOADED being set.
>> +         * This will stop counters.
>> +         */
>> +        if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
>> +            on_selected_cpus(cpumask_of(vcpu_vpmu(v)->last_pcpu),
>> +                             vpmu_save_force, v, 1);
>> +
>>           vpmu->arch_vpmu_ops->arch_vpmu_destroy(v);
>>      }
>>  }
> So this is a good step towards what was requested during v1 review,
> provided it is correct (I'll let Boris comment). 

From correctness perspective I don't see any problems.

As I said last time, I'd rename cpu_callback() to something less
generic, like vpmu_cpu_callback() (or vpmu_cpuhp_callback()).

> You didn't, however, do
> anything about the other unguarded last_pcpu uses (in vpmu_load()
> and upwards from the code above in vpmu_arch_destroy()). These
> _may_ be implicitly fine, but if so please at least add suitable
> ASSERT()s.

I wonder whether we should have such an ASSERT() in on_selected_cpus()
instead.

-boris



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-05-18 13:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 15:57 [PATCH v2] x86/vpmu: add cpu hot unplug notifier for vpmu Luwei Kang
2017-05-18  9:07 ` Jan Beulich
2017-05-18 11:51   ` Kang, Luwei
2017-05-18 13:06     ` Jan Beulich
2017-05-18 13:19       ` Jan Beulich
2017-05-18 14:23       ` Kang, Luwei
2017-05-19  6:21         ` Jan Beulich
2017-05-22  2:08           ` Kang, Luwei
2017-05-18 13:03   ` Boris Ostrovsky [this message]
2017-05-18 13:16     ` Jan Beulich
2017-05-18 14:56       ` Dario Faggioli

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=07f2ab1f-e850-f8ac-99e3-8503cbe464fb@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=luwei.kang@intel.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).