From owner-cvs-all@FreeBSD.ORG Fri Jul 27 09:21:18 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F77116A419; Fri, 27 Jul 2007 09:21:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 730B913C46C; Fri, 27 Jul 2007 09:21:18 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l6R9LIGW060043; Fri, 27 Jul 2007 09:21:18 GMT (envelope-from attilio@repoman.freebsd.org) Received: (from attilio@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l6R9LINj060042; Fri, 27 Jul 2007 09:21:18 GMT (envelope-from attilio) Message-Id: <200707270921.l6R9LINj060042@repoman.freebsd.org> From: Attilio Rao Date: Fri, 27 Jul 2007 09:21:18 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_kse.c kern_thread.c src/sys/sys proc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 27 Jul 2007 09:21:18 -0000 attilio 2007-07-27 09:21:18 UTC FreeBSD src repository Modified files: sys/kern kern_kse.c kern_thread.c sys/sys proc.h Log: Actually, upcalls cannot be freed while destroying the thread because we should call uma_zfree() with various spinlock helds. Rearranging the code would not help here because we cannot break atomicity respect prcess spinlock, so the only one choice we have is to defer the operation. In order to do this use a global queue synchronized through the kse_lock spinlock which is freed at any thread_alloc() / thread_wait() through a call to thread_reap(). Note that this approach is not ideal as we should want a per-process list of zombie upcalls, but it follows initial guidelines of KSE authors. Tested by: jkim, pav Approved by: jeff, julian Approved by: re Revision Changes Path 1.234 +17 -0 src/sys/kern/kern_kse.c 1.252 +3 -0 src/sys/kern/kern_thread.c 1.489 +1 -0 src/sys/sys/proc.h