From owner-cvs-src-old@FreeBSD.ORG Mon Apr 20 03:45:08 2009 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 7990A10656BF for ; Mon, 20 Apr 2009 03:45:08 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 661068FC13 for ; Mon, 20 Apr 2009 03:45:08 +0000 (UTC) (envelope-from alc@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 n3K3j8tj059656 for ; Mon, 20 Apr 2009 03:45:08 GMT (envelope-from alc@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3K3j81C059655 for cvs-src-old@freebsd.org; Mon, 20 Apr 2009 03:45:08 GMT (envelope-from alc@repoman.freebsd.org) Message-Id: <200904200345.n3K3j81C059655@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to alc@repoman.freebsd.org using -f From: Alan Cox Date: Mon, 20 Apr 2009 03:44:54 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/mips/mips pmap.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: Mon, 20 Apr 2009 03:45:08 -0000 alc 2009-04-20 03:44:54 UTC FreeBSD src repository Modified files: sys/mips/mips pmap.c Log: SVN rev 191300 on 2009-04-20 03:44:54Z by alc MFamd64/i386 Introduce pmap_try_insert_pv_entry(), a function that conditionally creates a pv entry if the number of entries is below the high water mark for pv entries. Introduce pmap_enter_quick_locked() and use it to reimplement pmap_enter_object(). The old implementation was broken. For example, it could block while holding a mutex lock. Change pmap_enter_quick_locked() to fail rather than wait if it is unable to allocate a page table page. This prevents a race between pmap_enter_object() and the page daemon. Specifically, an inactive page that is a successor to the page that was given to pmap_enter_quick_locked() might become a cache page while pmap_enter_quick_locked() waits and later pmap_enter_object() maps the cache page violating the invariant that cache pages are never mapped. Similarly, change pmap_enter_quick_locked() to call pmap_try_insert_pv_entry() rather than pmap_insert_entry(). Generally speaking, pmap_enter_quick_locked() is used to create speculative mappings. So, it should not try hard to allocate memory if free memory is scarce. Tested by: gonzo Revision Changes Path 1.14 +70 -39 src/sys/mips/mips/pmap.c