Peter Wemm wrote: > > No. FreeBSD does not make active use of 4M pages for anything > > other than the initial kernel text and data, which is obvious, > > if you look at /sys/i386/machdep.c. > > Actually, it is obvious if you actually do look at the pmap.c that we *do* > use 4MB pages for device mappings.
The "active use" I was referring to was kernel space, and this sets PG_U, so there are not fault handler invocations on attempts to write the pages. This code also does not set the PG_G bit, like Linux does. This code has a requirement that the address mapping occur on a 4M boundary, and that it be an even multiple of 4M. My reading of the AGPGART kernel module indicates to me that this code is not triggered in normal use. Correct me if my interpretation here is wrong (I'd like to know *how*; the default aperture appears to be 1M, unless it is overridden, and the alignment isn't on the right boundary). In any case, let's say that it gets invoked on the AGP hardware, and establishes a 4M mapping on FreeBSD, as well. I think the Linux problem has more to do with having *both* 4K and 4M mappings to the same physical memory area at the same time. FreeBSD avoids doing this to active pages; the initial setup replaces the PDE and "loses" the 4K worth of 4K mapping tables, and the later code that you reference doesn't replace any existing entries. It's accidental, but still, it should mean that FreeBSD is not succeptible to the problem. The real hint in characterizing the problem is to ask "why does it happen with 4M pages, but doesn't also happen with 4K pages?". This indicates that the problem is really a TLB problem, and therefore a real processor problem: the problem should happen no matter what, if it's a problem with writing to mapped memory use by the AGP not giving an invalidation signal to the CPU on writes, rather than a problem in the CPUs handling of 4M page invalidation itself, a problem that does not exist in the 4K invalidation case. Unfortuantely, I would need to upgrade both my FreeBSD and my XFree86 to try this with the AGP on my AMD box (it has a 0x7121 ID, and so can't GARTIOCINFO correctly) to be able to even try to repeat the problem, and Fry's does not appear to be selling FreeBSD CDROM sets any more, even with the books attached. 8-(. -- Terry To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message