freebsd-skq/sys/compat
wpaul 15a925bf93 MDLs are supposed to be variable size (they include an array of pages
that describe a buffer of variable size). The problem is, allocating
MDLs off the heap is slow, and it can happen that drivers will allocate
lots and lots of lots of MDLs as they run.

As a compromise, we now do the following: we pre-allocate a zone for
MDLs big enough to describe any buffer with 16 or less pages. If
IoAllocateMdl() needs a MDL for a buffer with 16 or less pages, we'll
allocate it from the zone. Otherwise, we allocate it from the heap.
MDLs allocate from the zone have a flag set in their mdl_flags field.
When the MDL is released, IoMdlFree() will uma_zfree() the MDL if
it has the MDL_ZONE_ALLOCED flag set, otherwise it will release it
to the heap.

The assumption is that 16 pages is a "big number" and we will rarely
need MDLs larger than that.

- Moved the ndis_buffer zone to subr_ntoskrnl.c from kern_ndis.c
  and named it mdl_zone.

- Modified IoAllocateMdl() and IoFreeMdl() to use uma_zalloc() and
  uma_zfree() if necessary.

- Made ndis_mtop() use IoAllocateMdl() instead of calling uma_zalloc()
  directly.

Inspired by: discussion with Giridhar Pemmasani
2005-02-26 00:22:16 +00:00
..
freebsd32 Regen. 2005-02-24 18:24:29 +00:00
ia32 o Split out kernel part of execve(2) syscall into two parts: one that 2005-01-29 23:12:00 +00:00
linprocfs Match the LINUX32's style with existing style 2005-01-14 04:44:56 +00:00
linux Neuter linux_ustat() until somebody finds time to try to fix it. 2005-02-22 13:39:46 +00:00
ndis MDLs are supposed to be variable size (they include an array of pages 2005-02-26 00:22:16 +00:00
netbsd Start each of the license/copyright comments with /*- 2005-01-05 22:34:37 +00:00
pecoff remove dead code 2005-02-22 01:26:48 +00:00
svr4 fixup signal mapping: 2005-02-25 19:34:10 +00:00