Date: Sun, 27 Sep 1998 22:19:08 +0000 (GMT) From: Terry Lambert <tlambert@primenet.com> To: rvb@cs.cmu.edu (Robert V. Baron) Cc: current@FreeBSD.ORG Subject: Re: VM question Message-ID: <199809272219.PAA01759@usr05.primenet.com> In-Reply-To: <yzsiuiamdln.fsf@sicily.odyssey.cs.cmu.edu> from "Robert V. Baron" at Sep 26, 98 11:36:04 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809272219.PAA01759>