linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andi Kleen <ak@suse.de>,
	davidm@hpl.hp.com, linux-kernel@vger.kernel.org, rth@twiddle.net
Subject: Re: [PATCH] 2.5.1-pre5: per-cpu areas
Date: Tue, 19 Mar 2002 01:15:34 +0100	[thread overview]
Message-ID: <20020319011534.A32751@wotan.suse.de> (raw)
In-Reply-To: <20020318083511.A19810@wotan.suse.de> <E16n74r-00024V-00@wagner.rustcorp.com.au>

On Tue, Mar 19, 2002 at 11:02:09AM +1100, Rusty Russell wrote:
> In message <20020318083511.A19810@wotan.suse.de> you write:
> > On Sun, Mar 17, 2002 at 06:17:32PM +1100, Rusty Russell wrote:
> > > On Fri, 15 Mar 2002 10:13:09 +0100
> > > Andi Kleen <ak@suse.de> wrote:
> > > 
> > > > On Fri, Mar 15, 2002 at 03:07:27PM +1100, Rusty Russell wrote:
> > > > > They must return an lvalue, otherwise they're useless for 50% of cases
> > > > > (ie. assignment).  x86_64 can still use its own mechanism for
> > > > > arch-specific per-cpu data, of course.
> > > > 
> > > > Assignment should use an own macro (set_this_cpu()) or use per_cpu().
> > > 
> > > So, we'd have "get_this_cpu(x)" and "set_this_cpu(x, y)".  So far, so good.
> > > 
> > > 	struct myinfo
> > > 	{
> > > 		int x;
> > > 		int y;
> > > 	};
> > > 
> > > 	static struct myinfo mystuff __per_cpu_data;
> > > 
> > > Now how do we set mystuff.x on this CPU?
> > 
> > set_this_cpu(mystuff.x, y) could be eventually supported properly, it just
> > needs compiler work (and before that can use address calculation & reference)
> 
> I think the effort would be better spent on teaching the compiler
> about these special variables, and how to do efficient assignments on
> them.

That would be the idea. gcc would learn how to use the %gs segment prefix
(similar to the equivalent feature in Windows compilers). The only
drawback is that it still cannot easily load the address except if you
define some silly convention (like a pointer to the segment base being
always stored at the segment base address) 

But it is a lot of work to teach gcc about the multiple address spaces...

-Andi

  parent reply	other threads:[~2002-03-19  0:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15504.7958.677592.908691@napali.hpl.hp.com.suse.lists.linux.kernel>
     [not found] ` <E16lMzi-0002bb-00@wagner.rustcorp.com.au.suse.lists.linux.kernel>
2002-03-14  8:39   ` [PATCH] 2.5.1-pre5: per-cpu areas Andi Kleen
2002-03-14 11:09     ` Rusty Russell
2002-03-14 11:14       ` Andi Kleen
2002-03-14 19:48       ` H. Peter Anvin
2002-03-14 18:04   ` David Mosberger
2002-03-14 18:51     ` Andi Kleen
2002-03-15  4:07       ` Rusty Russell
2002-03-15  9:13         ` Andi Kleen
2002-03-17  7:17         ` Rusty Russell
2002-03-18  7:35           ` Andi Kleen
2002-03-19  0:02             ` Rusty Russell
2002-03-19  0:08               ` J.A. Magallon
2002-03-19  0:15               ` Andi Kleen [this message]
2002-03-19 17:05                 ` Richard Henderson
2002-03-15  4:19       ` David Mosberger
2002-03-15  5:52         ` Rusty Russell
     [not found] <15504.7958.677592.908691@napali.hpl.hp.com>
2002-03-14  4:37 ` Rusty Russell
2002-03-14  5:05   ` Jeff Garzik
2002-03-14 11:14     ` Rusty Russell
2002-03-14 11:26       ` Jeff Garzik
2002-03-14 12:16         ` Rusty Russell
2002-03-14 12:25           ` Jeff Garzik
2002-03-15  1:00         ` Richard Henderson
2002-03-14  9:37   ` Richard Henderson
2002-03-14 18:06   ` David Mosberger
2001-12-05 22:09 Rusty Russell
2001-12-06  7:21 ` Keith Owens
2001-12-06  8:07 ` David S. Miller
2001-12-06  9:18 ` Chris Wedgwood
2001-12-07 15:03   ` Pavel Machek

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=20020319011534.A32751@wotan.suse.de \
    --to=ak@suse.de \
    --cc=davidm@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --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;
as well as URLs for NNTP newsgroup(s).