From owner-cvs-src@FreeBSD.ORG Sun Dec 18 21:40:18 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7186C16A41F; Sun, 18 Dec 2005 21:40:18 +0000 (GMT) (envelope-from alc@cs.rice.edu) Received: from cs.rice.edu (cs.rice.edu [128.42.1.30]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A9F743D53; Sun, 18 Dec 2005 21:40:18 +0000 (GMT) (envelope-from alc@cs.rice.edu) Received: from localhost (calypso.cs.rice.edu [128.42.1.127]) by cs.rice.edu (Postfix) with ESMTP id 3F8E04A9AD; Sun, 18 Dec 2005 15:40:17 -0600 (CST) Received: from cs.rice.edu ([128.42.1.30]) by localhost (calypso.cs.rice.edu [128.42.1.127]) (amavisd-new, port 10024) with LMTP id 13149-01-100; Sun, 18 Dec 2005 15:40:16 -0600 (CST) Received: by cs.rice.edu (Postfix, from userid 19572) id A38A64A9E4; Sun, 18 Dec 2005 15:40:16 -0600 (CST) Date: Sun, 18 Dec 2005 15:40:16 -0600 From: Alan Cox To: Pawel Jakub Dawidek Message-ID: <20051218214016.GA10163@cs.rice.edu> References: <200512161834.jBGIYEnv092676@repoman.freebsd.org> <20051218032053.GD80713@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051218032053.GD80713@garage.freebsd.pl> User-Agent: Mutt/1.4.2i X-Virus-Scanned: by amavis-2.2.1 at cs.rice.edu Cc: Alan Cox , cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern imgact_elf.c src/sys/vm vm_extern.h vm_glue.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2005 21:40:18 -0000 On Sun, Dec 18, 2005 at 04:20:53AM +0100, Pawel Jakub Dawidek wrote: > On Fri, Dec 16, 2005 at 06:34:14PM +0000, Alan Cox wrote: > +> alc 2005-12-16 18:34:14 UTC > +> > +> FreeBSD src repository > +> > +> Modified files: > +> sys/kern imgact_elf.c > +> sys/vm vm_extern.h vm_glue.c > +> Log: > +> Use sf_buf_alloc() instead of vm_map_find() on exec_map to create the > +> ephemeral mappings that are used as the source for three copy > +> operations from kernel space to user space. There are two reasons for > +> making this change: (1) Under heavy load exec_map can fill up causing > +> vm_map_find() to fail. When it fails, the nascent process is aborted > +> (SIGABRT). Whereas, this reimplementation using sf_buf_alloc() > +> sleeps. (2) Although it is possible to sleep on vm_map_find()'s > +> failure until address space becomes available (see kmem_alloc_wait()), > +> using sf_buf_alloc() is faster. Furthermore, the reimplementation > +> uses a CPU private mapping, avoiding a TLB shootdown on > +> multiprocessors. > > I got panic on boot with this change (maybe because I've DEBUG_VFS_LOCKS > compiled into the kernel): > > Trying to mount root from ufs:/dev/ad0s1a > KDB: stack backtrace: > vfs_badlock() at vfs_badlock+0x95 > assert_vop_locked() at assert_vop_locked+0x77 > VOP_GETPAGES_APV() at VOP_GETPAGES_APV+0x8a > vnode_pager_getpages() at vnode_pager_getpages+0x92 > vm_imgact_map_page() at vm_imgact_map_page+0x84 > elf64_load_section() at elf64_load_section+0xe9 > exec_elf64_imgact() at exec_elf64_imgact+0x336 > kern_execve() at kern_execve+0x457 > execve() at execve+0x5d > start_init() at start_init+0x249 > fork_exit() at fork_exit+0xbb > fork_trampoline() at fork_trampoline+0xe > --- trap 0, rip = 0, rsp = 0xffffffffb280dd40, rbp = 0 --- > VOP_GETPAGES: 0xffffff0009848200 is not locked but should be > KDB: enter: lock violation > [thread pid 1 tid 100004 ] > Stopped at kdb_enter+0x2f: nop > Yes, DEBUG_VFS_LOCKS is showing that I need to update the VOP locking. Thanks. Alan