From owner-cvs-all@FreeBSD.ORG Fri Dec 30 14:04:29 2005 Return-Path: X-Original-To: cvs-all@freebsd.org 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 CAF3116A41F; Fri, 30 Dec 2005 14:04:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48E6443D4C; Fri, 30 Dec 2005 14:04:28 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 4872971 for multiple; Fri, 30 Dec 2005 09:02:29 -0500 Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id jBUE4Op5048996; Fri, 30 Dec 2005 09:04:26 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Pawel Jakub Dawidek Date: Fri, 30 Dec 2005 09:04:12 -0500 User-Agent: KMail/1.8.3 References: <200512301145.jBUBj7fW043290@repoman.freebsd.org> <200512300815.57417.jhb@freebsd.org> <20051230134215.GE779@garage.freebsd.pl> In-Reply-To: <20051230134215.GE779@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200512300904.14227.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1219/Wed Dec 28 17:57:59 2005 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_malloc.c src/sys/sys malloc.h src/sys/vm memguard.c memguard.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 30 Dec 2005 14:04:30 -0000 On Friday 30 December 2005 08:42 am, Pawel Jakub Dawidek wrote: > On Fri, Dec 30, 2005 at 08:15:56AM -0500, John Baldwin wrote: > +> On Friday 30 December 2005 06:45 am, Pawel Jakub Dawidek wrote: > +> > pjd 2005-12-30 11:45:07 UTC > +> > > +> > FreeBSD src repository > +> > > +> > Modified files: > +> > sys/kern kern_malloc.c > +> > sys/sys malloc.h > +> > sys/vm memguard.c memguard.h > +> > Log: > +> > Improve memguard a bit: > +> > - Provide tunable vm.memguard.desc, so one can specify memory type > +> > without changing the code and recompiling the kernel. > +> > - Allow to use memguard for kernel modules by providing sysctl > +> > vm.memguard.desc, which can be changed to short description of > memory +> > type before module is loaded. > +> > +> You don't actually need a sysctl for this case. You can use kenv to s= et > a +> tunable after boot but before loading the module to achieve the same > purpose. +> E.g. 'kenv vm.memguard.desc=3DFOO' will work and TUNABLE_FET= CH > will find it +> during a subsequent kldload. Just FYI. > > But I need to control vm.memguard.desc change to be able to detect if > memory type has allocated memory already, etc. and eventually deny the > change. > AFAIK it won't be possible with kenv. =46or the case I quoted (_before_ kldload) you must be doing all that check= ing=20 when you load the module either via MOD_LOAD in a module event or a SYSINIT= =2E =20 In that case, setting the tunable via kenv before you kldload is identical = to=20 setting the tunable in the loader, then booting and then kldloading the=20 module. =2D-=20 John Baldwin =A0<>< =A0http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =A0=3D =A0http://www.FreeBSD.org