From owner-cvs-all@FreeBSD.ORG Sat Feb 26 00:22:16 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 91EFE16A4CE; Sat, 26 Feb 2005 00:22:16 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72A0343D2D; Sat, 26 Feb 2005 00:22:16 +0000 (GMT) (envelope-from wpaul@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j1Q0MGfq025244; Sat, 26 Feb 2005 00:22:16 GMT (envelope-from wpaul@repoman.freebsd.org) Received: (from wpaul@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j1Q0MG80025243; Sat, 26 Feb 2005 00:22:16 GMT (envelope-from wpaul) Message-Id: <200502260022.j1Q0MG80025243@repoman.freebsd.org> From: Bill Paul Date: Sat, 26 Feb 2005 00:22:16 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/compat/ndis kern_ndis.c ntoskrnl_var.h subr_ntoskrnl.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Feb 2005 00:22:16 -0000 wpaul 2005-02-26 00:22:16 UTC FreeBSD src repository Modified files: sys/compat/ndis kern_ndis.c ntoskrnl_var.h subr_ntoskrnl.c Log: 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 Revision Changes Path 1.68 +2 -15 src/sys/compat/ndis/kern_ndis.c 1.29 +4 -0 src/sys/compat/ndis/ntoskrnl_var.h 1.56 +41 -3 src/sys/compat/ndis/subr_ntoskrnl.c