Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Kevin D. Kissell" <kevink@mips.com>
To: "zhuzhenhua" <zzh.hust@gmail.com>,
	"linux-mips" <linux-mips@linux-mips.org>
Subject: Re: does the SAVE_ALL nesting in kernel?
Date: Wed, 12 Sep 2007 11:11:42 +0200	[thread overview]
Message-ID: <00b301c7f51c$f0709d30$10eca8c0@grendel> (raw)
In-Reply-To: 50c9a2250709111921g1b49cb0du7f97ebb3e1fb7d07@mail.gmail.com

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

SAVE_ALL can certainly nest in MIPS Linux.  This is why there's a check at the beginning of SAVE_SOME to determine whether the exception was take in user-mode, to see if the kernel stackpointer should be loaded from memory or computed relative to the current stack frame.   Another thing to keep in mind in looking at these sorts of optimizations is that each scheduling thread has its own kernel stack area. So if you're very very motivated, you could conceivably come up with a hack whereby the first level of exceptions uses your internal RAM array for a stack, but nested ones use external memory, *but*, you'd at least need room for as many first-level stack frames in your internal RAM as you have concurrent processes/threads in the system, or you'd need to mutilate the context switch code to copy the first level stack frames in and out of external memory on a context switch.  I don't think that's a good path to go down.

If you have functioning caches, they won't be as perfect as a scratchpad, but you won't have all the additional context switch overhead, and they will automagically do approximately what you want, without your having to change any code.

            Kevin K.
  ----- Original Message ----- 
  From: zhuzhenhua 
  To: linux-mips 
  Sent: Wednesday, September 12, 2007 4:21 AM
  Subject: does the SAVE_ALL nesting in kernel?


  hello, all
              i have a mips board,  and the SDRAM speed(bus clock) is not too fast.
               so i want change  the SAVE_ALL and RESTORE_ALL to use internal-ram(high speed).
              i just wonder whether the SAVE_ALL netsting in kernel  for mips arch?
              if not, i think  maybe 1k byte for SAVE_ALL is enough( 32regs X4, and some cp0_regs).
              but if  the SAVE_ALL nesting, maybe i need to keep a stack in internal-ram.
              thanks for any hints.

  Best Regards

  --
  zzh


[-- Attachment #2: Type: text/html, Size: 3494 bytes --]

  parent reply	other threads:[~2007-09-12  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-12  2:21 does the SAVE_ALL nesting in kernel? zhuzhenhua
2007-09-12  3:17 ` Dajie Tan
2007-09-12  3:30   ` Dajie Tan
2007-09-12  9:11 ` Kevin D. Kissell [this message]
2007-09-13  7:00   ` zhuzhenhua
2007-09-12 16:53 ` Ralf Baechle

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='00b301c7f51c$f0709d30$10eca8c0@grendel' \
    --to=kevink@mips.com \
    --cc=linux-mips@linux-mips.org \
    --cc=zzh.hust@gmail.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