Module Name: src Committed By: kre Date: Thu Mar 14 19:10:04 UTC 2019
Modified Files: src/sys/uvm: uvm_map.c uvm_mmap.c uvm_page.c Log Message: Avoid a panic from the sequence mlock(buf, 0); munlock(buf, 0); mlock(buf, page); munlock(buf, page); where buf is page aligned, and page is actually anything > 0 (but not too big) which will get rounded up to the next multiple of the page size. In that sequence, it is possible that the 1st munlock() is optional. Add a KASSERT() (or two) to detect the first effects of the problem (without that, or in !DIAGNOSTIC kernels) the problem eventually causes some kind of problem or other (most often still a panic.) After this, mlock(anything, 0) (or munlock) validates "anything" but is otherwise a no-op (regardless of the alignment of anything). Also, don't treat mlock(buf, verybig) as equivalent to mlock(buf, 0) which is (more or less) what we had been doing. XXX pullup -8 (maybe -7 as well, need to check). To generate a diff of this commit: cvs rdiff -u -r1.358 -r1.359 src/sys/uvm/uvm_map.c cvs rdiff -u -r1.169 -r1.170 src/sys/uvm/uvm_mmap.c cvs rdiff -u -r1.198 -r1.199 src/sys/uvm/uvm_page.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.