Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Kevin D. Kissell" <kevink@mips.com>
To: "Daniel Jacobowitz" <dan@debian.org>
Cc: "Dominic Sweetman" <dom@algor.co.uk>,
	"Ralf Baechle" <ralf@oss.sgi.com>,
	"Ulrich Drepper" <drepper@redhat.com>,
	"Mike Uhler" <uhler@mips.com>,
	"MIPS/Linux List \(SGI\)" <linux-mips@oss.sgi.com>,
	"GNU libc hacker" <libc-hacker@sources.redhat.com>,
	"H . J . Lu" <hjl@lucon.org>
Subject: Re: thread-ready ABIs
Date: Tue, 22 Jan 2002 17:05:45 +0100	[thread overview]
Message-ID: <007601c1a35e$b3e3f940$0deca8c0@Ulysses> (raw)
In-Reply-To: 20020122102128.A11455@nevyn.them.org

Tue, Jan 22, 2002 at 01:18:03PM +0100, Kevin D. Kissell wrote:
> > I think that the problem is complicated by the fact that
> > there may be a many->many mapping of kernel threads
> > (and CPUs) to user-land threads.  In that case, no single
> > low-memory address can be correct for all kernel threads.
> > However, since every kernel thread should have its own
> > stack segment, it would appear to me that having a
> > variable "under" the stack would satisfy the need for
> > per-kernel-thread storage at a knowable location.
> > I suspect that there is a second-order problem in that
> > the base stack address may differ for instances of
> > the same binary launched under different circumstances.
> > But I don't think that renders the problem impossible.
> > One could have a global pointer, resolvable at link
> > time, which could be set to SP+delta by whatever
> > we call crt0 these days, and which should provide the
> > required semantics.  Each user thread startup or 
> 
> Resolvable at link time and set by crt0 seem to be mutually
> exclusive... but perhaps I'm misunderstanding you.

You are.  The *address* of the pointer to the pointer
can be resolved at link time.  The *value* of the pointer
to the pointer is set by crt0 (if stack origins are not
intrinsically fixed at link time - if they are, the indirection
is not necessary).

> In any case, that's not the real problem.  Linux user threads do not
> have true separate stacks.  They share their _entire_ address space;
> the stacks are all bounded (default is 2MB) and grouped together at the
> top of the available memory region.

Exactly.  But if all we all we are worried about is thread
specific data for user threads multiplexed on exactly
one kernel thread, we could probably get by with a
simple global variable for the thread pointer for the
current user thread running in the process.   It's the
case of multiple user threads running within multiple
*kernel* threads (e.g. created by fork()) that complicates
things, and makes people want to use a register
or other storage resource associated with exactly one
kernel thread (and CPU).  A permanently assigned
register, as we have seen, creates various complications,
so I'm looking for another kernel-thread-specific resource,
of which I believe the stack region is the best candidate.
Each process/task/program would have a single global
variable, which points to a common address in the
stack region of each kernel thread, which is used
to store the address of the user-thread-specific
data of the user thread executing on that kernel thread.

Of course, I still haven't seen an informed description
of the actual problem that Ulrich and H.J. are trying to
solve, so it may in fact be simpler (or more complex).

            Regards,

            Kevin K.

WARNING: multiple messages have this Message-ID (diff)
From: "Kevin D. Kissell" <kevink@mips.com>
To: Daniel Jacobowitz <dan@debian.org>
Cc: Dominic Sweetman <dom@algor.co.uk>,
	Ralf Baechle <ralf@oss.sgi.com>,
	Ulrich Drepper <drepper@redhat.com>, Mike Uhler <uhler@mips.com>,
	"MIPS/Linux List (SGI)" <linux-mips@oss.sgi.com>,
	GNU libc hacker <libc-hacker@sources.redhat.com>,
	"H . J . Lu" <hjl@lucon.org>
Subject: Re: thread-ready ABIs
Date: Tue, 22 Jan 2002 17:05:45 +0100	[thread overview]
Message-ID: <007601c1a35e$b3e3f940$0deca8c0@Ulysses> (raw)
Message-ID: <20020122160545.2trnaPrkxBYbcpEjsDpaUs8YgcUOv3vpZM5t3eBGZ8Y@z> (raw)
In-Reply-To: 20020122102128.A11455@nevyn.them.org

Tue, Jan 22, 2002 at 01:18:03PM +0100, Kevin D. Kissell wrote:
> > I think that the problem is complicated by the fact that
> > there may be a many->many mapping of kernel threads
> > (and CPUs) to user-land threads.  In that case, no single
> > low-memory address can be correct for all kernel threads.
> > However, since every kernel thread should have its own
> > stack segment, it would appear to me that having a
> > variable "under" the stack would satisfy the need for
> > per-kernel-thread storage at a knowable location.
> > I suspect that there is a second-order problem in that
> > the base stack address may differ for instances of
> > the same binary launched under different circumstances.
> > But I don't think that renders the problem impossible.
> > One could have a global pointer, resolvable at link
> > time, which could be set to SP+delta by whatever
> > we call crt0 these days, and which should provide the
> > required semantics.  Each user thread startup or 
> 
> Resolvable at link time and set by crt0 seem to be mutually
> exclusive... but perhaps I'm misunderstanding you.

You are.  The *address* of the pointer to the pointer
can be resolved at link time.  The *value* of the pointer
to the pointer is set by crt0 (if stack origins are not
intrinsically fixed at link time - if they are, the indirection
is not necessary).

> In any case, that's not the real problem.  Linux user threads do not
> have true separate stacks.  They share their _entire_ address space;
> the stacks are all bounded (default is 2MB) and grouped together at the
> top of the available memory region.

Exactly.  But if all we all we are worried about is thread
specific data for user threads multiplexed on exactly
one kernel thread, we could probably get by with a
simple global variable for the thread pointer for the
current user thread running in the process.   It's the
case of multiple user threads running within multiple
*kernel* threads (e.g. created by fork()) that complicates
things, and makes people want to use a register
or other storage resource associated with exactly one
kernel thread (and CPU).  A permanently assigned
register, as we have seen, creates various complications,
so I'm looking for another kernel-thread-specific resource,
of which I believe the stack region is the best candidate.
Each process/task/program would have a single global
variable, which points to a common address in the
stack region of each kernel thread, which is used
to store the address of the user-thread-specific
data of the user thread executing on that kernel thread.

Of course, I still haven't seen an informed description
of the actual problem that Ulrich and H.J. are trying to
solve, so it may in fact be simpler (or more complex).

            Regards,

            Kevin K.

  parent reply	other threads:[~2002-01-22 17:05 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3elkoa5dw.fsf@myware.mynet>
2002-01-18 18:19 ` thread-ready ABIs H . J . Lu
2002-01-18 18:31   ` Ulrich Drepper
2002-01-18 19:08     ` H . J . Lu
2002-01-18 19:20       ` Ulrich Drepper
2002-01-19 12:14         ` Dominic Sweetman
2002-01-19 12:14           ` Dominic Sweetman
2002-01-20  0:14     ` Ralf Baechle
2002-01-18 20:03   ` Maciej W. Rozycki
2002-01-18 20:20     ` Ulrich Drepper
2002-01-18 20:50       ` Maciej W. Rozycki
2002-01-18 21:02         ` Ulrich Drepper
2002-01-18 21:35           ` Maciej W. Rozycki
2002-01-18 21:44             ` Ulrich Drepper
2002-01-18 22:17               ` Maciej W. Rozycki
2002-01-18 21:23   ` Daniel Jacobowitz
2002-01-19  0:35   ` Kevin D. Kissell
2002-01-19  0:35     ` Kevin D. Kissell
2002-01-19  4:11     ` H . J . Lu
2002-01-19 12:27       ` Dominic Sweetman
2002-01-19 19:42         ` H . J . Lu
2002-01-21 13:27           ` Maciej W. Rozycki
2002-01-19 22:21         ` Kevin D. Kissell
2002-01-19 22:21           ` Kevin D. Kissell
2002-01-20 10:38       ` Machida Hiroyuki
2002-01-20 11:58         ` Kevin D. Kissell
2002-01-20 11:58           ` Kevin D. Kissell
2002-01-20 13:16           ` Machida Hiroyuki
2002-01-22  6:27             ` patches for test-and-set without ll/sc (Re: thread-ready ABIs) Machida Hiroyuki
2002-01-22  6:37               ` Ulrich Drepper
2002-01-22  6:46                 ` Machida Hiroyuki
2002-01-22  6:56                   ` Ulrich Drepper
2002-01-24  9:56                 ` Andreas Jaeger
2002-01-24  9:56                   ` Andreas Jaeger
2002-01-20 19:19           ` thread-ready ABIs H . J . Lu
2002-01-21  9:39             ` Kevin D. Kissell
2002-01-21  9:39               ` Kevin D. Kissell
2002-01-21 13:56               ` Maciej W. Rozycki
2002-01-21 18:24                 ` H . J . Lu
2002-01-21 18:36                   ` Ulrich Drepper
2002-01-21 18:52                     ` H . J . Lu
2002-01-21 18:58                       ` H . J . Lu
2002-01-21 18:59                       ` Daniel Jacobowitz
2002-01-21 19:05                         ` H . J . Lu
2002-01-21 19:09                           ` Daniel Jacobowitz
2002-01-21 19:18                             ` H . J . Lu
2002-01-21 21:04                         ` Kevin D. Kissell
2002-01-21 21:04                           ` Kevin D. Kissell
2002-01-21 19:30                       ` Geoff Keating
2002-01-21 21:07                       ` Ulrich Drepper
2002-01-21 13:43             ` Maciej W. Rozycki
2002-01-20  0:24     ` Ralf Baechle
2002-01-21 23:22       ` Ulrich Drepper
2002-01-21 23:57         ` Kevin D. Kissell
2002-01-21 23:57           ` Kevin D. Kissell
2002-01-22  0:16           ` Ulrich Drepper
2002-01-22  0:16             ` Ulrich Drepper
2002-01-22  9:37             ` Dominic Sweetman
2002-01-22  9:37               ` Dominic Sweetman
2002-01-22 17:41               ` Ulrich Drepper
2002-01-22 17:41                 ` Ulrich Drepper
2002-01-22  9:59           ` Dominic Sweetman
2002-01-22  9:59             ` Dominic Sweetman
2002-01-22 12:18             ` Kevin D. Kissell
2002-01-22 12:18               ` Kevin D. Kissell
2002-01-22 15:21               ` Daniel Jacobowitz
2002-01-22 15:44                 ` Dominic Sweetman
2002-01-22 21:44                   ` Tommy S. Christensen
2002-01-22 21:53                     ` Kevin D. Kissell
2002-01-22 21:53                       ` Kevin D. Kissell
2002-01-22 23:13                       ` Kevin D. Kissell
2002-01-22 23:13                         ` Kevin D. Kissell
2002-01-23  1:12                     ` Jason Gunthorpe
2002-01-22 16:05                 ` Kevin D. Kissell [this message]
2002-01-22 16:05                   ` Kevin D. Kissell
2002-01-22 16:34                   ` Daniel Jacobowitz
2002-01-22 17:08                     ` Kevin D. Kissell
2002-01-22 17:08                       ` Kevin D. Kissell
2002-01-22 17:13                       ` Daniel Jacobowitz
2002-01-22 17:34                         ` Kevin D. Kissell
2002-01-22 17:34                           ` Kevin D. Kissell
2002-01-22 17:37                           ` Daniel Jacobowitz
2002-01-22 17:47                             ` Kevin D. Kissell
2002-01-22 17:47                               ` Kevin D. Kissell
2002-01-22 17:57                               ` Daniel Jacobowitz
2002-01-22 18:18                                 ` Kevin D. Kissell
2002-01-22 18:18                                   ` Kevin D. Kissell
2002-01-27 20:24                         ` Alan Cox
2002-01-27 20:24                           ` Alan Cox
2002-01-28  8:50                           ` Kevin D. Kissell
2002-01-28  8:50                             ` Kevin D. Kissell
2002-01-22  1:39   ` Richard Henderson
2002-01-18 21:24 Justin Carlson
2002-01-18 21:31 ` Ulrich Drepper
2002-01-18 21:42 ` Maciej W. Rozycki

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='007601c1a35e$b3e3f940$0deca8c0@Ulysses' \
    --to=kevink@mips.com \
    --cc=dan@debian.org \
    --cc=dom@algor.co.uk \
    --cc=drepper@redhat.com \
    --cc=hjl@lucon.org \
    --cc=libc-hacker@sources.redhat.com \
    --cc=linux-mips@oss.sgi.com \
    --cc=ralf@oss.sgi.com \
    --cc=uhler@mips.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