From owner-freebsd-alpha Mon Feb 19 13:25:19 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id B3DD737B65D; Mon, 19 Feb 2001 13:25:16 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.2/8.11.2) with ESMTP id f1JLNll86372; Mon, 19 Feb 2001 13:23:47 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Mon, 19 Feb 2001 13:25:03 -0800 (PST) From: John Baldwin To: Matthew Jacob Subject: RE: old fishwraps.. Cc: alpha@FreeBSD.org, jake@FreeBSD.org Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 19-Feb-01 Matthew Jacob wrote: > (taking this to alpha where it belongs) > >> >> On 19-Feb-01 Matthew Jacob wrote: >> > >> > Welcome back john- this is all *very* old news..... >> > >> > Right now we're more or less functional in the alpha-kernel front.. I >> > still >> > need to add the oncpu/lastcpu stuff to alpha- I've been waiting for a >> > response >> > from Jason Evans about making these integers (instead of chars) because >> > that >> > would make life on the alpha/genassym (or sparc, for that matter) a lot >> > easier. >> >> Making p_stat an integer is something we might need to do as well as right >> now >> proc assumes that a 32-bit wordsize in its alighnment. And also, one thing >> you >> missed is that clear_resched()'ign in userret() as is currently the case is >> wrong. It needs to be in mi_switch() instead, but mroe on that later. > > Oh- yes- sorry- I haven't checked my latest copy in because I've been > cheesing > it and jumping out of assembly to C-code to 'fix' this stuff- but it actually > *is* being called from cpu_switch (see below for my current patches) but the > hack currently is: I mean sometihng like this: Index: kern_synch.c =================================================================== RCS file: /usr/cvs/src/sys/kern/kern_synch.c,v retrieving revision 1.125 diff -u -r1.125 kern_synch.c --- kern_synch.c 2001/02/09 06:09:50 1.125 +++ kern_synch.c 2001/02/12 21:55:06 @@ -969,6 +973,7 @@ PCPU_SET(switchtime, new_switchtime); CTR4(KTR_PROC, "mi_switch: old proc %p (pid %d, %s), schedlock %p", p, p->p_pid, p->p_comm, (void *) sched_lock.mtx_lock); + clear_resched(); cpu_switch(); CTR4(KTR_PROC, "mi_switch: new proc %p (pid %d, %s), schedlock %p", p, p->p_pid, p->p_comm, (void *) sched_lock.mtx_lock); ( Currently, p_oncpu and p_lastcpu are set in cpu_switch, but to be honest, there's no reason to. It would be quite fine to do something like this: curproc->p_lastcpu = curproc->p_oncpu; curproc->p_oncpu = -1; clear_resched(); cpu_switch(); curproc->p_oncpu = PCPU_GET(cpuid); and just make it all MI and in mi_switch(). Some other stuff such as the sched_lock dinking can also be done this way. In fact, there are several things in cpu_switch() that don't really belong there, IMO. It should be for MD stuff such as saving and restoring registers. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message