xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Wei W Wang <wei.w.wang@intel.com>
Cc: "andrew.cooper3@citrix.com" <andrew.cooper3@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v4 07/11] x86/intel_pstate: the main boby of the intel_pstate driver
Date: Tue, 11 Aug 2015 04:12:43 -0600	[thread overview]
Message-ID: <55C9E6BB020000780009975F@prv-mh.provo.novell.com> (raw)
In-Reply-To: <286AC319A985734F985F78AFA26841F79E4554@shsmsx102.ccr.corp.intel.com>

>>> On 27.07.15 at 11:30, <wei.w.wang@intel.com> wrote:
> On 24/07/2015 21:54,  Jan Beulich wrote:
>> >>> On 25.06.15 at 13:16, <wei.w.wang@intel.com> wrote:
>> > +int __init intel_pstate_init(void)
>> > +{
>> > +	int cpu, rc = 0;
>> > +	const struct x86_cpu_id *id;
>> > +	struct cpu_defaults *cpu_info;
>> > +
>> > +	id = x86_match_cpu(intel_pstate_cpu_ids);
>> > +	if (!id)
>> > +		return -ENODEV;
>> > +
>> > +	cpu_info = (struct cpu_defaults *)id->driver_data;
>> > +
>> > +	copy_pid_params(&cpu_info->pid_policy);
>> > +	copy_cpu_funcs(&cpu_info->funcs);
>> > +
>> > +	if (intel_pstate_msrs_not_valid())
>> > +		return -ENODEV;
>> > +
>> > +	all_cpu_data = xzalloc_array(struct cpudata *, NR_CPUS);
>> > +	if (!all_cpu_data)
>> > +		return -ENOMEM;
>> > +
>> > +	rc = cpufreq_register_driver(&intel_pstate_driver);
>> > +	if (rc)
>> > +		goto out;
>> > +
>> > +	return rc;
>> > +out:
>> > +	for_each_online_cpu(cpu) {
>> > +		if (all_cpu_data[cpu]) {
>> > +			kill_timer(&all_cpu_data[cpu]->timer);
>> > +			xfree(all_cpu_data[cpu]);
>> > +		}
>> > +	}
>> 
>> I have a hard time seeing where in this function the setup happens that is
>> being undone here (keeping in mind that the notifier registration inside
>> cpufreq_register_driver() doesn't actually call the notifier function).
>> 
>> And then, looking at the diff between this and what Linux 4.2-rc3 has (which
>> admittedly looks a little newer than what you sent, so I already subtract
>> some of the delta), it is significantly larger than the source file itself. 
> That
>> surely doesn't suggest a clone-with- minimal-delta. Yet as said before - either
>> you do that, or you accept us picking at things you inherited from Linux.
> 
> I think it's better to choose the latter - picking out things that are useful 
> for us from Linux.
> Can you please take a look this patch and summarize the comments? Thanks.

I'm sorry, but for a first round I'd rather expect _you_ to go through
the code you intend to add and spot possible problems. Only then, on
a submission where you state that you did so, would I want to invest
time in sanity checking things.

And then I hope you realize that the clone-with-minimal-delta would
have benefits on the maintenance side going forward (fewer manual
adjustments needed due to non-applying Linux side changes).

Jan

      reply	other threads:[~2015-08-11 10:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 11:16 [PATCH v4 07/11] x86/intel_pstate: the main boby of the intel_pstate driver Wei Wang
2015-07-24 13:53 ` Jan Beulich
2015-07-27  9:30   ` Wang, Wei W
2015-08-11 10:12     ` Jan Beulich [this message]

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=55C9E6BB020000780009975F@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=wei.w.wang@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).