mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Richard Henderson <rth@twiddle.net>
Cc: Andrew Morton <akpm@zip.com.au>,
	linux-kernel@vger.kernel.org, torvalds@transmeta.com,
	kuznet@ms2.inr.ac.ru
Subject: Re: [PATCH] per-cpu areas for 2.5.3-pre6
Date: Thu, 31 Jan 2002 09:45:45 +1100	[thread overview]
Message-ID: <E16W3U9-0004Pd-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Wed, 30 Jan 2002 00:22:04 -0800." <20020130002204.A4480@are.twiddle.net>

In message <20020130002204.A4480@are.twiddle.net> you write:
> Have we already forgotten the ppc reloc flamefest?  Better
> written as
>
> #define per_cpu(var, cpu)					\
>   ({ __typeof__(&(var)) __ptr;					\
>      __asm__ ("" : "=g"(__ptr)					\
> 	      : "0"((void *)&(var) + per_cpu_offset(cpu)));	\
>      *__ptr; })

"better".  Believe me, I was fully aware, but I refuse to write such
crap unless *proven* to be required.

> > +/* Created by linker magic */
> > +extern char __per_cpu_start, __per_cpu_end;
> [...]
> > +	per_cpu_size = ((&__per_cpu_end - &__per_cpu_start) + PAGE_SIZE-1)
> 
> Will fail on targets (e.g. alpha and mips) that have a notion of a
> "small data area" that can be addressed with special relocs.
> 
> Better written as
> 
>   extern char __per_cpu_start[], __per_cpu_end[];
>   per_cpu_size = (__per_cpu_end - __per_cpu_start) ...

I agree that this is much better.  But do not understand what small
relocs have to do with simple address arithmetic?  You've always been
right before: what am I missing?

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

  reply	other threads:[~2002-01-30 22:45 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
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 [this message]
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=E16W3U9-0004Pd-00@wagner.rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@zip.com.au \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    --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

Powered by JetHome