From owner-cvs-src-old@FreeBSD.ORG Fri Dec 12 12:06:42 2008 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15041065673 for ; Fri, 12 Dec 2008 12:06:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id CF5A38FC1B for ; Fri, 12 Dec 2008 12:06:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mBCC6gqq021828 for ; Fri, 12 Dec 2008 12:06:42 GMT (envelope-from kib@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mBCC6g0r021827 for cvs-src-old@freebsd.org; Fri, 12 Dec 2008 12:06:42 GMT (envelope-from kib@repoman.freebsd.org) Message-Id: <200812121206.mBCC6g0r021827@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to kib@repoman.freebsd.org using -f From: Konstantin Belousov Date: Fri, 12 Dec 2008 12:06:28 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_prot.c kern_sysctl.c X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 12:06:43 -0000 kib 2008-12-12 12:06:28 UTC FreeBSD src repository Modified files: sys/kern kern_prot.c kern_sysctl.c Log: SVN rev 185983 on 2008-12-12 12:06:28Z by kib The userland_sysctl() function retries sysctl_root() until returned error is not EAGAIN. Several sysctls that inspect another process use p_candebug() for checking access right for the curproc. p_candebug() returns EAGAIN for some reasons, in particular, for the process doing exec() now. If execing process tries to lock Giant, we get a livelock, because sysctl handlers are covered by Giant, and often do not sleep. Break the livelock by dropping Giant and allowing other threads to execute in the EAGAIN loop. Also, do not return EAGAIN from p_candebug() when process is executing, use more appropriate EBUSY error [1]. Reported and tested by: pho Suggested by: rwatson [1] Reviewed by: rwatson, des MFC after: 1 week Revision Changes Path 1.215 +1 -1 src/sys/kern/kern_prot.c 1.181 +8 -2 src/sys/kern/kern_sysctl.c