All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] 4KB stack + irq stack for x86
Date: Wed, 5 Jun 2002 14:43:57 -0400	[thread overview]
Message-ID: <20020605144357.A4697@redhat.com> (raw)
In-Reply-To: <20020604225539.F9111@redhat.com> <Pine.LNX.4.44.0206050820100.2941-100000@home.transmeta.com>

On Wed, Jun 05, 2002 at 08:33:13AM -0700, Linus Torvalds wrote:
> So, as far as I can tell, we now get a nasty aliasing issue on
> "current_thread_info()->flags", and information like NEED_RESCHED and
> SIGPENDING end up being set in the wrong place. They get set on the
> _interrupt_ thread_info, not the "process native" thread_info.
> 
> Or did I miss some subtlety?

Ah, you're right.  If anyone uses current_thread_info from IRQ context 
it will set the flags in the wrong structure.  However, it actually 
works because nobody does that currently: all of the _thread_flag users 
appear to be coming in from task context.  Mostly that's luck as I 
didn't change the smp ipis to switch stacks, so the only place that 
is an interrupt and needs to access the actual thread data, does.

> Comments? We can deprecate "current_thread_info()", but that would make
> some things slightly less efficient.

I think we can keep it and flush out any misuse by a couple of 
carefully placed BUG() checks (ie anyone using current_thread_info 
directly from IRQ context really needs to go via current->thread_info, 
so that could be made a BUG()).  The only bit I'm not certain about 
is the preempt_count handling.  I rather like having addr_limit set 
to 0 as it will prevent copy*user from working in IRQ context.

Another alternative is to move the task structure back into the same 
page as the stack, but that would require a commitment to fix the 
large stack users (there aren't many, and I'm certainly willing).  This 
approach would work well with a guard page and the task struct at the 
top.  Also, there is at least 348 bytes of task_struct which should be
moved out: io_bitmaps should only be allocated for the tasks that use 
it (its 132 bytes, and we copy it into the per cpu tss nowadays, so 
making it a pointer should be fine), and the credentials (groups + 
rlim + user ids: >216) need to move to a struct cred for use by NFS, 
AIO and pthreads.  That alone would get task_struct down to 1072 bytes 
on x86 UP (1328 bytes on SMP), which leaves almost 3KB for the task 
context stack.

Thoughts?

		-ben
-- 
"You will be reincarnated as a toad; and you will be much happier."

  reply	other threads:[~2002-06-05 18:44 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-05  2:55 [RFC] 4KB stack + irq stack for x86 Benjamin LaHaise
2002-06-05 15:33 ` Linus Torvalds
2002-06-05 18:43   ` Benjamin LaHaise [this message]
2002-06-05 18:53     ` Linus Torvalds
2002-06-05 21:07       ` Benjamin LaHaise
2002-06-05 22:15 ` Steve Lord
2002-06-05 22:31   ` Benjamin LaHaise
2002-06-05 23:13     ` David S. Miller
2002-06-06  0:24       ` Larry McVoy
2002-06-06  1:15       ` Andi Kleen
2002-06-02 15:52         ` Pavel Machek
2002-06-09 18:50           ` Andi Kleen
2002-06-06  1:42         ` Benjamin LaHaise
2002-06-06  2:30           ` Stephen Lord
     [not found] <20020604225539.F9111@redhat.com.suse.lists.linux.kernel>
     [not found] ` <Pine.LNX.4.44.0206050820100.2941-100000@home.transmeta.com.suse.lists.linux.kernel>
     [not found]   ` <20020605144357.A4697@redhat.com.suse.lists.linux.kernel>
2002-06-05 20:40     ` Andi Kleen
2002-06-05 20:55       ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2002-06-06 13:32 Ulrich Weigand
     [not found] <mailman.1023370621.16639.linux-kernel2news@redhat.com>
2002-06-06 17:37 ` Pete Zaitcev
2002-06-07  1:06   ` David S. Miller
2002-06-06 19:24 Ulrich Weigand
     [not found] <OF70FD985F.A9C66B00-ONC1256BD0.0069C993@de.ibm.com.suse.lists.linux.kernel>
2002-06-06 19:49 ` Andi Kleen
2002-06-06 20:27   ` David Mosberger
2002-06-07 11:28   ` Maciej W. Rozycki
2002-06-06 20:55 Ulrich Weigand
2002-06-06 21:19 ` David Mosberger
2002-06-06 22:10   ` Martin J. Bligh
2002-06-07  0:59   ` William Lee Irwin III

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=20020605144357.A4697@redhat.com \
    --to=bcrl@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.