Date: Sun, 17 Feb 2002 00:29:22 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Julian Elischer <julian@elischer.org> Cc: Alfred Perlstein <bright@mu.org>, Poul-Henning Kamp <phk@critter.freebsd.dk>, arch@FreeBSD.ORG, jhb@FreeBSD.ORG, peter@wemm.org, jake@locore.ca Subject: Re: gettimeofday() and crhold()/crfree() (was Re: gettimeofday() Message-ID: <200202170829.g1H8TME68268@apollo.backplane.com> References: <Pine.BSF.4.21.0202162354060.39539-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
:either way, could you do you timing tests on a NON-INVARIANT :kernel to judge the difference this makes? :In the mean while, John, is it really necessary to have this there? :I can remove it (and the KASSERTS) in a flash if you'll let me... Sure, here they are... actually fairly significant, I didn't expect complete removal of invariants to have this much of an effect. I fear someone has done something with invariants that's eating more cpu then it should :-( As a bonus, I've also included the patch set I am using against the current -current which identifies the KASSERTs and INVARIANTS I removed to make your code work as advertised with INVARIANTS turned on. This patch set is fairly well tested. I did not include the patch for removing Giant from gettimeofday() (I'll be comitting the gettimeofday giant removal patch on sunday). I'll also re-run the buildworld test with invariants turned off and post a followup to my buildworld posting tomorrow. -Matt (matt's mutex pool adjustments and julian's initial commit now part of current) CURRENT 2xCPU SMP BUILD and removal of Giant for gettimeofday() INVARIANTS TURNED OFF GLOBALLY. one TG running: 576089/sec two TGs running: 429141/sec per TG CURRENT 2xCPU SMP BUILD and ucred invariants blasted to bits and removal of Giant for gettimeofday(). INVARIANTS TURNED ON GLOBALLY one TG running: 462478/sec two TGs running: 361962/sec per TG Index: i386/i386/trap.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/trap.c,v retrieving revision 1.212 diff -u -r1.212 trap.c --- i386/i386/trap.c 17 Feb 2002 01:09:54 -0000 1.212 +++ i386/i386/trap.c 17 Feb 2002 08:19:55 -0000 @@ -255,7 +255,9 @@ sticks = td->td_kse->ke_sticks; td->td_frame = &frame; +#if 0 KASSERT(td->td_ucred == NULL, ("already have a ucred")); +#endif if (td->td_ucred != p->p_ucred) cred_update_thread(td); @@ -643,7 +645,7 @@ userret(td, &frame, sticks); mtx_assert(&Giant, MA_NOTOWNED); userout: -#ifdef INVARIANTS +#if 0 mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); @@ -954,7 +956,9 @@ sticks = td->td_kse->ke_sticks; td->td_frame = &frame; +#if 0 KASSERT(td->td_ucred == NULL, ("already have a ucred")); +#endif if (td->td_ucred != p->p_ucred) cred_update_thread(td); params = (caddr_t)frame.tf_esp + sizeof(int); @@ -1099,7 +1103,7 @@ */ STOPEVENT(p, S_SCX, code); -#ifdef INVARIANTS +#if 0 mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); Index: kern/kern_fork.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_fork.c,v retrieving revision 1.131 diff -u -r1.131 kern_fork.c --- kern/kern_fork.c 17 Feb 2002 01:09:55 -0000 1.131 +++ kern/kern_fork.c 17 Feb 2002 08:19:55 -0000 @@ -799,7 +799,7 @@ kthread_exit(0); } PROC_UNLOCK(p); -#ifdef INVARIANTS +#if 0 mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); Index: kern/subr_trap.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_trap.c,v retrieving revision 1.208 diff -u -r1.208 subr_trap.c --- kern/subr_trap.c 17 Feb 2002 01:09:55 -0000 1.208 +++ kern/subr_trap.c 17 Feb 2002 08:19:57 -0000 @@ -131,7 +131,9 @@ #endif KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode")); +#if 0 KASSERT(td->td_ucred == NULL, ("leaked ucred")); +#endif #ifdef WITNESS if (witness_list(td)) panic("Returning to user mode with mutex(s) held"); @@ -187,7 +189,7 @@ } userret(td, framep, sticks); -#ifdef INVARIANTS +#if 0 mtx_lock(&Giant); crfree(td->td_ucred); mtx_unlock(&Giant); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202170829.g1H8TME68268>