From owner-cvs-all@FreeBSD.ORG Sat Jun 26 18:59:09 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1790616A4CE; Sat, 26 Jun 2004 18:59:09 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E8C443D49; Sat, 26 Jun 2004 18:59:09 +0000 (GMT) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5QIwMOu072299; Sat, 26 Jun 2004 18:58:22 GMT (envelope-from marcel@repoman.freebsd.org) Received: (from marcel@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5QIwMB1072298; Sat, 26 Jun 2004 18:58:22 GMT (envelope-from marcel) Message-Id: <200406261858.i5QIwMB1072298@repoman.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jun 2004 18:58:22 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern imgact_elf.c kern_fork.c kern_kse.c kern_thr.c kern_thread.c src/sys/sys proc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2004 18:59:09 -0000 marcel 2004-06-26 18:58:22 UTC FreeBSD src repository Modified files: sys/kern imgact_elf.c kern_fork.c kern_kse.c kern_thr.c kern_thread.c sys/sys proc.h Log: Allocate TIDs in thread_init() and deallocate them in thread_fini(). The overhead of unconditionally allocating TIDs (and likewise, unconditionally deallocating them), is amortized across multiple thread creations by the way UMA makes it possible to have type-stable storage. Previously the cost was kept down by having threads created as part of a fork operation use the process' PID as the TID. While this had some nice properties, it also introduced complexity in the way TIDs were allocated. Most importantly, by using the type-stable storage that UMA gives us this was also unnecessary. This change affects how core dumps are created and in particular how the PRSTATUS notes are dumped. Since we don't have a thread with a TID equalling the PID, we now need a different way to preserve the old and previous behavior. We do this by having the given thread (i.e. the thread passed to the core dump code in td) dump it's state first and fill in pr_pid with the actual PID. All other threads will have pr_pid contain their TIDs. The upshot of all this is that the debugger will now likely select the right LWP (=TID) as the initial thread. Credits to: julian@ for spotting how we can utilize UMA. Thanks to: all who provided julian@ with test results. Revision Changes Path 1.152 +31 -33 src/sys/kern/imgact_elf.c 1.227 +0 -1 src/sys/kern/kern_fork.c 1.182 +1 -3 src/sys/kern/kern_kse.c 1.20 +0 -1 src/sys/kern/kern_thr.c 1.185 +57 -71 src/sys/kern/kern_thread.c 1.382 +0 -1 src/sys/sys/proc.h