From robert@gizmo.quizbot.org  Thu Mar 22 12:28:47 2001
Return-Path: <robert@gizmo.quizbot.org>
Received: from gizmo.quizbot.org (blndi4-145-253-141-072.arcor-ip.net [145.253.141.72])
	by hub.freebsd.org (Postfix) with ESMTP id 3BD7E37B71C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 22 Mar 2001 12:28:46 -0800 (PST)
	(envelope-from robert@gizmo.quizbot.org)
Received: (from robert@localhost)
	by gizmo.quizbot.org (8.11.0/8.11.0) id f2MKSdG01430;
	Thu, 22 Mar 2001 21:28:39 +0100 (CET)
	(envelope-from robert)
Message-Id: <200103222028.f2MKSdG01430@gizmo.quizbot.org>
Date: Thu, 22 Mar 2001 21:28:39 +0100 (CET)
From: Robert.Drehmel@gizmo.quizbot.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: Changing zone(9) man page
X-Send-Pr-Version: 3.2

>Number:         26006
>Category:       docs
>Synopsis:       Changing zone(9) man page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jeff
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 22 12:30:00 PST 2001
>Closed-Date:    Sun Dec 05 23:27:31 GMT 2004
>Last-Modified:  Sun Dec 05 23:27:31 GMT 2004
>Originator:     Robert Drehmel
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:

	FreeBSD 5.0-CURRENT

>Description:

	I think some information in the manual page for the VM zone allocator
	is inaccurate or just unclear expressed.
	A structure allocated by the zone allocator does not have to reserve
	its two first fields for allocation management pointers.  One of
	them is used to point to the next available item, but only if it is
	available itself; look at the patch for a description of the other
	one.
	The patch also adds a reference to a chapter in a book.

>How-To-Repeat:

	Look at the man page zone(9).

>Fix:

Index: zone.9
===================================================================
RCS file: /home/ncvs/src/share/man/man9/zone.9,v
retrieving revision 1.3
diff -r1.3 zone.9
63,73c63,73
< The zone allocator stores state information inside the items proper,
< so structures that will be managed by the zone allocator must reserve
< two pointers at the very beginning for internal use by the zone
< allocator, as follows:
< .Bd -literal
< struct my_item {
<         struct my_item  *z_rsvd1;
<         struct my_item  *z_rsvd2;
<         /* rest of structure */
< };
< .Ed
---
> While an item is not in use, the first sizeof(void *) bytes are used
> for a pointer to another available item.  When allocated, all of the 
> item's space is available, except with
> .Dv INVARIANTS
> defined, where the second sizeof(void *) bytes are used for sanity
> checks, and we would get a panic trying to free the item if those bytes
> were somehow changed to
> .Dv ZENTRY_FREE .
> .Pp
> A similar algorithm is further described in Donald Knuth's `The Art of
> Computer Programming' volume 1, starting at page 254 (section 2.2.3).
191c191,193
< .An Dag-Erling Co\(:idan Sm\(/orgrav Aq des@FreeBSD.org .
---
> .An Dag-Erling Co\(:idan Sm\(/orgrav Aq des@FreeBSD.org
> and modified by
> .An Robert Drehmel .
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: murray 
State-Changed-When: Mon Sep 3 16:41:50 PDT 2001 
State-Changed-Why:  
Someone with the requisite kernel-foo needs to look over this PR. 
I've emailed des (the author of the man page) to confirm that this 
submission is correct. 


http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26006 
Responsible-Changed-From-To: freebsd-doc->des 
Responsible-Changed-By: nik 
Responsible-Changed-When: Wed Jan 9 05:31:01 PST 2002 
Responsible-Changed-Why:  
DES -- in your court at the moment.  Is the patch OK to be committed? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26006 
Responsible-Changed-From-To: des->jeff 
Responsible-Changed-By: des 
Responsible-Changed-When: Sat Jun 1 04:32:42 PDT 2002 
Responsible-Changed-Why:  
Jeff has rewritten the allocator. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26006 
State-Changed-From-To: analyzed->closed 
State-Changed-By: hmp 
State-Changed-When: Sun Dec 5 23:25:57 GMT 2004 
State-Changed-Why:  
The allocator was re-written, and so was the manual page to accomodate 
the new design (i.e. UMA). 


http://www.freebsd.org/cgi/query-pr.cgi?pr=26006 
>Unformatted:
