UMA zone alloc on large UMA zone causing Page fault in kernel mode

Jonathan Stuart jstuart at adaranet.com
Tue Mar 8 21:20:29 UTC 2011


Thanks John.  Yes, it is amd64.  I decreased the size and we're working around it that way for now.. I will do debugging in the future, because we have some other zones that we need to be pretty large.

Jonathan

-----Original Message-----
From: John Baldwin [mailto:jhb at freebsd.org]
Sent: Tuesday, March 08, 2011 5:29 AM
To: freebsd-hackers at freebsd.org
Cc: Jonathan Stuart; Patrick Mahan
Subject: Re: UMA zone alloc on large UMA zone causing Page fault in kernel mode

On Monday, March 07, 2011 5:54:47 pm Jonathan Stuart wrote:
> Hiya all,
>
> Does anyone have any idea why a large UMA zone created without the UMA_ZONE_PAGEABLE flag would page fault in kernel mode when I uma_zalloc one
item with M_ZERO | M_WAITOK.  The fault takes place during the bzero'ing of
> the memory.. the pointer *looks* valid, as well.  This does not happen with some smaller zones I've been using.
> The zone shows up in ddb's "show uma", and it's size 620756992.
>
> Do I need to use UMA_ZONE_NOFREE to keep it in memory?  This was not my understanding of that flag.

No, that just prevents free slabs from being returned to the system.

Is this on amd64?  Some questions, things you can try if so:

See if it is a direct-mapped address.  If it is, then I'm at a loss as to why
this would fault.  Maybe verify that the physical addresses backed by that
range are valid via SMAP?

If it is not direct-mapped, grab my gdb scripts from
http://www.freebsd.org/~jhb/gdb/.  Then fire up kgdb on the crashdump, cd to
a directory holding the scripts and do 'source gdb6'.  Then you can use the
'kvm' command to display a rough layout of the kernel's address space.  Make
sure the virtual address range is backed by something valid.

If it is then you might want to write some custom gdb scripts to find the
right vm_map_entry in the kernel_map for your address range and find the
backing VM object and starting offset.  Then you can use gdb to examine
the pages assigned to that VM object at that offset and ensure they are
valid, etc.  You might also try examining the PTE's directly as well.

--
John Baldwin


More information about the freebsd-hackers mailing list