Date: Fri, 7 Feb 1997 09:45:47 +1100 From: Bruce Evans <bde@zeta.org.au> To: Shimon@i-Connect.Net, toor@dyson.iquest.net Cc: freebsd-hackers@freebsd.org, freebsd-scsi@freebsd.org Subject: Re: Contigious (spelling?) allocation in kernel Message-ID: <199702062245.JAA06777@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>> Take a look at contigmalloc() or vm_page_alloc_contig() >> as defined in /sys/vm/vm_page.c. These are almost >> guaranteed NOT to work after the system is fully up. >... >If you (or someone else) please elaborate on the last sentence, >please... Physical memory gets fragmented after the system has been running for a little while, so the chance of finding N physically contiguous is small if N > 1. >question is: Does the kernel malloc guarantee that allocations >smaller than (or equal to) a page are in the same page? Yes. >BACKGROUND: One of my engineers, who is heavily involved in >Linux SCSI development is strongly opposed to calling malloc on >demand in a device driver. He quotes heavy performance >penalties, and worse; Failure (under heavy load) to obtain the >memory when needed. Good advice. The performance penalties for nonblocking mallocs aren't large under FreeBSD, except when you allocate pages that would be better used for something else, but failure (under not so heavy load) is likely if you attempt to allocate more than a page or two. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702062245.JAA06777>