slab.ps

来自「这是一个介绍 linux 编程知识的文章。」· PS 代码 · 共 1,690 行 · 第 1/5 页

PS
1,690
字号
%!PS
%%Version: 3.15
%%DocumentFonts: (atend)
%%Pages: (atend)
%%EndComments
%ident	"@(#)lp:filter/postscript/postscript/dpost.ps	1.1"
%
% Version 3.16 prologue for troff files.
%

/#copies 1 store
/aspectratio 1 def
/formsperpage 1 def
/landscape false def
/linewidth .3 def
/magnification 1 def
/margin 0 def
/orientation 0 def
/resolution 720 def
/xoffset 0 def
/yoffset 0 def

/roundpage true def
/useclippath true def
/pagebbox [0 0 612 792] def

/R  /Times-Roman def
/I  /Times-Italic def
/B  /Times-Bold def
/BI /Times-BoldItalic def
/H  /Helvetica def
/HI /Helvetica-Oblique def
/HB /Helvetica-Bold def
/HX /Helvetica-BoldOblique def
/CW /Courier def
/CO /Courier def
/CI /Courier-Oblique def
/CB /Courier-Bold def
/CX /Courier-BoldOblique def
/PA /Palatino-Roman def
/PI /Palatino-Italic def
/PB /Palatino-Bold def
/PX /Palatino-BoldItalic def
/Hr /Helvetica-Narrow def
/Hi /Helvetica-Narrow-Oblique def
/Hb /Helvetica-Narrow-Bold def
/Hx /Helvetica-Narrow-BoldOblique def
/KR /Bookman-Light def
/KI /Bookman-LightItalic def
/KB /Bookman-Demi def
/KX /Bookman-DemiItalic def
/AR /AvantGarde-Book def
/AI /AvantGarde-BookOblique def
/AB /AvantGarde-Demi def
/AX /AvantGarde-DemiOblique def
/NR /NewCenturySchlbk-Roman def
/NI /NewCenturySchlbk-Italic def
/NB /NewCenturySchlbk-Bold def
/NX /NewCenturySchlbk-BoldItalic def
/ZD /ZapfDingbats def
/ZI /ZapfChancery-MediumItalic def
/VR /Varitimes#Roman def
/VI /Varitimes#Italic def
/VB /Varitimes#Bold def
/VX /Varitimes#BoldItalic def
/S  /S def
/S1 /S1 def
/GR /Symbol def

/inch {72 mul} bind def
/min {2 copy gt {exch} if pop} bind def

/setup {
	counttomark 2 idiv {def} repeat pop

	landscape {/orientation 90 orientation add def} if
	/scaling 72 resolution div def
	linewidth setlinewidth
	1 setlinecap

	pagedimensions
	xcenter ycenter translate
	orientation neg rotate
	width 2 div neg height 2 div translate
	xoffset inch yoffset inch translate
	margin 2 div dup neg translate
	magnification dup aspectratio mul scale
	scaling scaling scale

	/Symbol /S Sdefs cf
	/Times-Roman /S1 S1defs cf
	0 0 moveto
} def

/pagedimensions {
	useclippath userdict /gotpagebbox known not and {
		/pagebbox [clippath pathbbox newpath] def
		roundpage currentdict /roundpagebbox known and {roundpagebbox} if
	} if
	pagebbox aload pop
	4 -1 roll exch 4 1 roll 4 copy
	landscape {4 2 roll} if
	sub /width exch def
	sub /height exch def
	add 2 div /xcenter exch def
	add 2 div /ycenter exch def
	userdict /gotpagebbox true put
} def

/pagesetup {
	/page exch def
	currentdict /pagedict known currentdict page known and {
		page load pagedict exch get cvx exec
	} if
} def

/decodingdefs [
	{counttomark 2 idiv {y moveto show} repeat}
	{neg /y exch def counttomark 2 idiv {y moveto show} repeat}
	{neg moveto {2 index stringwidth pop sub exch div 0 32 4 -1 roll widthshow} repeat}
	{neg moveto {spacewidth sub 0.0 32 4 -1 roll widthshow} repeat}
	{counttomark 2 idiv {y moveto show} repeat}
	{neg setfunnytext}
] def

/setdecoding {/t decodingdefs 3 -1 roll get bind def} bind def

/w {neg moveto show} bind def
/m {neg dup /y exch def moveto} bind def
/done {/lastpage where {pop lastpage} if} def

/f {
	dup /font exch def findfont exch
	dup /ptsize exch def scaling div dup /size exch def scalefont setfont
	linewidth ptsize mul scaling 10 mul div setlinewidth
	/spacewidth ( ) stringwidth pop def
} bind def

/changefont {
	/fontheight exch def
	/fontslant exch def
	currentfont [
		1 0
		fontheight ptsize div fontslant sin mul fontslant cos div
		fontheight ptsize div
		0 0
	] makefont setfont
} bind def

/sf {f} bind def

/cf {
	dup length 2 idiv
	/entries exch def
	/chtab exch def
	/newfont exch def

	findfont dup length 1 add dict
	/newdict exch def
	{1 index /FID ne {newdict 3 1 roll put} {pop pop} ifelse} forall

	newdict /Metrics entries dict put
	newdict /Metrics get
	begin
		chtab aload pop
		1 1 entries {pop def} for
		newfont newdict definefont pop
	end
} bind def

%
% A few arrays used to adjust reference points and character widths in some
% of the printer resident fonts. If square roots are too high try changing
% the lines describing /radical and /radicalex to,
%
%	/radical	[0 -75 550 0]
%	/radicalex	[-50 -75 500 0]
%

/Sdefs [
	/bracketlefttp		[220 500]
	/bracketleftbt		[220 500]
	/bracketrighttp		[-70 380]
	/bracketrightbt		[-70 380]
	/braceleftbt		[220 490]
	/bracketrightex		[220 -125 500 0]
	/radical		[0 0 550 0]
	% NeWSprint's \(br is too low, compensate
	statusdict /product get (NeWS Server) eq {
		/radicalex		[-50 100 500 0]
		/parenleftex		[-20 100 0 0]

	} {
		/radicalex		[-50 0 500 0]
		/parenleftex		[-20 -170 0 0]
	} ifelse
	/integral		[100 -50 500 0]
	/infinity		[10 -75 730 0]
] def

/S1defs [
	/underscore		[0 80 500 0]
	/endash			[7 90 650 0]
] def
%%EndProlog
%%BeginSetup
mark
/resolution 720 def
setup
2 setdecoding
%%EndSetup
%%Page: 1 1
save
mark
1 pagesetup
14 B f
(The Slab Allocator:)2 1196 1 2332 1240 t
(An Object-Caching Kernel Memory Allocator)4 2793 1 1533 1400 t
12 I f
(Jeff Bonwick)1 627 1 2616 1700 t
(Sun Microsystems)1 881 1 2489 1840 t
10 B f
(Abstract)1484 2444 w
10 R f
( comprehensive design over-)3 1234(This paper presents a)3 926 2 590 2606 t
( kernel memory allocator.)3 1124(view of the SunOS 5.4)4 1036 2 590 2726 t
( based on a set of object-caching)6 1464(This allocator is)2 696 2 590 2846 t
( of allocating complex)3 920(primitives that reduce the cost)4 1240 2 590 2966 t
( These)1 308( state between uses.)3 823(objects by retaining their)3 1029 3 590 3086 t
( prove equally effective for manag-)5 1504(same primitives)1 656 2 590 3206 t
( data pages and temporary)4 1087(ing stateless memory \(e.g.)3 1073 2 590 3326 t
( they are space-ef\256cient and fast.)5 1472(buffers\) because)1 688 2 590 3446 t
(The allocator's object caches respond dynamically)5 2160 1 590 3566 t
( an object-)2 463(to global memory pressure, and employ)5 1697 2 590 3686 t
( that improves the system's overall)5 1486(coloring scheme)1 674 2 590 3806 t
( allocator)1 412( The)1 251( and bus balance.)3 801(cache utilization)1 696 4 590 3926 t
( features)1 370(also has several statistical and debugging)5 1790 2 590 4046 t
( detect a wide range of problems throughout)7 1836(that can)1 324 2 590 4166 t
(the system.)1 458 1 590 4286 t
11 B f
(1. Introduction)1 755 1 590 4586 t
10 R f
(The allocation and freeing of objects are among the)8 2160 1 590 4748 t
( fast ker-)2 382( A)1 144( kernel.)1 313(most common operations in the)4 1321 4 590 4868 t
( How-)1 311(nel memory allocator is therefore essential.)5 1849 2 590 4988 t
( initializing and)2 704(ever, in many cases the cost of)6 1456 2 590 5108 t
( cost of allocating)3 767(destroying the object exceeds the)4 1393 2 590 5228 t
( while improve-)2 690( Thus,)1 309( memory for it.)3 683(and freeing)1 478 4 590 5348 t
( bene\256cial, even greater)3 1039(ments in the allocator are)4 1121 2 590 5468 t
( by caching frequently used)4 1207(gains can be achieved)3 953 2 590 5588 t
( that their basic structure is preserved)6 1725(objects so)1 435 2 590 5708 t
(between uses.)1 562 1 590 5828 t
( begins with a discussion of object)6 1491(The paper)1 419 2 840 5990 t
(caching, since the interface that this requires will)7 2160 1 590 6110 t
( next section)2 567( The)1 244( the allocator.)2 608(shape the rest of)3 741 4 590 6230 t
( Section)1 367(then describes the implementation in detail.)5 1793 2 590 6350 t
( buffer address distribution)3 1136(4 describes the effect of)4 1024 2 590 6470 t
( utilization and bus)3 857(on the system's overall cache)4 1303 2 590 6590 t
(balance, and shows how a simple coloring scheme)7 2160 1 590 6710 t
( the)1 221( 5 compares)2 632( Section)1 433(can improve both.)2 874 4 590 6830 t
( to several other well-known)4 1198(allocator's performance)1 962 2 590 6950 t
( that it is)3 519(kernel memory allocators and \256nds)4 1641 2 590 7070 t
(generally superior in both space)4 1339 1 3110 2424 t
10 I f
(and)4491 2424 w
10 R f
(time. Finally,)1 587 1 4683 2424 t
( debugging)1 516(Section 6 describes the allocator's)4 1644 2 3110 2544 t
( of prob-)2 397(features, which can detect a wide variety)6 1763 2 3110 2664 t
(lems throughout the system.)3 1152 1 3110 2784 t
11 B f
( Caching)1 428(2. Object)1 471 2 3110 3084 t
10 R f
(Object caching is a technique for dealing with)7 2160 1 3110 3246 t
( The)1 227( frequently allocated and freed.)4 1299(objects that are)2 634 3 3110 3366 t
( an)1 166(idea is to preserve the invariant portion of)7 1994 2 3110 3486 t
(object's initial state \320 its)4 1204 1 3110 3606 t
10 I f
(constructed)4383 3606 w
10 R f
(state \320)1 352 1 4918 3606 t
( have to be destroyed)4 940(between uses, so it does not)5 1220 2 3110 3726 t
( For)1 227(and recreated every time the object is used.)7 1933 2 3110 3846 t
( only needs)2 503(example, an object containing a mutex)5 1657 2 3110 3966 t
(to have)1 307 1 3110 4086 t
10 CW f
(mutex_init\(\))3485 4086 w
10 R f
(applied once \320 the \256rst)4 1024 1 4246 4086 t
( object can then be)4 796( The)1 224(time the object is allocated.)4 1140 3 3110 4206 t
(freed and reallocated many times without incurring)6 2160 1 3110 4326 t
( of)1 224(the expense)1 583 2 3110 4446 t
10 CW f
(mutex_destroy\(\))4085 4446 w
10 R f
(and)5126 4446 w
10 CW f
(mutex_init\(\))3110 4566 w
10 R f
( embedded)1 444( object's)1 351( An)1 190(each time.)1 420 4 3865 4566 t
( counts, lists of)3 663(locks, condition variables, reference)3 1497 2 3110 4686 t
( qual-)1 244(other objects, and read-only data all generally)6 1916 2 3110 4806 t
(ify as constructed state.)3 961 1 3110 4926 t
( the cost of con-)4 695(Caching is important because)3 1215 2 3360 5088 t
( be signi\256cantly higher than)4 1196(structing an object can)3 964 2 3110 5208 t
( example,)1 405( For)1 214( of allocating memory for it.)5 1217(the cost)1 324 4 3110 5328 t
( SunOS 5.4 develop-)3 857(on a SPARCstation-2 running a)4 1303 2 3110 5448 t
( the allocator presented here reduced)5 1629(ment kernel,)1 531 2 3110 5568 t
( freeing a stream head)4 1016(the cost of allocating and)4 1144 2 3110 5688 t
( the)1 162( As)1 183(from 33 microseconds to 5.7 microseconds.)5 1815 3 3110 5808 t
( savings was due)3 713(table below illustrates, most of the)5 1447 2 3110 5928 t
(to object caching:)2 726 1 3110 6048 t
10 S f
(_ ___________________________________________)1 2160 1 3110 6110 t
10 R f
(Stream Head Allocation + Free Costs \()6 1602 1 3280 6230 t
10 S f
(m)4882 6230 w
10 R f
(sec\))4940 6230 w
10 S f
(_ ___________________________________________)1 2160 1 3110 6240 t
(_ ___________________________________________)1 2160 1 3110 6260 t
10 R f
( other)1 360(construction memory)1 1058 2 3784 6370 t
( init.)1 307( allocation)1 575( destruction)1 477(allocator +)1 586 4 3234 6490 t
10 S f
(_ ___________________________________________)1 2160 1 3110 6510 t
10 R f
( 1.9)1 425( 9.4)1 619(old 23.6)1 773 3 3345 6630 t
( 1.9)1 425( 3.8)1 619(new 0.0)1 792 3 3326 6750 t
10 S f
( \347)1 -2160(_ ___________________________________________)1 2160 2 3110 6770 t
(\347)3110 6710 w
(\347)3110 6610 w
(\347)3110 6510 w
(\347)3110 6410 w
(\347)3110 6310 w

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?