From owner-freebsd-current Sun Sep 27 15:19:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA28288 for freebsd-current-outgoing; Sun, 27 Sep 1998 15:19:51 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA28264 for ; Sun, 27 Sep 1998 15:19:28 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id PAA26271; Sun, 27 Sep 1998 15:19:18 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp01.primenet.com, id smtpd026249; Sun Sep 27 15:19:10 1998 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id PAA01759; Sun, 27 Sep 1998 15:19:08 -0700 (MST) From: Terry Lambert Message-Id: <199809272219.PAA01759@usr05.primenet.com> Subject: Re: VM question To: rvb@cs.cmu.edu (Robert V. Baron) Date: Sun, 27 Sep 1998 22:19:08 +0000 (GMT) Cc: current@FreeBSD.ORG In-Reply-To: from "Robert V. Baron" at Sep 26, 98 11:36:04 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > I have a file system (Coda) in FreeBSD -current that needs to be able > to map/exec files. There are a couple ways of doing this. One way is > to have coda_bmap() return an error which will then force, > vnode_pager_generic_getpages() to call vnode_pager_input_old(). The > latter function does a simple VOP_READ to get the data. It looks like > it pretty much does the right thing. BUT it looks like it fails to > set the m->valid flag in the page it just read. (So later when > exec_map_first_page checks for m->valid == 0; it's sad and the exec > aborts.) It looks like if you do the more complicated > vnode_pager_generic_getpage() function, it will set valid. On the > otherhand, it looks like that vm_fault() which also calls > vm_pager_get_pages() does its own setting of m->valid. So my > questions is: > Should vnode_pager_input_old set m->valid and if not who > should. There are cases where the valid is being cleared when it ought not to be, specifically, when clean_only is set. Here is a patch from John Dyson which was never committed, for no reason that I have been able to determine: Someone, please, commit this. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. ---------------------------------------------------------------------------- *** vm_object.c Wed Sep 9 01:39:04 1998 --- vm_object.c.new Wed Sep 9 01:39:03 1998 *************** *** 1324,1330 **** if (all || ((start <= p->pindex) && (p->pindex < end))) { if (p->wire_count != 0) { vm_page_protect(p, VM_PROT_NONE); ! p->valid = 0; continue; } --- 1324,1331 ---- if (all || ((start <= p->pindex) && (p->pindex < end))) { if (p->wire_count != 0) { vm_page_protect(p, VM_PROT_NONE); ! if (!clean_only) ! p->valid = 0; continue; } *************** *** 1352,1359 **** if ((p = vm_page_lookup(object, start)) != 0) { if (p->wire_count != 0) { - p->valid = 0; vm_page_protect(p, VM_PROT_NONE); start += 1; size -= 1; continue; --- 1353,1361 ---- if ((p = vm_page_lookup(object, start)) != 0) { if (p->wire_count != 0) { vm_page_protect(p, VM_PROT_NONE); + if (!clean_only) + p->valid = 0; start += 1; size -= 1; continue; ---------------------------------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message