From f520d2c34a388af8365a4f5a0f523cecfb025906 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 6 Feb 2015 10:58:36 +0000 Subject: Clear PQ_AOBJ before calling uvm_pagefree(), clearing up one false XXX comment (one is fixed, one is deleted). ok kettenis beck --- sys/uvm/uvm_page.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/uvm/uvm_page.c') diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 3c93ee8907b..6b53632de6f 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.132 2014/11/16 12:31:00 deraadt Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.133 2015/02/06 10:58:35 deraadt Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ /* @@ -1053,7 +1053,7 @@ uvm_pagefree(struct vm_page *pg) } /* Clean page state bits. */ - flags_to_clear |= PQ_AOBJ; /* XXX: find culprit */ + KASSERT(!(pg->pg_flags & PQ_AOBJ)); flags_to_clear |= PQ_ENCRYPT|PG_ZERO|PG_FAKE|PG_BUSY|PG_RELEASED| PG_CLEAN|PG_CLEANCHK; atomic_clearbits_int(&pg->pg_flags, flags_to_clear); @@ -1098,10 +1098,12 @@ uvm_page_unbusy(struct vm_page **pgs, int npgs) if (uobj != NULL) { uvm_lock_pageq(); pmap_page_protect(pg, PROT_NONE); - /* XXX won't happen right now */ - if (pg->pg_flags & PQ_AOBJ) + if (pg->pg_flags & PQ_AOBJ) { uao_dropswap(uobj, pg->offset >> PAGE_SHIFT); + atomic_clearbits_int(&pg->pg_flags, + PQ_AOBJ); + } uvm_pagefree(pg); uvm_unlock_pageq(); } else { -- cgit v1.2.3