From owner-freebsd-smp Fri Jun 25 0: 8:53 1999 Delivered-To: freebsd-smp@freebsd.org Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (Postfix) with ESMTP id 1F71F14DC4 for ; Fri, 25 Jun 1999 00:08:48 -0700 (PDT) (envelope-from julian@whistle.com) Received: from current1.whistle.com (current1.whistle.com [207.76.205.22]) by alpo.whistle.com (8.9.1a/8.9.1) with SMTP id AAA10413 for ; Fri, 25 Jun 1999 00:08:48 -0700 (PDT) Date: Fri, 25 Jun 1999 00:08:47 -0700 (PDT) From: Julian Elischer To: smp@freebsd.org Subject: Re: Call to arms..-SMP (fwd) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org FYI for the group ---------- Forwarded message ---------- Date: Thu, 24 Jun 1999 22:55:29 -0500 From: Alan Cox To: Luoqi Chen Cc: alc@cs.rice.edu, bde@freebsd.org, dyson@iquest.net, julian@whistle.com, luoqi@freebsd.org Subject: Re: Call to arms..-SMP Here's a starting point ... the problem is that the unlock is performed in doreti, which is used by everything and not just syscalls. For all the pretty differentiation of fpu_lock, align_lock, etc. doreti knows that these are all really the same lock. Alan Index: i386/i386/trap.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/trap.c,v retrieving revision 1.139 diff -c -r1.139 trap.c *** trap.c 1999/06/18 14:32:16 1.139 --- trap.c 1999/06/24 23:30:38 *************** *** 1036,1041 **** --- 1036,1044 ---- else callp = &p->p_sysent->sv_table[code]; + if ( ! callp->sy_locked) + get_syscall_lock(); + if (params && (i = callp->sy_narg * sizeof(int)) && (error = copyin(params, (caddr_t)args, (u_int)i))) { #ifdef KTRACE Index: i386/include/lock.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/lock.h,v retrieving revision 1.6 diff -c -r1.6 lock.h *** lock.h 1998/04/06 11:38:17 1.6 --- lock.h 1999/06/24 23:22:32 *************** *** 43,49 **** #define FPU_LOCK call _get_fpu_lock #define ALIGN_LOCK call _get_align_lock ! #define SYSCALL_LOCK call _get_syscall_lock #define ALTSYSCALL_LOCK call _get_altsyscall_lock /* --- 43,49 ---- #define FPU_LOCK call _get_fpu_lock #define ALIGN_LOCK call _get_align_lock ! #define SYSCALL_LOCK #define ALTSYSCALL_LOCK call _get_altsyscall_lock /* Index: kern/init_sysent.c =================================================================== RCS file: /home/ncvs/src/sys/kern/init_sysent.c,v retrieving revision 1.66 diff -c -r1.66 init_sysent.c *** init_sysent.c 1999/05/13 09:12:50 1.66 --- init_sysent.c 1999/06/25 00:11:04 *************** *** 39,45 **** { 1, (sy_call_t *)obreak }, /* 17 = break */ { 3, (sy_call_t *)getfsstat }, /* 18 = getfsstat */ { compat(3,lseek) }, /* 19 = old lseek */ ! { 0, (sy_call_t *)getpid }, /* 20 = getpid */ { 4, (sy_call_t *)mount }, /* 21 = mount */ { 2, (sy_call_t *)unmount }, /* 22 = unmount */ { 1, (sy_call_t *)setuid }, /* 23 = setuid */ --- 39,45 ---- { 1, (sy_call_t *)obreak }, /* 17 = break */ { 3, (sy_call_t *)getfsstat }, /* 18 = getfsstat */ { compat(3,lseek) }, /* 19 = old lseek */ ! { 0, (sy_call_t *)getpid, 1 }, /* 20 = getpid */ { 4, (sy_call_t *)mount }, /* 21 = mount */ { 2, (sy_call_t *)unmount }, /* 22 = unmount */ { 1, (sy_call_t *)setuid }, /* 23 = setuid */ *************** *** 58,64 **** { 0, (sy_call_t *)sync }, /* 36 = sync */ { 2, (sy_call_t *)kill }, /* 37 = kill */ { compat(2,stat) }, /* 38 = old stat */ ! { 0, (sy_call_t *)getppid }, /* 39 = getppid */ { compat(2,lstat) }, /* 40 = old lstat */ { 1, (sy_call_t *)dup }, /* 41 = dup */ { 0, (sy_call_t *)pipe }, /* 42 = pipe */ --- 58,64 ---- { 0, (sy_call_t *)sync }, /* 36 = sync */ { 2, (sy_call_t *)kill }, /* 37 = kill */ { compat(2,stat) }, /* 38 = old stat */ ! { 0, (sy_call_t *)getppid, 1 }, /* 39 = getppid */ { compat(2,lstat) }, /* 40 = old lstat */ { 1, (sy_call_t *)dup }, /* 41 = dup */ { 0, (sy_call_t *)pipe }, /* 42 = pipe */ *************** *** 66,72 **** { 4, (sy_call_t *)profil }, /* 44 = profil */ { 4, (sy_call_t *)ktrace }, /* 45 = ktrace */ { 3, (sy_call_t *)sigaction }, /* 46 = sigaction */ ! { 0, (sy_call_t *)getgid }, /* 47 = getgid */ { 2, (sy_call_t *)sigprocmask }, /* 48 = sigprocmask */ { 2, (sy_call_t *)getlogin }, /* 49 = getlogin */ { 1, (sy_call_t *)setlogin }, /* 50 = setlogin */ --- 66,72 ---- { 4, (sy_call_t *)profil }, /* 44 = profil */ { 4, (sy_call_t *)ktrace }, /* 45 = ktrace */ { 3, (sy_call_t *)sigaction }, /* 46 = sigaction */ ! { 0, (sy_call_t *)getgid, 1 }, /* 47 = getgid */ { 2, (sy_call_t *)sigprocmask }, /* 48 = sigprocmask */ { 2, (sy_call_t *)getlogin }, /* 49 = getlogin */ { 1, (sy_call_t *)setlogin }, /* 50 = setlogin */ *************** *** 100,106 **** { 3, (sy_call_t *)mincore }, /* 78 = mincore */ { 2, (sy_call_t *)getgroups }, /* 79 = getgroups */ { 2, (sy_call_t *)setgroups }, /* 80 = setgroups */ ! { 0, (sy_call_t *)getpgrp }, /* 81 = getpgrp */ { 2, (sy_call_t *)setpgid }, /* 82 = setpgid */ { 3, (sy_call_t *)setitimer }, /* 83 = setitimer */ { compat(0,wait) }, /* 84 = old wait */ --- 100,106 ---- { 3, (sy_call_t *)mincore }, /* 78 = mincore */ { 2, (sy_call_t *)getgroups }, /* 79 = getgroups */ { 2, (sy_call_t *)setgroups }, /* 80 = setgroups */ ! { 0, (sy_call_t *)getpgrp, 1 }, /* 81 = getpgrp */ { 2, (sy_call_t *)setpgid }, /* 82 = setpgid */ { 3, (sy_call_t *)setitimer }, /* 83 = setitimer */ { compat(0,wait) }, /* 84 = old wait */ Index: sys/sysent.h =================================================================== RCS file: /home/ncvs/src/sys/sys/sysent.h,v retrieving revision 1.20 diff -c -r1.20 sysent.h *** sysent.h 1999/01/09 14:15:40 1.20 --- sysent.h 1999/06/24 23:20:21 *************** *** 43,48 **** --- 43,49 ---- struct sysent { /* system call table */ int sy_narg; /* number of arguments */ sy_call_t *sy_call; /* implementing function */ + int sy_locked; }; #define SCARG(p,k) ((p)->k) /* get arg from args pointer */ /* placeholder till we integrate rest of lite2 syscallargs changes XXX */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message