david@... said:
> However, I decided to install ntp, which it started to do, then it
> just stopped dead - No kernel panic, no syslog entry, no anything.
> Can't ping it, can't make it do anything at the console, can't Ctrl-C
> in gdb to check what's happening.
I took another look at this and figured out what was happening.
UML maps itself into the middle of each process address space. It gives
each process vmas describing these areas so that mmap knows that they are
taken and that it shouldn't try to use them for anything.
However, these areas don't have ptes. That costs memory, and seemed
unnecessary. So, according to the ptes, those pages aren't present. In
reality, of course, they are. This hasn't caused problems because in order
to come to the attention of the low-level mapping code, ptes need a bit set
saying that they have recently changed. These ptes don't get that bit set,
so they have been safe.
But, ntpd calls mlockall, which walks the vmas, forcing the pages behind
them into memory if they're not already. So, these kernel areas, which
don't have ptes, look like they're not present, and get marked as needing
remapping. So, when the remapping code sees that, it starts unmapping
the kernel text. It only gets to the first page because it needs stuff
there, and goes into an endless segfault loop on it.
The fix is to provide ptes for all the kernel stuff in order to prevent
them from being fooled with. This is somewhat painful because of the
extra memory that needs to be allocated, but it's somewhat necessary until
I rearrange the address spaces to be somewhat more sane.
Jeff
|