From owner-p4-projects@FreeBSD.ORG Mon May 1 01:29:28 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3775F16A405; Mon, 1 May 2006 01:29:28 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1110116A401 for ; Mon, 1 May 2006 01:29:28 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B81DE43D45 for ; Mon, 1 May 2006 01:29:27 +0000 (GMT) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k411TR5X042744 for ; Mon, 1 May 2006 01:29:27 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k411TRCS042741 for perforce@freebsd.org; Mon, 1 May 2006 01:29:27 GMT (envelope-from kmacy@freebsd.org) Date: Mon, 1 May 2006 01:29:27 GMT Message-Id: <200605010129.k411TRCS042741@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 96460 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2006 01:29:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=96460 Change 96460 by kmacy@kmacy_storage:sun4v_rwbuf on 2006/05/01 01:28:40 add missing bucket unlocks Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#39 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/pmap.c#39 (text+ko) ==== @@ -972,10 +972,9 @@ else tte_data |= TTE_MINFLAGS; - if ((otte_data & ~(VTD_W|VTD_REF)) != tte_data) { + if ((otte_data & ~(VTD_W|VTD_REF|VTD_LOCK)) != tte_data) { if (otte_data & VTD_V) { invlva = FALSE; - *otte = tte_data; if (otte_data & VTD_REF) { if (otte_data & VTD_MANAGED) vm_page_flag_set(om, PG_REFERENCED); @@ -989,6 +988,11 @@ if ((prot & VM_PROT_WRITE) == 0) invlva = TRUE; } + DPRINTF("update *otte 0x%lx -> 0x%lx\n", otte_data, tte_data); + *otte = tte_data; + + if (!(otte_data & VTD_LOCK)) + tte_hash_bucket_unlock(pmap->pm_hash, va); #ifdef notyet if (invlva) #endif @@ -997,9 +1001,13 @@ tte_hash_insert(pmap->pm_hash, va, tte_data); membar(Sync); } + } else { + if (!(*otte & VTD_LOCK)) + tte_hash_bucket_unlock(pmap->pm_hash, va); + else + *otte = (*otte & ~VTD_LOCK); } - sched_unpin(); PMAP_UNLOCK(pmap); vm_page_unlock_queues(); @@ -1556,7 +1564,11 @@ vm_page_t m; retry: tte = tte_hash_lookup(pmap->pm_hash, tva, TRUE); - otte_data = tte_data = tte ? *tte : 0; + if (tte == NULL) + continue; + + otte_data = tte_data = *tte; + if (tte_data & VTD_MANAGED) { m = NULL; if (tte_data & VTD_REF) { @@ -1573,10 +1585,15 @@ tte_data &= ~(VTD_SW_W | VTD_W); if (tte_data != otte_data) { - if (!atomic_cmpset_long(tte, otte_data, tte_data)) + if (!atomic_cmpset_long(tte, otte_data, tte_data)) { + /* XXX this should never happen with hash bucket locks - FIXME */ + panic("bucket locked but tte data changed"); + tte_hash_bucket_unlock(pmap->pm_hash, tva); goto retry; + } anychanged = 1; } + tte_hash_bucket_unlock(pmap->pm_hash, tva); }