From: Thomas Gleixner <tglx@linutronix.de>
To: Vikas Shivappa <vikas.shivappa@linux.intel.com>
Cc: vikas.shivappa@intel.com, x86@kernel.org,
linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
peterz@infradead.org, ravi.v.shankar@intel.com,
tony.luck@intel.com, fenghua.yu@intel.com,
kanaka.d.juvva@intel.com, h.peter.anvin@intel.com
Subject: Re: [PATCH 2/5] x86/mbm: Intel Memory B/W Monitoring enumeration and init
Date: Wed, 24 Feb 2016 11:22:47 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.11.1602241118120.3670@nanos> (raw)
In-Reply-To: <1455152873-30467-3-git-send-email-vikas.shivappa@linux.intel.com>
On Wed, 10 Feb 2016, Vikas Shivappa wrote:ar
> +static int intel_mbm_init(void)
> +{
> + int ret = 0, array_size, maxid = cqm_max_rmid + 1;
> +
> + mbm_socket_max = cpumask_weight(&cqm_cpumask);
This should use the new topology_max_packages() function, so you can alloc
your array correctly even if not all sockets are online/plugged yet.
> + array_size = sizeof(struct sample) * maxid * mbm_socket_max;
> + mbm_local = kmalloc(array_size, GFP_KERNEL);
> + if (!mbm_local) {
> + ret = -ENOMEM;
return -ENOMEM is sufficient here.
> + goto out;
> + }
> +
> + mbm_total = kmalloc(array_size, GFP_KERNEL);
> + if (!mbm_total) {
> + kfree(mbm_local);
> + ret = -ENOMEM;
> + }
> +out:
> +
> + return ret;
> +}
> +
> cqm_l3_scale = boot_cpu_data.x86_cache_occ_scale;
> @@ -1384,14 +1520,34 @@ static int __init intel_cqm_init(void)
>
> __perf_cpu_notifier(intel_cqm_cpu_notifier);
You really should register the notifier _AFTER_ registering the pmu. That
needs to be fixed anyway, because the existing code leaks the notifier AND
memory in case perf_pmu_register fails.
Thanks,
tglx
next prev parent reply other threads:[~2016-02-24 10:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 1:07 [PATCH V4 0/5] x86/mbm : Intel Memory Bandwidth monitoring support Vikas Shivappa
2016-02-11 1:07 ` [PATCH 1/5] x86,perf/cqm : Fix cqm handling of grouping events into a cache_group Vikas Shivappa
2016-02-11 1:07 ` [PATCH 2/5] x86/mbm: Intel Memory B/W Monitoring enumeration and init Vikas Shivappa
2016-02-24 10:22 ` Thomas Gleixner [this message]
2016-02-24 18:12 ` Vikas Shivappa
2016-02-24 19:21 ` Thomas Gleixner
2016-02-24 20:05 ` Vikas Shivappa
2016-02-11 1:07 ` [PATCH 3/5] x86/mbm: Memory bandwidth monitoring event management Vikas Shivappa
2016-02-11 1:07 ` [PATCH 4/5] x86/mbm: RMID Recycling MBM changes Vikas Shivappa
2016-02-11 1:07 ` [PATCH 5/5] x86/mbm: Add support for MBM counter overflow handling Vikas Shivappa
2016-02-24 10:36 ` Thomas Gleixner
2016-02-24 18:13 ` Vikas Shivappa
2016-02-24 19:21 ` Thomas Gleixner
2016-02-17 18:52 ` [PATCH V4 0/5] x86/mbm : Intel Memory Bandwidth monitoring support Vikas Shivappa
2016-02-17 19:11 ` Thomas Gleixner
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=alpine.DEB.2.11.1602241118120.3670@nanos \
--to=tglx@linutronix.de \
--cc=fenghua.yu@intel.com \
--cc=h.peter.anvin@intel.com \
--cc=hpa@zytor.com \
--cc=kanaka.d.juvva@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.v.shankar@intel.com \
--cc=tony.luck@intel.com \
--cc=vikas.shivappa@intel.com \
--cc=vikas.shivappa@linux.intel.com \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®