From: Mike Travis <travis@sgi.com>
To: arges@linux.vnet.ibm.com
Cc: phil.el@wanadoo.fr, mpjohn@us.ibm.com,
Christoph Lameter <clameter@sgi.com>,
Jack Steiner <steiner@sgi.com>, Paul Jackson <pj@sgi.com>,
Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: Hotplug CPU support for Oprofile
Date: Mon, 05 May 2008 12:00:53 -0700 [thread overview]
Message-ID: <481F5965.6070305@sgi.com> (raw)
In-Reply-To: <1210012443.6374.23.camel@snuffleupagus>
[adding some possibly interested parties to the cc line.]
Chris J Arges wrote:
> Mike,
> I was wondering what your rationale behind using per_cpu variables for
> the cpu buffers in oprofile versus using percpu_alloc, percpu_free?
> For instance:
>
> DEFINE_PER_CPU_SHARED_ALIGNED(struct oprofile_cpu_buffer,
> cpu_buffer);
>
> void free_cpu_buffers(void)
> {
> int i;
>
> for_each_online_cpu(i)
> vfree(per_cpu(cpu_buffer, i).buffer);
>
> }
>
> Could it be possible to write it like this:
>
> struct oprofile_cpu_buffer *cpu_buffer;
>
> void free_cpu_buffers(void)
> {
> percpu_free(cpu_buffer);
> }
>
Hi Chris,
There was no particular reason for one or the other. We did have a
patch a few months ago that added CPU_ALLOC functionality that was
much cleaner than percpu_alloc (and replaced it), but due to
circumstances it didn't actually make it into the source base.
The percpu approach was the fallback.
>
> Phillipe, Mike,
> I am currently working on a patch for enabling hotplug cpu support for
> oprofile as currently oprofile crashes whenever cpus are onlined of
> offlined. So far my patch registers a callback function for hotplug
> events, and checked if a cpu has been onlined/offlined and then
> allocs/frees a cpu buffer accordingly.
>
> I am wondering if you have any further recommendations as to approaching
> adding hotplug support. I am still fairly new to oprofile/linux kernel
> but I would like to contribute, please forgive any newbie mistakes.
> Thanks!
>
Other than insuring that any routines for bringing up/tearing down
processors are in the __cpuinit/data sections and test as many
different configs as you can.
Also, increasing NR_CPUS to 4096 is one thing but I've been testing
with "possible" cpus == 4096 and have hit some snags. The biggest
right now is the enormous amount of memory that the kernel tracing
facility requires. So trying out your code with a healthy amount of
possible cpus will expose problems like this.
Another thing that I've encountered is that you can add "additional_cpus"
to the boot line, and the BIOS can signal that there are cpus present
but currently disabled, but there's no way to bring these cpus online
after bootup.
One thought would be to register the cpu but make it offline. This
has some advantages but it was felt that instead something more like:
echo '32-63' > /sys/devices/system/cpu/online
would startup and register cpus 32-63. This is orthogonal to the
showing of which cpu's are online:
# cat /sys/devices/system/cpu/online
0-31
Any suggestions along this area are welcome!
Thanks,
Mike
next parent reply other threads:[~2008-05-05 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1210012443.6374.23.camel@snuffleupagus>
2008-05-05 19:00 ` Mike Travis [this message]
2008-05-05 19:12 ` Hotplug CPU support for Oprofile Christoph Lameter
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=481F5965.6070305@sgi.com \
--to=travis@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=arges@linux.vnet.ibm.com \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mpjohn@us.ibm.com \
--cc=phil.el@wanadoo.fr \
--cc=pj@sgi.com \
--cc=steiner@sgi.com \
/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.