All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Wang, Wei W" <wei.w.wang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v3 04/11] x86/intel_pstate: relocate the driver register function
Date: Tue, 23 Jun 2015 08:01:42 +0000	[thread overview]
Message-ID: <286AC319A985734F985F78AFA26841F7996F3E@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <558927600200007800087EFA@mail.emea.novell.com>

On 23/06/2015 15:31, Jan Beulich wrote:
> >>> On 23.06.15 at 05:40, <wei.w.wang@intel.com> wrote:
> > On 18/06/2015 22:30, Jan Beulich wrote:
> >> >>> On 11.06.15 at 10:27, <wei.w.wang@intel.com> wrote:
> >> > -static int __init cpufreq_presmp_init(void)
> >> > +int cpufreq_register_driver(struct cpufreq_driver *driver_data)
> >> >  {
> >> >      void *cpu = (void *)(long)smp_processor_id();
> >> >      cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
> >> > +    if (!driver_data || !driver_data->init
> >> > +        || !driver_data->verify || !driver_data->exit
> >> > +        || (!driver_data->target == !driver_data->setpolicy))
> >>
> >> Do you really want/need to enforce this policy (target set if and
> >> only if setpolicy is not set) here? And if that's to uniformly hold,
> >> the two could be put into a union...
> >
> > driver_data->target() is used by a driver which relies on the old
> > Governor framework.
> > driver_data->setpolicy() is used by a driver which implements its
> > internal governor.
> > So, the driver either uses the old Governor framework or has its own
> > private internal governor.
> > We shouldn't change to use union, because in many places, we
> > distinguish the two by checking if it's using "->target" or "->setpolicy".
> 
> The distinction between the two driver modes shouldn't be based on
> arbitrary accessors they may or may not implement. There should be a
> dedicated flag or alike.

This is not arbitrary - "->target()" is dedicated to the Governor framework, and "->setpolicy" is dedicated to the internal governor implementation. The Linux kernel also takes advantage of this method. I think we don't need to add another new functionally equivalent flag to do so.
Shall we keep using it?

Best,
Wei

  reply	other threads:[~2015-06-23  8:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-11  8:27 [PATCH v3 04/11] x86/intel_pstate: relocate the driver register function Wei Wang
2015-06-18 14:30 ` Jan Beulich
2015-06-23  3:40   ` Wang, Wei W
2015-06-23  7:31     ` Jan Beulich
2015-06-23  8:01       ` Wang, Wei W [this message]
2015-06-23  8:11         ` Jan Beulich
2015-06-23  8:24           ` Wang, Wei W
2015-06-23  8:37             ` Jan Beulich

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=286AC319A985734F985F78AFA26841F7996F3E@shsmsx102.ccr.corp.intel.com \
    --to=wei.w.wang@intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.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 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.