From: Dipankar Sarma <dipankar@in.ibm.com>
To: rusty@rustcorp.com.au
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] New per-cpu patch v2.5.1
Date: Thu, 20 Dec 2001 17:43:35 +0530 [thread overview]
Message-ID: <20011220174335.A10791@in.ibm.com> (raw)
Hi Rusty,
I appreciate the noble gesture of allowing NUMA people to
locate the per-cpu areas in different places in memory ;-)
That said, memcpy of static per-cpu areas doesn't seem right.
Why copy the same area to all the dynamically allocated per-cpu
areas ? Also, shouldn't the size be &__per_cpu_end - &__per_cpu_start ?
And how do we use this with per-cpu data used right
from smp boot, say apic_timer_irqs[] ?
Thanks
Dipankar
--
Dipankar Sarma <dipankar@in.ibm.com> http://lse.sourceforge.net
Linux Technology Center, IBM Software Lab, Bangalore, India.
In article <E16GwUZ-0004xr-00@wagner.rustcorp.com.au> Rusty Russell wrote:
> After some discussion, this may be a more sane (untested) per-cpu area
> patch. It dynamically allocated the sections (and discards the
> original), which would allow (future) NUMA people to make sure their
> CPU area is allocated near them.
> Comments welcome,
> Rusty.
> --
> Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
> /* Called by boot processor to activate the rest. */
> static void __init smp_init(void)
> {
> + unsigned int i;
> + size_t per_cpu_size;
> +
> /* Get other processors into their bootup holding patterns. */
> smp_boot_cpus();
> wait_init_idle = cpu_online_map;
> @@ -324,6 +328,16 @@
> barrier();
> }
> printk("All processors have done init_idle\n");
> +
> + /* Set up per-CPU section pointers. Page align to be safe. */
> + per_cpu_size = ((&__per_cpu_end - &__per_cpu_start) + PAGE_SIZE-1)
> + & ~(PAGE_SIZE-1);
> + per_cpu_off[0] = kmalloc(per_cpu_size * smp_num_cpus, GFP_KERNEL);
> + for (i = 0; i < smp_num_cpus; i++) {
> + per_cpu_off[i] = per_cpu_off[0] + per_cpu_size;
> + memcpy(per_cpu_off[i], &__per_cpu_start,
> + __per_cpu_end - &__per_cpu_start);
> + }
> }
>
> #endif
next reply other threads:[~2001-12-20 12:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-20 12:13 Dipankar Sarma [this message]
2001-12-27 6:50 ` [PATCH] New per-cpu patch v2.5.1 Rusty Russell
2002-01-13 5:52 ` Rusty Russell
-- strict thread matches above, loose matches on Subject: below --
2001-12-20 6:15 Rusty Russell
2001-12-20 6:24 ` Robert Love
2001-12-26 0:39 ` Rusty Russell
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=20011220174335.A10791@in.ibm.com \
--to=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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