From owner-svn-src-user@FreeBSD.ORG Tue Apr 20 22:46:23 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 8076B1065677; Tue, 20 Apr 2010 22:46:23 +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 707B88FC13; Tue, 20 Apr 2010 22:46:23 +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 o3KMkNAq067586; Tue, 20 Apr 2010 22:46:23 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3KMkN2h067584; Tue, 20 Apr 2010 22:46:23 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201004202246.o3KMkN2h067584@svn.freebsd.org> From: Kip Macy Date: Tue, 20 Apr 2010 22:46:23 +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: r206947 - user/kmacy/head_page_lock_2/sys/amd64/include 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: Tue, 20 Apr 2010 22:46:23 -0000 Author: kmacy Date: Tue Apr 20 22:46:23 2010 New Revision: 206947 URL: http://svn.freebsd.org/changeset/base/206947 Log: add generation macros and flag changes Modified: user/kmacy/head_page_lock_2/sys/amd64/include/pmap.h Modified: user/kmacy/head_page_lock_2/sys/amd64/include/pmap.h ============================================================================== --- user/kmacy/head_page_lock_2/sys/amd64/include/pmap.h Tue Apr 20 22:45:12 2010 (r206946) +++ user/kmacy/head_page_lock_2/sys/amd64/include/pmap.h Tue Apr 20 22:46:23 2010 (r206947) @@ -237,6 +237,8 @@ struct md_page { int pat_mode; }; +#define PMAP_IN_RETRY 0x1 + /* * The kernel virtual address (KVA) of the level 4 page table page is always * within the direct map (DMAP) region. @@ -246,8 +248,8 @@ struct pmap { pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ u_int pm_active; /* active on cpus */ - u_int pm_gen_count; /* generation count (pmap lock dropped) */ - /* spare u_int here due to padding */ + uint16_t pm_gen_count; /* generation count (pmap lock dropped) */ + uint16_t pm_flags; struct pmap_statistics pm_stats; /* pmap statistics */ vm_page_t pm_root; /* spare page table pages */ vm_page_t pm_free; /* Temporary free pages. */ @@ -259,7 +261,18 @@ typedef struct pmap *pmap_t; extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -#define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) +#define PMAP_UPDATE_GEN_COUNT(pmap) \ + do { \ + if (pmap->pm_flags & PMAP_IN_RETRY) \ + pmap->pm_gen_count++; \ + } while (0) + +#define PMAP_LOCK(pmap) \ + do { \ + mtx_lock(&(pmap)->pm_mtx); \ + PMAP_UPDATE_GEN_COUNT((pmap)); \ + } while (0) + #define PMAP_LOCKPTR(pmap) (&(pmap)->pm_mtx) #define PMAP_LOCK_ASSERT(pmap, type) \