allocating large piece of contiguous kernel memory

Konstantin Belousov kostikbel at gmail.com
Thu Jan 25 17:21:41 UTC 2018


On Thu, Jan 25, 2018 at 05:52:57PM +0100, Hartmut Brandt wrote:
> Hi all,
> 
> for a device driver communicating with an FPGA I would like to allocate
> an 8GByte piece or two 4GByte pieces of contiguous memory in the device 
> driver. The machine is amd64 and has 256GByte.
> 
> The maximum I can allocate is 512MByte. If I try more (in one piece or in 
> two pieces) contigfree() crashes in pmap_resident_count_dec() with an 
> "pmap resident count underflow".
> 
> Is this something which is not supposed to work? Or is there something 
> tunable or is this a bug?

I suspect a bug. Print out the value of
kernel_pmap->pm_stats.resident_count before and after contigmalloc. Also
interesting are the values of the resident count and decrement at the
panic time (but they are already printed by the panic, you did not shown
them).



More information about the freebsd-hackers mailing list