freebsd-dev/sys
Bill Paul a944e196da 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
..
alpha Use a common multi-inclusion protection, and add such a 2005-02-19 21:16:48 +00:00
amd64 Remove recently added note about DEVICE_POLLING not working with SMP. 2005-02-25 22:07:51 +00:00
arm Add the field in the md part of the struct thread required by ARM_[GET|SET]_TP. 2005-02-26 00:02:14 +00:00
boot Document the new default init_path. 2005-02-17 11:14:45 +00:00
bsm Add a stub audit_kevents.h, which defines exactly one audit event: 2005-02-02 14:27:36 +00:00
cam Reference a pointer correctly when copying to it's location. 2005-02-21 00:28:36 +00:00
coda Replace the workaround for a deadlock bug in Coda with a different 2005-02-20 23:01:57 +00:00
compat MDLs are supposed to be variable size (they include an array of pages 2005-02-26 00:22:16 +00:00
conf Get SYSDIR set correctly for building ports. 2005-02-25 05:34:45 +00:00
contrib avoid sneaky double free 2005-02-25 00:16:53 +00:00
crypto Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
ddb Start each of the license/copyright comments with /*- 2005-01-06 01:34:41 +00:00
dev Remove duplicate FBSDID. 2005-02-26 00:21:25 +00:00
doc
fs remove dead code 2005-02-22 19:02:24 +00:00
gdb /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:27:30 +00:00
geom Correctly calculate what to do and how to retry a request to a plex when 2005-02-23 14:59:14 +00:00
gnu move ptr deref's to after null ptr checks 2005-02-24 01:40:52 +00:00
i4b /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 22:18:23 +00:00
i386 kill unused value 2005-02-25 23:06:25 +00:00
ia64 Remove acpi_perf from {ARCH}/conf/NOTES, to make tinderbox happy. 2005-02-25 07:10:37 +00:00
isa Use the local APIC timer to drive the various kernel clocks on SMP machines 2005-02-08 20:25:07 +00:00
isofs/cd9660 Conditionalize cd9660 chattiness regarding the nature of the file system 2005-02-18 10:49:55 +00:00
kern Remove recently added note about DEVICE_POLLING not working with SMP. 2005-02-25 22:07:51 +00:00
libkern Add strspn() to libkern. 2005-02-10 20:39:39 +00:00
modules The chip specific functions have been split out in their own 2005-02-25 09:49:29 +00:00
net Change the definition of struct if_data's member ifi_epoch from wall 2005-02-25 19:46:41 +00:00
net80211 mark timestamp for pending fragments 2005-02-23 04:52:30 +00:00
netatalk When generating a phase II ARP lookup from aarpwhohas(), use a 2005-02-22 14:37:22 +00:00
netatm In the current world order, solisten() implements the state transition of 2005-02-21 21:58:17 +00:00
netgraph In the current world order, solisten() implements the state transition of 2005-02-21 21:58:17 +00:00
netinet New lines when logging. 2005-02-25 11:26:39 +00:00
netinet6 remove dead code 2005-02-25 22:58:25 +00:00
netipsec /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
netipx In the current world order, solisten() implements the state transition of 2005-02-21 21:58:17 +00:00
netkey fixed an unexpected addr/port matching failure in IPv6 SA management 2005-01-10 13:06:42 +00:00
netnatm Mark netatm and netnatm explicitly as requiring Giant, as they still do. 2005-02-17 14:21:22 +00:00
netncp avoid potential null ptr derefs 2005-02-23 22:44:38 +00:00
netsmb /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
nfs4client Follow v_id changes in NFSv[23] 2005-02-22 15:15:28 +00:00
nfsclient vp->v_id is a private field for the vfs namecache and it is a big mistake 2005-02-22 14:52:00 +00:00
nfsserver Don't try to create vnode_pager objects on other filesystems vnodes, 2005-01-24 22:09:13 +00:00
opencrypto /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
pc98 Remove recently added note about DEVICE_POLLING not working with SMP. 2005-02-25 22:07:51 +00:00
pccard Remove more deadwood that never got implemented in NEWCARD, since NEWCARD 2005-02-15 02:54:53 +00:00
pci Add back 'n' that went missing in last commit 2005-02-25 03:43:43 +00:00
posix4 /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
powerpc Add PVO_FAKE flag to pvo entries for PG_FICTITIOUS mappings, to 2005-02-25 02:42:15 +00:00
rpc /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
security Remove an accidental clearing of the new label pointer on a system V 2005-02-24 16:08:41 +00:00
sparc64 Silence witness warnings about duplicate pmap lock emitted since 2005-02-18 15:37:34 +00:00
sys Change the definition of struct if_data's member ifi_epoch from wall 2005-02-25 19:46:41 +00:00
tools Add VOP_FOO_APV() which takes a pointer to the vop_vector. 2005-02-08 12:54:32 +00:00
ufs - Add VOP locking asserts in several functions that have been implicated in 2005-02-22 23:56:42 +00:00
vm Revert the first part of revision 1.114 and modify the second part. On 2005-02-24 06:13:01 +00:00
Makefile