mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [PATCH] per-cpu areas for 2.5.3-pre6
Date: Wed, 30 Jan 2002 09:09:33 +1100	[thread overview]
Message-ID: <E16VgRZ-0007Kf-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Tue, 29 Jan 2002 01:22:30 -0800." <3C5669D6.B81E0B4@zip.com.au>

In message <3C5669D6.B81E0B4@zip.com.au> you write:
> Rusty Russell wrote:
> > 
> > This patch introduces the __per_cpu_data tag for data, and the
> > per_cpu() & this_cpu() macros to go with it.
> > 
> > This allows us to get rid of all those special case structures
> > springing up all over the place for CPU-local data.
> 
> Am I missing something? smp_init() is called quite late in
> the boot process, and if any code touches per-cpu data before
> this, it'll get a null pointer deref, won't it?

Yes.  But for a large amount of code it doesn't matter, and most
architectures don't know how many CPUs there are before smp_init().
Of course, we could make it NR_CPUS...

Do you have an example where you want to use this before
smp_boot_cpus()?  If so, we can bite the bullet.  Otherwise I'd prefer
not to waste memory.

BTW, my master plan (well, stolen from Anton and Paulus here) was to
have one register to point to the per-cpu area, and all you need is a
shift down 12 bits, and with 31 to get cpu id.  Bwahahahah! (non-x86
of course).

Cheers,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2002-01-29 22:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-29  9:01 Rusty Russell
2002-01-29  9:22 ` Andrew Morton
2002-01-29 22:09   ` Rusty Russell [this message]
2002-01-29 22:21     ` Andrew Morton
2002-01-30  0:48       ` Rusty Russell
2002-01-30  0:49         ` Andrew Morton
2002-01-30  2:00         ` Rusty Russell
2002-01-30  2:12           ` Linus Torvalds
2002-01-30  4:13             ` Rusty Russell
2002-01-30  8:22           ` Richard Henderson
2002-01-30 22:45             ` Rusty Russell
2002-01-31  5:49               ` Richard Henderson
2002-02-01  8:56                 ` Rusty Russell
2002-02-01 16:52                   ` Richard Henderson
2002-01-29 23:17 ` Oliver Xymoron
2002-01-29 23:36   ` Linus Torvalds
2002-01-30  0:20     ` Oliver Xymoron
2002-01-30  0:44       ` Rusty Russell
2002-01-30  7:00         ` Oliver Xymoron
2002-01-30 19:43           ` Oliver Xymoron
2002-01-30 23:00             ` 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=E16VgRZ-0007Kf-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 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®