xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 04/11] x86/intel_pstate: avoid calling cpufreq_add_cpu() twice
@ 2015-06-25 11:15 Wei Wang
  2015-07-24 13:35 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Wang @ 2015-06-25 11:15 UTC (permalink / raw)
  To: jbeulich, andrew.cooper3, xen-devel; +Cc: Wei Wang

cpufreq_add_cpu() is already called in the hypercall code path
(the bottom of set_px_pminfo() and inside cpufreq_cpu_init()).
So, we remove the redundant calling here.

v4 changes:
None.

Signed-off-by: Wei Wang <wei.w.wang@intel.com>
---
 xen/drivers/cpufreq/cpufreq.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c
index ab66884..91b6c25 100644
--- a/xen/drivers/cpufreq/cpufreq.c
+++ b/xen/drivers/cpufreq/cpufreq.c
@@ -632,8 +632,6 @@ static struct notifier_block cpu_nfb = {
 
 static int __init cpufreq_presmp_init(void)
 {
-    void *cpu = (void *)(long)smp_processor_id();
-    cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
     register_cpu_notifier(&cpu_nfb);
     return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 04/11] x86/intel_pstate: avoid calling cpufreq_add_cpu() twice
  2015-06-25 11:15 [PATCH v4 04/11] x86/intel_pstate: avoid calling cpufreq_add_cpu() twice Wei Wang
@ 2015-07-24 13:35 ` Jan Beulich
  2015-07-27  7:35   ` Wang, Wei W
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2015-07-24 13:35 UTC (permalink / raw)
  To: Wei Wang; +Cc: andrew.cooper3, xen-devel

>>> On 25.06.15 at 13:15, <wei.w.wang@intel.com> wrote:
> cpufreq_add_cpu() is already called in the hypercall code path
> (the bottom of set_px_pminfo() and inside cpufreq_cpu_init()).
> So, we remove the redundant calling here.

While I can see that currently the call is kind of pointless (as it can't
do anything useful before Dom0 communicated the data obtained
from ACPI), it's still logically correct to call the callback on the BP
prior to registering a hook for AP bringup. Otherwise you could (and
perhaps should) as well defer the CPU notifier registration.

Otoh now that you're trying to introduce a driver independent of
ACPI (and hence initialized at boot time) I wonder why you don't
make use of what is here instead of deleting it.

Jan

> --- a/xen/drivers/cpufreq/cpufreq.c
> +++ b/xen/drivers/cpufreq/cpufreq.c
> @@ -632,8 +632,6 @@ static struct notifier_block cpu_nfb = {
>  
>  static int __init cpufreq_presmp_init(void)
>  {
> -    void *cpu = (void *)(long)smp_processor_id();
> -    cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
>      register_cpu_notifier(&cpu_nfb);
>      return 0;
>  }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 04/11] x86/intel_pstate: avoid calling cpufreq_add_cpu() twice
  2015-07-24 13:35 ` Jan Beulich
@ 2015-07-27  7:35   ` Wang, Wei W
  0 siblings, 0 replies; 3+ messages in thread
From: Wang, Wei W @ 2015-07-27  7:35 UTC (permalink / raw)
  To: Jan Beulich; +Cc: andrew.cooper3, xen-devel

On 24/07/2015 21:36,  Jan Beulich wrote:
> >>> On 25.06.15 at 13:15, <wei.w.wang@intel.com> wrote:
> > cpufreq_add_cpu() is already called in the hypercall code path (the
> > bottom of set_px_pminfo() and inside cpufreq_cpu_init()).
> > So, we remove the redundant calling here.
> 
> While I can see that currently the call is kind of pointless (as it can't do
> anything useful before Dom0 communicated the data obtained from ACPI),
> it's still logically correct to call the callback on the BP prior to registering a hook
> for AP bringup. Otherwise you could (and perhaps should) as well defer the
> CPU notifier registration.
> 
> Otoh now that you're trying to introduce a driver independent of ACPI (and
> hence initialized at boot time) I wonder why you don't make use of what is
> here instead of deleting it.
> 

Ok, I will roll back to leave cpufreq_presmp_init() there.

Best,
Wei
> 
> > --- a/xen/drivers/cpufreq/cpufreq.c
> > +++ b/xen/drivers/cpufreq/cpufreq.c
> > @@ -632,8 +632,6 @@ static struct notifier_block cpu_nfb = {
> >
> >  static int __init cpufreq_presmp_init(void)  {
> > -    void *cpu = (void *)(long)smp_processor_id();
> > -    cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
> >      register_cpu_notifier(&cpu_nfb);
> >      return 0;
> >  }
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-27  7:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 11:15 [PATCH v4 04/11] x86/intel_pstate: avoid calling cpufreq_add_cpu() twice Wei Wang
2015-07-24 13:35 ` Jan Beulich
2015-07-27  7:35   ` Wang, Wei W

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).