From owner-freebsd-arch@FreeBSD.ORG Mon Aug 2 16:19:02 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 744B21065676 for ; Mon, 2 Aug 2010 16:19:02 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 286BC8FC23 for ; Mon, 2 Aug 2010 16:19:01 +0000 (UTC) Received: by qyk31 with SMTP id 31so6630318qyk.13 for ; Mon, 02 Aug 2010 09:19:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=JYQnWJUCei/OKom1oJcoDrtl6R4JvVnbYwGbh4Mn+Ms=; b=Mvx4MbaFO+7n9U/gqt1vZgOVfPCeGJGZqQwvEqbesaFP+wpXJ/+qXDZVX/9blGcz2m LM2jFYTTugura/r7Q6jAkZgusWWSk/PU6PPVtRHyP4LceOEyCYGs7v0FmtxIuE8mpiAE J3mGNLfCpTuUP1BtvFehwG3228ugQaZ34h650= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=f1ygSwoshsBIZIdOwSh+6EdCkdBIDg1BkWs3CaUlR3Uam3JsEFB0IeVMHhBw3uKs3J OtAMShkzL+FkHeOs2aBwM9tX32e9ne5T3Rnck3Og7fS0W77RNJsGLGBcOAUEB7RLufOP yvcslGvaQ/8zPRKQyQYekLfsgOtsSKsAEOrMo= MIME-Version: 1.0 Received: by 10.224.19.200 with SMTP id c8mr1868936qab.70.1280765941107; Mon, 02 Aug 2010 09:19:01 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.42.6.85 with HTTP; Mon, 2 Aug 2010 09:19:00 -0700 (PDT) In-Reply-To: References: Date: Mon, 2 Aug 2010 09:19:00 -0700 X-Google-Sender-Auth: pv5NOqAPOWnqJfFyxEVAVwqBTpM Message-ID: From: mdf@FreeBSD.org To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: brueffer@freebsd.org Subject: Re: memguard(9) rewrite, part 2 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2010 16:19:02 -0000 On Thu, Jul 29, 2010 at 10:01 AM, wrote: > Back in March I asked about interest in a memguard(9) redo. =A0I've had > the time to get the code to a place I'm pretty happy with, and we've > successfully used it at work without running into some of the resource > limitations that the original memguard(9) gave. > > http://people.freebsd.org/~mdf/bsd-memguard.diff > > The gist of the new implementation is to reserve a lot of KVA for > memguard(9) to use, and then to avoid re-using KVA as long as > possible. =A0Rather than keep the physical pages around, though, on > free(9) the pages are returned to the system. =A0The KVA is allocated > using vm_map_findspace() from a current pointer into the memguard_map, > which is incremented until the end of the map is encountered, at which > time it wraps. =A0This is a "free" way to avoid re-use of KVA as long as > possible; any other scheme requires more than O(1) data to track what > has been used. I have a diff of my proposed man page update at http://people.freebsd.org/~mdf/bsd-memguard.9.diff ; my mdoc skills are in their infancy so any suggestions are welcome. Thanks, matthew