Deleted Added
full compact
notes (110592) notes (110710)
1$FreeBSD: head/sys/geom/notes 110592 2003-02-09 17:04:57Z phk $
1$FreeBSD: head/sys/geom/notes 110710 2003-02-11 14:57:34Z phk $
2
3For the lack of a better place to put them, this file will contain
4notes on some of the more intricate details of geom.
5
6-----------------------------------------------------------------------
7Locking of bio_children and bio_inbed
8
9bio_children is used by g_std_done() and g_clone_bio() to keep track

--- 71 unchanged lines hidden (view full) ---

81"wentbusy" timestamp concurrently.
82
83The statistics data is made available to userland through the use
84of a special allocator (in geom_stats.c) which through a device
85allows userland to mmap(2) the pages containing the statistics data.
86In order to indicate to userland when the data in a statstics
87structure might be inconsistent, g_io_deliver() atomically sets a
88flag "updating" and resets it when the structure is again consistent.
2
3For the lack of a better place to put them, this file will contain
4notes on some of the more intricate details of geom.
5
6-----------------------------------------------------------------------
7Locking of bio_children and bio_inbed
8
9bio_children is used by g_std_done() and g_clone_bio() to keep track

--- 71 unchanged lines hidden (view full) ---

81"wentbusy" timestamp concurrently.
82
83The statistics data is made available to userland through the use
84of a special allocator (in geom_stats.c) which through a device
85allows userland to mmap(2) the pages containing the statistics data.
86In order to indicate to userland when the data in a statstics
87structure might be inconsistent, g_io_deliver() atomically sets a
88flag "updating" and resets it when the structure is again consistent.
89-----------------------------------------------------------------------
90maxsize, stripesize and stripeoffset
91
92maxsize is the biggest request we are willing to handle. If not
93set there is no upper bound on the size of a request and the code
94is responsible for chopping it up. Only hardware methods should
95set an upper bound in this field. Geom_disk will inherit the upper
96bound set by the device driver.
97
98stripesize is the width of any natural request boundaries for the
99device. This would be the width of a stripe on a raid-5 unit or
100one zone in GBDE. The idea with this field is to hint to clustering
101type code to not trivially overrun these boundaries.
102
103stripeoffset is the amount of the first stripe which lies before the
104devices beginning.
105
106If we have a device with 64k stripes:
107 [0...64k[
108 [64k...128k[
109 [128k..192k[
110Then it will have stripesize = 64k and stripeoffset = 0.
111
112If we put a MBR on this device, where slice#1 starts on sector#63,
113then this slice will have: stripesize = 64k, stripeoffset = 63 * sectorsize.
114
115If the clustering code wants to widen a request which writes to
116sector#53 of the slice, it can calculate how many bytes till the end of
117the stripe as:
118 stripewith - (53 * sectorsize + stripeoffset) % stripewidth.