public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
Cc: linux-kernel@vger.kernel.org,
	Chuck Ebbert <76306.1226@compuserve.com>,
	Zachary Amsden <zach@vmware.com>,
	Jan Beulich <jbeulich@novell.com>, Andi Kleen <ak@suse.de>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH RFC 0/6] Implement per-processor data areas for i386.
Date: Sun, 27 Aug 2006 10:34:46 -0700	[thread overview]
Message-ID: <44F1D7B6.80105@goop.org> (raw)
In-Reply-To: <20060827172155.GA21724@rhlx01.fht-esslingen.de>

Andreas Mohr wrote:
> This is interesting, since even by doing a non-elegant
> current->... --> struct task_struct *tsk = current;
> replacement for excessive uses of current, I was able to gain almost 10kB
> within a single file already!
> I guess it's due to having tried that on an older installation with gcc 3.2,
> which probably does less efficient opcode merging of current_thread_info()
> requests compared to a current gcc version.
> IOW, .text segment reduction could be quite a bit higher for older gcc:s.
>   

That doesn't sound likely.  current_thread_info() is only about 2 
instructions.  Are you looking at the .text segment size, or the actual 
file size?  The latter can be very misleading in the presence of debug info.

>> This uses the x86 segmentation stuff in a way similar to NPTL's way of
>> implementing Thread-Local Storage.  It relies on the fact that each CPU
>> has its own Global Descriptor Table (GDT), which is basically an array
>> of base-length pairs (with some extra stuff).  When a segment register
>> is loaded with a descriptor (approximately, an index in the GDT), and
>> you use that segment register for memory access, the address has the
>> base added to it, and the resulting address is used.
>>     
>
> Not a problem for more daring user-space apps (i.e. Wine), I hope?
>   

No.  The LDT is still available for userspace use.

    J

  reply	other threads:[~2006-08-27 17:34 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-27  8:44 [PATCH RFC 0/6] Implement per-processor data areas for i386 Jeremy Fitzhardinge
2006-08-27  8:44 ` [PATCH RFC 1/6] Basic definitions for i386-pda Jeremy Fitzhardinge
2006-08-27  8:44 ` [PATCH RFC 2/6] Initialize the per-CPU data area Jeremy Fitzhardinge
2006-08-27  8:44 ` [PATCH RFC 3/6] Use %gs as the PDA base-segment in the kernel Jeremy Fitzhardinge
2006-08-27  9:49   ` Keith Owens
2006-08-27 10:01     ` Jeremy Fitzhardinge
2006-08-27 15:57   ` Andi Kleen
2006-08-27 16:36     ` Jeremy Fitzhardinge
2006-08-27 17:20     ` Jeremy Fitzhardinge
2006-08-27 18:19       ` Andi Kleen
2006-08-27 20:03         ` Jan Engelhardt
2006-08-27 23:38         ` Jeremy Fitzhardinge
2006-08-28  9:51         ` Jan Beulich
2006-08-28 14:54           ` H. J. Lu
2006-08-28 17:24         ` H. Peter Anvin
2006-08-27  8:44 ` [PATCH RFC 4/6] Fix places where using %gs changes the usermode ABI Jeremy Fitzhardinge
2006-08-27 15:59   ` Andi Kleen
2006-08-27 16:37     ` Jeremy Fitzhardinge
2006-08-27  8:44 ` [PATCH RFC 5/6] Implement smp_processor_id() with the PDA Jeremy Fitzhardinge
2006-08-27  8:44 ` [PATCH RFC 6/6] Implement "current" " Jeremy Fitzhardinge
2006-08-27 16:01   ` Andi Kleen
2006-08-27 16:38     ` Jeremy Fitzhardinge
2006-08-27  9:47 ` [PATCH RFC 0/6] Implement per-processor data areas for i386 Arjan van de Ven
2006-08-27 16:46   ` Jeremy Fitzhardinge
2006-08-27 17:44     ` Arjan van de Ven
2006-08-27 18:07       ` Andi Kleen
2006-08-27 18:27         ` Jeremy Fitzhardinge
2006-08-27 16:01 ` Andi Kleen
2006-08-27 16:41   ` Jeremy Fitzhardinge
2006-08-27 17:21 ` Andreas Mohr
2006-08-27 17:34   ` Jeremy Fitzhardinge [this message]
2006-08-27 18:23     ` Andreas Mohr
2006-08-27 18:04   ` Andi Kleen
2006-08-27 18:27     ` Andreas Mohr
2006-08-27 18:35       ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2006-08-28  9:06 Chuck Ebbert
2006-08-30  9:00 Chuck Ebbert
2006-08-30  9:17 ` Jeremy Fitzhardinge
2006-08-30 12:33 Chuck Ebbert
2006-08-30 12:54 ` Andi Kleen
2006-08-30 16:39 ` Jeremy Fitzhardinge
2006-08-30 16:48   ` Andi Kleen
2006-08-30 17:13     ` Jeremy Fitzhardinge
2006-08-30 17:32       ` Andi Kleen

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=44F1D7B6.80105@goop.org \
    --to=jeremy@goop.org \
    --cc=76306.1226@compuserve.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=andi@rhlx01.fht-esslingen.de \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zach@vmware.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