From owner-svn-src-user@FreeBSD.ORG Sat Apr 24 22:31:51 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75F34106566B; Sat, 24 Apr 2010 22:31:51 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 660D68FC13; Sat, 24 Apr 2010 22:31:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3OMVp09065624; Sat, 24 Apr 2010 22:31:51 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3OMVphU065622; Sat, 24 Apr 2010 22:31:51 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004242231.o3OMVphU065622@svn.freebsd.org> From: Kip Macy Date: Sat, 24 Apr 2010 22:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207169 - user/kmacy/head_page_lock_2/sys/amd64/amd64 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2010 22:31:51 -0000 Author: kmacy Date: Sat Apr 24 22:31:51 2010 New Revision: 207169 URL: http://svn.freebsd.org/changeset/base/207169 Log: add some comments regarding locking in demotion during pmap_remove Modified: user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c Modified: user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c ============================================================================== --- user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c Sat Apr 24 22:24:26 2010 (r207168) +++ user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c Sat Apr 24 22:31:51 2010 (r207169) @@ -2336,7 +2336,12 @@ pmap_pv_demote_pde(pmap_t pmap, vm_offse vm_page_lock(m); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_list); vm_page_unlock(m); - + /* We open ourselves up to an LOR by doing the page lock acquisitions + * with the pmap lock held - which raises the question as to whether + * we should use pa_tryrelock (can the pmap be corrupted if we allow it + * to be changed during a demotion?) or should we lock the entire range + * in advance? Either option is a bit awkward. + */ /* Instantiate the remaining NPTEPG - 1 pv entries. */ va_last = va + NBPDR - PAGE_SIZE; do { @@ -2908,6 +2913,13 @@ restart: * Check for large page. */ if ((ptpaddr & PG_PS) != 0) { + /* + * I think we only need this in case pmap_demote_pde + * is called and the page is managed, so in principle + * we should check if the page is managed - but we + * also potentially need the whole range so this + * acquisition may provide no benefit at all + */ if (pa_tryrelock(pmap, ptpaddr & PG_FRAME, &pa)) { va_next = sva; continue;