Zone Allocator Initialization Question

Arlie Stephens arlie at worldash.org
Fri Jul 15 19:44:00 UTC 2016


Never mind. This is beautiful code; very easy to follow. I'm now
self-educated on zone allocator initialization. 

If I'd realized it would be this clear, I wouldn't have bothered the
list by posting a query. Kudos to the authors. 

--Arlie

On Jul 14 2016, Arlie Stephens wrote:
> 
> Hi Folks,
> 
> I'm chasing yet another kernel memory corruption in an obsolete
> version of FreeBSD (8.4 in this case). I expect that it will turn out
> to be a bug in some local customization, as they usually are. So I'm
> not looking for help with actually debugging it ;-)
> 
> What I would like help with is understanding something my
> instrumentation is reporting, on systems that don't appear to have the
> problem. 
> 
> In brief, I'm seeing what appears to be uma_zalloc() returning a
> pointer to a virtual address that does not have PG_SLAB set on the 
> vm_page_t for the corresponding physical page. 
> 
> Most allocations from that zone are fine; I only see one strange one,
> and that's fairly early in the system lifetime. (It's one of the
> "struct file" for files opened by init.) 
> 
> Is there some kind of bootstrap situation with the zone allocator,
> where certain early use zones get their first memory via a path that
> doesn't mark PG_SLAB?  And if so, is there any other way to recognize
> those addresses as coming from a zone? (My corruption is scribbling on
> process' fd_ofiles[] arrays, so I'm trying to write a sanity checker,
> and was really surprised to find a valid-seeming struct file * that
> didn't appear to have come from the right place.)
> 
> Thanks in advance for any enlightenment.
> 

-- 
Arlie

(Arlie Stephens					arlie at worldash.org)


More information about the freebsd-hackers mailing list