From owner-freebsd-hackers Tue Jan 19 10:48:00 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA22133 for freebsd-hackers-outgoing; Tue, 19 Jan 1999 10:48:00 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA22124 for ; Tue, 19 Jan 1999 10:47:59 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id KAA05898; Tue, 19 Jan 1999 10:38:31 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdVY5884; Tue Jan 19 18:38:24 1999 Message-ID: <36A4D118.1CFBAE39@whistle.com> Date: Tue, 19 Jan 1999 10:38:16 -0800 From: Julian Elischer Organization: Whistle Communications X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.2.7-RELEASE i386) MIME-Version: 1.0 To: zhihuizhang CC: Sabrina Minshall , hackers Subject: Re: stack info References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG zhihuizhang wrote: > > On Mon, 18 Jan 1999, Sabrina Minshall wrote: > > > Hi Zhihui, > > > > Since you're hot off this topic, I have a question. > > > > 1. When a process enters kernel mode (via system call) what > > stack is used (in the top half)? is it a common stack to all > > processes or is it per process? Where is it located? > > I have not read that part of the source code. As I understand it, the > stack you use when you enter into kernel mode is the kernel stack. It is > a per-process resource. It should be at the top of the u-area. In > FreeBSD, I think the size of the u-area is two pages. under -current the kernel stack for each process is a separate KV area. this is because SMP requires that two processes running at the same time ahve DIFFERENT addresses for their stacks. (also needed for threads (processes with shared address spaces)) > > > > > 2. When the kernel is executing in the botton half, what stack is used? > > is it kstack, or tmpstk? > > kstack is the kernel stack. tmpstk is used when the CPU is idle (see > swtch.s). I am not sure what stack is used when an interrupt happens > (the kernel is executing in the bottom half). However, since the > interrupt handler does not have a process context, it should not use > kstack. Maybe there is a third stack reserved for it or it could use > tmpstk? At this time the bottom half runs in the kernel stack of whatever process was running at that time. In -current a separate interrupt stack was under consideration but I haven't seen it done yet. > > > > > 3. Does the kernel have multiple stacks for in the bottom half? Like > > interrupt stack, etc? > > > I am not sure about this. See above. > > Zhihui Zhang > ------------ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message