From owner-svn-src-user@FreeBSD.ORG Mon Apr 26 14:33:33 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 0E31F1065672; Mon, 26 Apr 2010 14:33:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D45E58FC08; Mon, 26 Apr 2010 14:33:32 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 86C5646B53; Mon, 26 Apr 2010 10:33:32 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BB69A8A025; Mon, 26 Apr 2010 10:33:31 -0400 (EDT) From: John Baldwin To: Kip Macy Date: Mon, 26 Apr 2010 10:08:18 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201004260316.o3Q3G11J053280@svn.freebsd.org> In-Reply-To: <201004260316.o3Q3G11J053280@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201004261008.18820.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 26 Apr 2010 10:33:31 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r207219 - in user/kmacy/head_page_lock_2/sys/amd64: 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: Mon, 26 Apr 2010 14:33:33 -0000 On Sunday 25 April 2010 11:16:01 pm Kip Macy wrote: > Author: kmacy > Date: Mon Apr 26 03:16:00 2010 > New Revision: 207219 > URL: http://svn.freebsd.org/changeset/base/207219 > > Log: > - remove ugly lock_object casts by creating LOCKOBJPTR macros > - replace if (pa) PA_UNLOCK(pa) with PA_UNLOCK_COND(pa) > - avoid LOR in pmap_pv_demote_pde - the initial pa is already locked and subsequent pages need to > be locked with pa_tryrelock > > Modified: > user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c > user/kmacy/head_page_lock_2/sys/amd64/include/pmap.h > > Modified: user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c > ============================================================================== > --- user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c Mon Apr 26 02:35:37 2010 (r207218) > +++ user/kmacy/head_page_lock_2/sys/amd64/amd64/pmap.c Mon Apr 26 03:16:00 2010 (r207219) > @@ -177,10 +177,18 @@ struct vp_lock { > #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) > > #define PA_LOCKPTR(pa) &pa_lock[pa_index((pa)) % PA_LOCK_COUNT].vp_lock > +#define PA_LOCKOBJPTR(pa) ((struct lock_object *)PA_LOCKPTR((pa))) > #define PA_LOCK(pa) mtx_lock(PA_LOCKPTR(pa)) > #define PA_TRYLOCK(pa) mtx_trylock(PA_LOCKPTR(pa)) > #define PA_UNLOCK(pa) mtx_unlock(PA_LOCKPTR(pa)) > +#define PA_UNLOCK_COND(pa) \ > + do { \ > + if (pa) \ > + PA_UNLOCK(pa); \ > + } while (0) > + > #define PA_LOCK_ASSERT(pa, a) mtx_assert(PA_LOCKPTR(pa), (a)) > +#define PMAP_LOCKOBJPTR(pmap) ((struct lock_object *)(&(pmap)->pm_mtx)) FWIW, I would actually prefer to use something like &PA_LOCKPTR(pa)->lo_object rather than casts. -- John Baldwin