public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Luca Barbieri <ldb@ldb.ods.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Linux-Kernel ML <linux-kernel@vger.kernel.org>,
	Alexandre Julliard <julliard@winehq.com>
Subject: Re: [patch] tls-2.5.31-C3
Date: 12 Aug 2002 15:43:01 +0200	[thread overview]
Message-ID: <1029159781.4713.52.camel@ldb> (raw)
In-Reply-To: <Pine.LNX.4.44.0208121708050.19150-100000@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]

On Mon, 2002-08-12 at 17:12, Ingo Molnar wrote:
> 
> On 12 Aug 2002, Luca Barbieri wrote:
> 
> > Numbers:
> > unconditional copy of 2 tls descs: 5 cycles
> > this patch with 1 tls desc: 26 cycles
> > this patch with 8 tls descs: 52 cycles
> 
> [ 0 tls descs: 2 cycles. ]
Yes but common multithreaded applications will have at least 1 for
pthreads.

> but yes, this is rougly what i'd say this approach costs.
> 
> > lldt: 51 cycles
> > lgdt: 50 cycles
> > context switch: 2000 cycles (measured with pipe read/write and vmstat so
> > it's not very accurate)
> 
> > So this patch causes a 1% context switch performance drop for
> > multithreaded applications.
> 
> how did you calculate this?
((26 - 5) / 2000) * 100 ~= 1
Benchmarks done in kernel mode (2.4.18) with interrupts disabled on a
Pentium3 running the rdtsc timed benchmark in a loop 1 million times
with 8 unbenchmarked iterations to warm up caches and with the time to
execute an empty benchmark subtracted.

> glibc multithreaded applications can avoid the
> lldt via using the TLS, and thus it's a net win.
Surely, this patch is better than the old LDT method but much worse than
the 2-TLS one.

So I would use the 2-TLS approach plus my patch plus the syscall and
segment.h improvements of the tls-2.5.31-C3 patch plus support for
setting the 0x40 segment around APM calls.

BTW, are there any programs that would benefit from having more than 2
user-settable GDT entries but that don't need more than about 8?
(assuming we have a fixed flat code and data segment and 0x40 segment)


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2002-08-12 13:39 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-07 18:10 [patch] tls-2.5.30-A1 Ingo Molnar
2002-08-07 18:33 ` Linus Torvalds
2002-08-07 18:43   ` Stephen Rothwell
2002-08-07 18:57     ` Linus Torvalds
2002-08-07 19:40       ` Alexandre Julliard
2002-08-07 19:31   ` Ingo Molnar
2002-08-07 19:49     ` Alexandre Julliard
2002-08-07 22:01   ` Alan Cox
2002-08-07 22:36   ` Luca Barbieri
2002-08-07 22:54     ` Ingo Molnar
2002-08-07 23:21       ` Luca Barbieri
2002-08-07 23:35         ` DMA Problems with Intel 845 Chipset and Northwood CPU Mark Cuss
2002-08-08  0:58           ` John L. Korpi
2002-08-08 16:12             ` Mark Cuss
2002-08-11 21:46   ` [patch] tls-2.5.31-C3 Ingo Molnar
2002-08-12  7:34     ` Stephen Rothwell
2002-08-12 10:07       ` Ingo Molnar
2002-08-12  8:23         ` Stephen Rothwell
2002-08-12 10:08           ` Alan Cox
2002-08-12 10:49             ` Ingo Molnar
2002-08-12 10:34               ` Alan Cox
2002-08-12 12:17                 ` Ingo Molnar
2002-08-12 11:47                   ` Alan Cox
2002-08-12 12:55                     ` Ingo Molnar
2002-08-12 12:29                       ` Alan Cox
2002-08-12 10:35               ` Alan Cox
2002-08-12 13:10             ` Kasper Dupont
2002-08-12 15:20             ` Ingo Molnar
2002-08-12 14:46         ` Stephen Rothwell
2002-08-12 12:18     ` Luca Barbieri
2002-08-12 15:12       ` Ingo Molnar
2002-08-12 13:43         ` Luca Barbieri [this message]
2002-08-12 15:57           ` Ingo Molnar
2002-08-12 14:17             ` Luca Barbieri
2002-08-12 15:53     ` [patch] tls-2.5.31-D3 Ingo Molnar
2002-08-12 16:13       ` [patch] tls-2.5.31-D4 Ingo Molnar
2002-08-12 14:32         ` Luca Barbieri
2002-08-12 17:06         ` [patch] tls-2.5.31-D5 Ingo Molnar
2002-08-12 15:21           ` Jakub Jelinek
2002-08-12 17:41             ` Ingo Molnar
2002-08-12 15:54               ` Luca Barbieri
2002-08-12 18:03               ` [patch] tls-2.5.31-D9 Ingo Molnar
2002-08-13  1:50               ` [patch] tls-2.5.31-D5 Alexandre Julliard
2002-08-12 17:24           ` [patch] tls-2.5.31-D7 Ingo Molnar
2002-08-12 15:45             ` Christoph Hellwig
2002-08-07 19:02 ` [patch] tls-2.5.30-A1 Christoph Hellwig
2002-08-08 12:25 ` Jamie Lokier

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=1029159781.4713.52.camel@ldb \
    --to=ldb@ldb.ods.org \
    --cc=julliard@winehq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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