From owner-freebsd-current Sat Feb 23 16:49: 8 2002 Delivered-To: freebsd-current@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 58DE437B400; Sat, 23 Feb 2002 16:49:02 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id LAA00511; Sun, 24 Feb 2002 11:48:55 +1100 Date: Sun, 24 Feb 2002 11:49:12 +1100 (EST) From: Bruce Evans X-X-Sender: To: Matthew Dillon Cc: Terry Lambert , Alfred Perlstein , Bosko Milekic , Seigo Tanimura , , John Baldwin Subject: Re: malloc_bucket() idea (was Re: How to fix malloc.) In-Reply-To: <200202240003.g1O036164477@apollo.backplane.com> Message-ID: <20020224111043.W30980-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 23 Feb 2002, Matthew Dillon wrote: > :My version of it does less than this. I only use it to help implement > :spinlocks. > > You put together infrastructure to deal with pending pci interrupts? > If so, then why not commit it (or at least commit a version #ifdef'd > for the i386 architecture). It's too messy and unfinished (doesn't work right for SMP or irqs >= 16), and dificult to untangle from my other patches. I posted these partial ones to attempt to inhibit() recomplication of the current critical* functions in directions that I don't want to go :-). > :Index: kern_switch.c > :=================================================================== > :RCS file: /home/ncvs/src/sys/kern/kern_switch.c,v > :retrieving revision 1.20 > :diff -u -2 -r1.20 kern_switch.c > :--- kern_switch.c 11 Feb 2002 20:37:51 -0000 1.20 > :+++ kern_switch.c 13 Feb 2002 05:34:20 -0000 > :@@ -70,14 +70,21 @@ > : } > : > :-/* Critical sections that prevent preemption. */ > :+/*- > :+ * Critical section handling. > :+ * XXX doesn't belong here. > :+ * > :+ * Entering a critical section only blocks non-fast interrupts. > :+ * critical_enter() is similar to splhigh() in a 2-level spl setup under > :+ * old versions of FreeBSD. > :+ * > :+ * Exiting from all critical sections unblocks non-fast interrupts and runs > :+ * the handlers of any that were blocked. critical_exit() is similar to > :+ * spl(old_level) in a 2-level spl setup under old versions of FreeBSD. > :+ */ > : void > : critical_enter(void) > : { > :- struct thread *td; > : > :- td = curthread; > :- if (td->td_critnest == 0) > :- td->td_savecrit = cpu_critical_enter(); > :- td->td_critnest++; > :+ curthread->td_critnest++; > : } > : > :@@ -85,12 +92,7 @@ > : critical_exit(void) > : { > :- struct thread *td; > : > :- td = curthread; > :- if (td->td_critnest == 1) { > :- td->td_critnest = 0; > :- cpu_critical_exit(td->td_savecrit); > :- } else > :- td->td_critnest--; > :+ if (--curthread->td_critnest == 0 && (ipending | spending) != 0) > :+ unpend(); > : } ipending here works much as in RELENG_4. It is ORed into by sched_ithd() if curthread->td_critnest != 0. Nothing special is needed for pci (the ICU masks pending interrupts). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message