From: guenther Date: Sun, 11 May 2014 00:12:43 +0000 (+0000) Subject: Move the increment of uvmexp.softs back to the caller of mi_ast(): X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=622fac8a265e8758103895fd0ab4b64d08e4249e;p=openbsd Move the increment of uvmexp.softs back to the caller of mi_ast(): it needs to be done atomicly on some MP archs and we don't have atomic_add_int() everywhere yet. Also, mi_ast() was meant to be inline. noted by miod@ --- diff --git a/sys/arch/alpha/alpha/trap.c b/sys/arch/alpha/alpha/trap.c index 2d7d82b6358..9d58190144d 100644 --- a/sys/arch/alpha/alpha/trap.c +++ b/sys/arch/alpha/alpha/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.73 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.74 2014/05/11 00:12:43 guenther Exp $ */ /* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */ /*- @@ -720,6 +720,7 @@ ast(framep) panic("ast and not user"); #endif + atomic_add_int(&uvmexp.softs, 1); mi_ast(p, ci->ci_want_resched); /* Do any deferred user pmap operations. */ diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c index 0ce734d6624..590f68c01cb 100644 --- a/sys/arch/amd64/amd64/trap.c +++ b/sys/arch/amd64/amd64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.38 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.39 2014/05/11 00:12:43 guenther Exp $ */ /* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */ /*- @@ -281,6 +281,7 @@ copyfault: goto out; case T_ASTFLT|T_USER: /* Allow process switch */ + uvmexp.softs++; mi_ast(p, curcpu()->ci_want_resched); goto out; diff --git a/sys/arch/arm/arm/ast.c b/sys/arch/arm/arm/ast.c index ea410eca92b..486d6801a46 100644 --- a/sys/arch/arm/arm/ast.c +++ b/sys/arch/arm/arm/ast.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ast.c,v 1.11 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: ast.c,v 1.12 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: ast.c,v 1.6 2003/10/31 16:44:34 cl Exp $ */ /* @@ -90,6 +90,7 @@ ast(struct trapframe *tf) panic("ast: no pcb!"); #endif + uvmexp.softs++; mi_ast(p, want_resched); userret(p); } diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c index 0278efc9211..72f261b43b4 100644 --- a/sys/arch/hppa/hppa/trap.c +++ b/sys/arch/hppa/hppa/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.133 2014/05/10 21:58:56 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.134 2014/05/11 00:12:44 guenther Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -139,6 +139,7 @@ ast(struct proc *p) { if (p->p_md.md_astpending) { p->p_md.md_astpending = 0; + uvmexp.softs++; mi_ast(p, curcpu()->ci_want_resched); } diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c index c21b9cca737..857268e43ca 100644 --- a/sys/arch/hppa64/hppa64/trap.c +++ b/sys/arch/hppa64/hppa64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.38 2014/05/11 00:05:38 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.39 2014/05/11 00:12:44 guenther Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -132,6 +132,7 @@ ast(struct proc *p) { if (astpending) { astpending = 0; + uvmexp.softs++; mi_ast(p, want_resched); } } diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 9ec543f41df..4454ae00b00 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.115 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.116 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */ /*- @@ -334,6 +334,7 @@ trap(struct trapframe *frame) goto out; case T_ASTFLT|T_USER: /* Allow process switch */ + uvmexp.softs++; mi_ast(p, want_resched); goto out; diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c index 5426eea703a..8054055b12c 100644 --- a/sys/arch/m88k/m88k/trap.c +++ b/sys/arch/m88k/m88k/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.92 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.93 2014/05/11 00:12:44 guenther Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -207,6 +207,7 @@ ast(struct trapframe *frame) p->p_md.md_astpending = 0; + uvmexp.softs++; mi_ast(p, ci->ci_want_resched); userret(p); } diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c index d7c4e16c7f8..51f50adcbdb 100644 --- a/sys/arch/mips64/mips64/trap.c +++ b/sys/arch/mips64/mips64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.96 2014/05/11 00:05:38 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.97 2014/05/11 00:12:44 guenther Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -150,6 +150,7 @@ ast() p->p_md.md_astpending = 0; + atomic_add_int(&uvmexp.softs, 1); mi_ast(p, ci->ci_want_resched); userret(p); } diff --git a/sys/arch/powerpc/powerpc/trap.c b/sys/arch/powerpc/powerpc/trap.c index 2624c53d99d..3d0bebb3310 100644 --- a/sys/arch/powerpc/powerpc/trap.c +++ b/sys/arch/powerpc/powerpc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.99 2014/05/10 16:48:36 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.100 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */ /* @@ -620,6 +620,7 @@ for (i = 0; i < errnum; i++) { case EXC_AST|EXC_USER: p->p_md.md_astpending = 0; /* we are about to do it */ + uvmexp.softs++; mi_ast(p, ci->ci_want_resched); break; } diff --git a/sys/arch/sh/sh/trap.c b/sys/arch/sh/sh/trap.c index 24a075fac9e..b6a675357fe 100644 --- a/sys/arch/sh/sh/trap.c +++ b/sys/arch/sh/sh/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.28 2014/05/10 16:56:23 deraadt Exp $ */ +/* $OpenBSD: trap.c,v 1.29 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */ /* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */ @@ -479,6 +479,7 @@ ast(struct proc *p, struct trapframe *tf) while (p->p_md.md_astpending) { p->p_md.md_astpending = 0; refreshcreds(p); + uvmexp.softs++; mi_ast(p, want_resched); userret(p); } diff --git a/sys/arch/solbourne/solbourne/trap.c b/sys/arch/solbourne/solbourne/trap.c index 76ac5f739a4..d50588dff5e 100644 --- a/sys/arch/solbourne/solbourne/trap.c +++ b/sys/arch/solbourne/solbourne/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.20 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.21 2014/05/11 00:12:44 guenther Exp $ */ /* OpenBSD: trap.c,v 1.42 2004/12/06 20:12:25 miod Exp */ /* @@ -308,6 +308,7 @@ trap(type, psr, pc, tf) case T_AST: want_ast = 0; + uvmexp.softs++; mi_ast(p, want_resched); break; diff --git a/sys/arch/sparc/sparc/trap.c b/sys/arch/sparc/sparc/trap.c index 5f15e8392e8..dbbb324fa8e 100644 --- a/sys/arch/sparc/sparc/trap.c +++ b/sys/arch/sparc/sparc/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.67 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.68 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: trap.c,v 1.58 1997/09/12 08:55:01 pk Exp $ */ /* @@ -301,6 +301,7 @@ trap(type, psr, pc, tf) case T_AST: want_ast = 0; + uvmexp.softs++; mi_ast(p, want_resched); break; diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index 990dac1ea63..70a3411b08e 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.83 2014/05/10 12:29:58 kettenis Exp $ */ +/* $OpenBSD: trap.c,v 1.84 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -452,6 +452,7 @@ dopanic: case T_AST: p->p_md.md_astpending = 0; + uvmexp.softs++; mi_ast(p, curcpu()->ci_want_resched); break; diff --git a/sys/arch/vax/vax/trap.c b/sys/arch/vax/vax/trap.c index 842234fa674..bc6f28b2f89 100644 --- a/sys/arch/vax/vax/trap.c +++ b/sys/arch/vax/vax/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.52 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: trap.c,v 1.53 2014/05/11 00:12:44 guenther Exp $ */ /* $NetBSD: trap.c,v 1.47 1999/08/21 19:26:20 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -253,6 +253,7 @@ if(faultdebug)printf("trap accflt type %lx, code %lx, pc %lx, psl %lx\n", case T_ASTFLT|T_USER: mtpr(AST_NO,PR_ASTLVL); trapsig = 0; + uvmexp.softs++; mi_ast(p, want_resched); break; diff --git a/sys/sys/syscall_mi.h b/sys/sys/syscall_mi.h index d8c52eaa1e0..3cbf788a58a 100644 --- a/sys/sys/syscall_mi.h +++ b/sys/sys/syscall_mi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall_mi.h,v 1.4 2014/05/10 05:33:00 guenther Exp $ */ +/* $OpenBSD: syscall_mi.h,v 1.5 2014/05/11 00:12:44 guenther Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -146,11 +146,9 @@ mi_child_return(struct proc *p) /* * Do the specific processing necessary for an AST */ -static void +static inline void mi_ast(struct proc *p, int resched) { - uvmexp.softs++; - if (p->p_flag & P_OWEUPC) { KERNEL_LOCK(); ADDUPROF(p);