History log of /freebsd-head/sys/geom/mirror/g_mirror.h
Revision Date Author Comments
10d53fcce8d03533ba3ded8380337cc79b974fad 07-Aug-2019 cem <cem@FreeBSD.org> GEOM: Reduce unnecessary log interleaving with sbufs

Similar to what was done for device_printfs in r347229.

Convert g_print_bio() to a thin shim around g_format_bio(), which acts on an
sbuf; documented in g_bio.9.

Reviewed by: markj
Discussed with: rlibby
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D21165
66fb4c422a8f58946fbe66d3047e23865d3978b5 23-Jan-2019 cem <cem@FreeBSD.org> gmirror: Relocate DEVICE_FLAGS to adjacent lines

gmirror's sc_flags is shared between some on-disk state and some runtime
only state. There's no real reason for that and they could probably be
split up. Until they are, locate all of the flags for the same field
nearby each other in the source, for clarity.

No functional change.

Sponsored by: Dell EMC Isilon
42d84ef531f1a4c40f63f803d89d4813b8241b8f 07-Dec-2018 cem <cem@FreeBSD.org> gmirror: Evaluate mirror components against newest metadata copy

Re-apply r341665 with format strings fixed.

If we happen to taste a stale mirror component first, don't reject valid,
newer components that have differing metadata from the stale component
(during STARTING). Instead, update our view of the most recent metadata as
we taste components.

Like mediasize beforehand, remove some checks from g_mirror_check_metadata
which would evict valid components due to metadata that can change over a
mirror's lifetime. g_mirror_check_metadata is invoked long before we check
genid/syncid and decide which component(s) are newest and whether or not we
have quorum.

Before checking if we can enter RUNNING (i.e., we have quorum) after a NEW
component is added, first remove any known stale or inconsistent disks from
the mirrorset, rather than removing them *after* deciding we have quorum.
Check if we have quorum after removing these components.

Additionally, add a knob, kern.geom.mirror.launch_mirror_before_timeout, to
force gmirrors to wait out the full timeout (kern.geom.mirror.timeout)
before transitioning from STARTING to RUNNING. This is a kludge to help
ensure all eligible, boot-time available mirror components are tasted before
RUNNING a gmirror.

Add a basic test case for STARTING -> RUNNING startup behavior around stale
genids.

PR: 232671, 232835
Submitted by: Cindy Yang <cyang AT isilon.com> (previous version)
Reviewed by: markj (kernel portions)
Discussed with: asomers, Cindy Yang
Tested by: pho
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18062
a6f65b400837be27223e51700d9615c669800603 07-Dec-2018 cem <cem@FreeBSD.org> Revert r341665 due to tinderbox breakage

I didn't notice that some format strings were non-portable. Will fix and
re-commit later.
0b3fcef4703c621364758a11011df64bfd64e4df 06-Dec-2018 cem <cem@FreeBSD.org> gmirror: Evaluate mirror components against newest metadata copy

If we happen to taste a stale mirror component first, don't reject valid,
newer components that have differing metadata from the stale component
(during STARTING). Instead, update our view of the most recent metadata as
we taste components.

Like mediasize beforehand, remove some checks from g_mirror_check_metadata
which would evict valid components due to metadata that can change over a
mirror's lifetime. g_mirror_check_metadata is invoked long before we check
genid/syncid and decide which component(s) are newest and whether or not we
have quorum.

Before checking if we can enter RUNNING (i.e., we have quorum) after a NEW
component is added, first remove any known stale or inconsistent disks from
the mirrorset, rather than removing them *after* deciding we have quorum.
Check if we have quorum after removing these components.

Additionally, add a knob, kern.geom.mirror.launch_mirror_before_timeout, to
force gmirrors to wait out the full timeout (kern.geom.mirror.timeout)
before transitioning from STARTING to RUNNING. This is a kludge to help
ensure all eligible, boot-time available mirror components are tasted before
RUNNING a gmirror.

When we are instructed to forget mirror components, bump the generation id
to avoid confusion with such stale components later.

Add a basic test case for STARTING -> RUNNING startup behavior around stale
genids.

PR: 232671, 232835
Submitted by: Cindy Yang <cyang AT isilon.com> (previous version)
Reviewed by: markj (kernel portions)
Discussed with: asomers, Cindy Yang
Tested by: pho
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D18062
a2d6c6c5ac4b55878b60bcde4d0f98f1db58889b 10-Jan-2018 markj <markj@FreeBSD.org> Clarify the use of the gmirror flag mask constants.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
6afde2097a58ce04d6c256af03c0e4d402169131 19-Dec-2017 markj <markj@FreeBSD.org> Avoid using bioq_* in gmirror.

gmirror does not perform any sorting of I/O requests, so the bioq API
doesn't provide any advantages over plain TAILQs. The API also does not
provide operations needed by an upcoming change.

No functional change intended. The diff shrinks the geom_mirror.ko
text and the gmirror softc slightly.

Tested by: pho (part of a larger patch)
MFC after: 1 week
Sponsored by: Dell EMC Isilon
66ff112aaebbb8bc4f0b573ddcd87558c374c4ec 30-Nov-2017 markj <markj@FreeBSD.org> Update gmirror metadata less frequently when synchronizing.

We periodically record synchronization progress in the metadata
block of the disk being synchronized; this allows an interrupted
synchronization to be resumed. However, the frequency of these
updates heavily pessimized synchronization time on some media. This
change modifies gmirror to update metadata based on a time period,
and adds a sysctl to control that period. The default value results
in a much lower update frequency and increases the completion time
for an interrupted rebuild only marginally.

Reported by: Andre Albsmeier <andre@fbsd.e4m.org>
MFC after: 3 weeks
a82e3a8b2430553d1a48209e110921023d727e45 27-Nov-2017 pfg <pfg@FreeBSD.org> sys/geom: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
091ce9badd00b9c0d6dd6aa52bc594fffa06bc67 24-Nov-2017 hselasky <hselasky@FreeBSD.org> Merge ^/head r326132 through r326161.
36a1a140047ebe060ef6fe718aa27a25971ca008 23-Nov-2017 markj <markj@FreeBSD.org> Allow kern.geom.mirror.debug to be negative.

A negative value can be used to suppress all prints from the gmirror
kernel code, which can be useful when attempting to trigger race
conditions using stress tests.

MFC after: 1 week
78c53bec48d6a0e27d11e4961ec3362a0cd0060c 15-Sep-2017 avg <avg@FreeBSD.org> gmirror: treat ENXIO as disk disconnect, not media error

In theory, all data access errors mean that a member is out of sync
at most. But they were treated as more serious errors to avoid the
situation where a flaky disk gets repeatedly disconnected, re-synchronized,
reconnected and then disconnected again.

ENXIO is a special error that means that the member disk disappeared,
so it should get the same handling as the GEOM orphaning event.
There is a better chance that when the disk is reconnected, it will be
a good member again.

When ENXIO happens on a read we use the exisiting G_MIRROR_BUMP_SYNCID
mechanism which means that the mirror's syncid is increased as soon
as there is a write to the mirror. That's because no data has got out
of sync yet, but the problematic memeber is disconnected, so the future
write will make it stale.

When ENXIO happens on a write we use a new G_MIRROR_BUMP_SYNCID_NOW
mechanism which means that we update the mirror metadata as soon as
possible because the problematic memeber is already behind.

Reviewed by: markj, imp
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D9463
cf195e3f5253b893114cced756d69c9921eac01b 14-Apr-2017 markj <markj@FreeBSD.org> Rename two gmirror state flags to make their meanings slightly clearer.

No functional change.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
7acb1dbb484ae945101af627c6d29e0e6edf1418 30-Nov-2016 mav <mav@FreeBSD.org> Add `gmirror create` subcommand, alike to gstripe, gconcat, etc.

It is quite specific mode of operation without storing on-disk metadata.
It can be useful in some cases in combination with some external control
tools handling mirror creation and disks hot-plug.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
e6c44edd72d5b78ec6dd62b680bcb9023a0a2437 13-Nov-2016 mav <mav@FreeBSD.org> Use providergone method to cover race between destroy and g_access().

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
d1e2d58d18dd2693b876c898ce2e3f80105f6055 06-Oct-2016 mav <mav@FreeBSD.org> Fix possible geom destruction before final provider close.

Introduce internal counter to track opens. Using provider's counters is
not very successfull after calling g_wither_provider().

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
2865f87f4a69c49f910445fb5c56eca59e1790ee 10-Jan-2014 ae <ae@FreeBSD.org> MFC r259634:
Prevent users from deactivating the last component of a mirror.

MFC r259929:
Add an ability to stop gmirror and clear its metadata in one command.
This fixes the problem, when gmirror starts again just after stop.

The problem occurs when gmirror's component has geom label with equal size.
E.g. gpt and gptid have the same size as partition, diskid has the same
size as entire disk. When gmirror's geom has been destroyed, glabel
creates its providers and this initiate retaste.

Now "gmirror destroy" command is available. It destroys geom and also
erases gmirror's metadata.

PR: 184985
0a34594b9cd7c8b87f719ed058da6be2b756a8e5 07-Jan-2014 scottl <scottl@FreeBSD.org> MFC Alexander Motin's GEOM direct dispatch work:

r256603:
Introduce new function devstat_end_transaction_bio_bt(), adding new argument
to specify present time. Use this function to move binuptime() out of lock,
substantially reducing lock congestion when slow timecounter is used.

r256606:
Move g_io_deliver() out of the lock, as required for direct dispatch.
Move g_destroy_bio() out too to reduce lock scope even more.

r256607:
Fix passing uninitialized bio_resid argument to g_trace().

r256610:
Add unmapped I/O support to GEOM RAID.

r256830:
Restore BIO_UNMAPPED and BIO_TRANSIENT_MAPPING in biodonne() when unmapping
temporary mapped buffer. That fixes double unmap if biodone() called twice
for the same BIO (but with different done methods).

r256880:
Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

r259247:
Fix bug introduced at r256607. We have to recalculate bp_resid here since
sizes of original and completed requests may differ due to end of media.

Testing of the stable/10 merge was done by Netflix, but all of the credit
goes to Alexander and iX Systems.

Submitted by: mav
Sponsored by: iX Systems
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
150bba5c8f906223683765d44132307c7d8a618e 27-Dec-2013 ae <ae@FreeBSD.org> Add an ability to stop gmirror and clear its metadata in one command.
This fixes the problem, when gmirror starts again just after stop.

The problem occurs when gmirror's component has geom label with equal size.
E.g. gpt and gptid have the same size as partition, diskid has the same
size as entire disk. When gmirror's geom has been destroyed, glabel
creates its providers and this initiate retaste.

Now "gmirror destroy" command is available. It destroys geom and also
erases gmirror's metadata.

MFC after: 2 weeks
4219fc00741f40993b2047c0524fe87ad9bce077 22-Oct-2013 mav <mav@FreeBSD.org> Merge GEOM direct dispatch changes from the projects/camlock branch.

When safety requirements are met, it allows to avoid passing I/O requests
to GEOM g_up/g_down thread, executing them directly in the caller context.
That allows to avoid CPU bottlenecks in g_up/g_down threads, plus avoid
several context switches per I/O.

The defined now safety requirements are:
- caller should not hold any locks and should be reenterable;
- callee should not depend on GEOM dual-threaded concurency semantics;
- on the way down, if request is unmapped while callee doesn't support it,
the context should be sleepable;
- kernel thread stack usage should be below 50%.

To keep compatibility with GEOM classes not meeting above requirements
new provider and consumer flags added:
- G_CF_DIRECT_SEND -- consumer code meets caller requirements (request);
- G_CF_DIRECT_RECEIVE -- consumer code meets callee requirements (done);
- G_PF_DIRECT_SEND -- provider code meets caller requirements (done);
- G_PF_DIRECT_RECEIVE -- provider code meets callee requirements (request).
Capable GEOM class can set them, allowing direct dispatch in cases where
it is safe. If any of requirements are not met, request is queued to
g_up or g_down thread same as before.

Such GEOM classes were reviewed and updated to support direct dispatch:
CONCAT, DEV, DISK, GATE, MD, MIRROR, MULTIPATH, NOP, PART, RAID, STRIPE,
VFS, ZERO, ZFS::VDEV, ZFS::ZVOL, all classes based on g_slice KPI (LABEL,
MAP, FLASHMAP, etc).

To declare direct completion capability disk(9) KPI got new flag equivalent
to G_PF_DIRECT_SEND -- DISKFLAG_DIRECT_COMPLETION. da(4) and ada(4) disk
drivers got it set now thanks to earlier CAM locking work.

This change more then twice increases peak block storage performance on
systems with manu CPUs, together with earlier CAM locking changes reaching
more then 1 million IOPS (512 byte raw reads from 16 SATA SSDs on 4 HBAs to
256 user-level threads).

Sponsored by: iXsystems, Inc.
MFC after: 2 months
1a62bb322429c1e61662250887fdaf2659cfa436 01-Jul-2012 glebius <glebius@FreeBSD.org> Make geom_mirror more friendly to SSDs. To properly support TRIM,
we need to pass BIO_DELETE requests down to providers that support
it. Also, we need to announce our support for BIO_DELETE to upper
consumer. This requires:

- In g_mirror_start() return true for "GEOM::candelete" request.
- In g_mirror_init_disk() probe below provider for "GEOM::candelete"
attribute, and mark disk with a flag if it does support BIO_DELETE.
- In g_mirror_register_request() distribute BIO_DELETE requests only
to those disks, that do support it.

Note that we announce "GEOM::candelete" as true unconditionally of
whether we have TRIM-capable media down below or not. This is made
intentionally, because upper consumer (usually UFS) requests the
attribite only once at mount time. And if user ever migrates his
mirror from HDDs to SSDs, then he/she would get TRIM working without
remounting filesystem.

Reviewed by: pjd
a243137af2073d22d4fc581771aeb8a5330031fc 18-May-2012 ae <ae@FreeBSD.org> Introduce new device flag G_MIRROR_DEVICE_FLAG_TASTING. It should
protect geom from destroying while it is tasting.

PR: kern/154860
Reviewed by: pjd
MFC after: 1 week
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
f6390dafb64995a6b415076d99a8dca685470221 08-Dec-2009 mav <mav@FreeBSD.org> MFC r200086:
Change 'load' balancing mode algorithm:
- Instead of measuring last request execution time for each drive and
choosing one with smallest time, use averaged number of requests, running
on each drive. This information is more accurate and timely. It allows to
distribute load between drives in more even and predictable way.
- For each drive track offset of the last submitted request. If new request
offset matches previous one or close for some drive, prefer that drive.
It allows to significantly speedup simultaneous sequential reads.

PR: kern/113885
f018f4f59913004a6a8893cc03a2133129724f49 03-Dec-2009 mav <mav@FreeBSD.org> Change 'load' balancing mode algorithm:
- Instead of measuring last request execution time for each drive and
choosing one with smallest time, use averaged number of requests, running
on each drive. This information is more accurate and timely. It allows to
distribute load between drives in more even and predictable way.
- For each drive track offset of the last submitted request. If new request
offset matches previous one or close for some drive, prefer that drive.
It allows to significantly speedup simultaneous sequential reads.

PR: kern/113885
Reviewed by: sobomax
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
b34fb80d8364fbc4f1737da5f2916fe5b39a9325 01-Nov-2006 pjd <pjd@FreeBSD.org> Now, that we have gjournal in the tree add possibility to configure
gmirror and graid3 in a way that it is not resynchronized after a
power failure or system crash.
It is safe when gjournal is running on top of gmirror/graid3.
54f2c508d7ae5d855df7df3a7a40137befda797b 10-May-2006 pjd <pjd@FreeBSD.org> MFC: sys/geom/mirror/g_mirror.c 1.81,1.82,1.83
sys/geom/mirror/g_mirror.h 1.23
sys/geom/mirror/g_mirror_ctl.c 1.16

Sync gmirror with HEAD:

- Introduce and use delayed-destruction functionality from a pre-sync hook,
which means that devices will be destroyed on last close.
This fixes destruction order problems when, eg. RAID3 array is build on
top of RAID1 arrays.

Requested, reviewed and tested by: ru

- Be sure to not destroy device twice. This is only possible in theory, but
with this change there is even no theoretical race.

- Remove dead code.
- Comment possible event miss, which isn't critical, but probably can be
fixed by replacing the event lock usage with the queue lock.
d7eb5b2fe93038a4783beb3079adb93fae2c27b0 10-Apr-2006 pjd <pjd@FreeBSD.org> Introduce and use delayed-destruction functionality from a pre-sync hook,
which means that devices will be destroyed on last close.

This fixes destruction order problems when, eg. RAID3 array is build on
top of RAID1 arrays.

Requested, reviewed and tested by: ru
MFC after: 2 weeks
c2dead3970eaa1e5e3276e47dd032b8fd858eff1 20-Mar-2006 pjd <pjd@FreeBSD.org> MFC: gmirror(8)

Synchronize gmirror(8) with HEAD:
- Speed up synchronization process by using configurable number of parallel
I/O requests.
- Allow for kernel dumps to the mirror.
- Reimplement gmirror softc synchronization by using per-device sx(9) lock.
- Stop synchronization from pre-sync hook.
- Fix possible race between synchronization and regular requests.

Approved by: re (mux)
ba3414666e9f4f2db29d9b1815464fd05124a41f 19-Mar-2006 pjd <pjd@FreeBSD.org> Update copyright for 2006.
11cbb2f2752487f0605f14afcc37e520331c8dbc 13-Mar-2006 pjd <pjd@FreeBSD.org> - Speed up synchronization process by using configurable number of I/O
requests in parallel.
+ Add kern.geom.mirror.sync_requests tunable which defines how many parallel
I/O requests should be used.
+ Retire kern.geom.mirror.reqs_per_sync and kern.geom.mirror.syncs_per_sec
sysctls.
- Fix race between regular and synchronization requests.
- Reimplement mirror's data synchronization - do not use the topology lock
for this purpose, as it may case deadlocks.
- Stop synchronization from pre-sync hook.
- Fix some other minor issues.

MFC after: 3 days
392d25e4bc345d6563f9272d1132f57731ee2f15 11-Feb-2006 pjd <pjd@FreeBSD.org> - Add kern.geom.mirror.disconnect_on_failure sysctl/tunnable (default to 1
to preserve currect behaviour). When set to 0, components are not
disconnected - gmirror will try to still use them (only first error will
be logged). This is helpful when we have two broken components, but in
different places, so actually all data is available.
Such buggy component will be visible in 'gmirror list' output with flag
BROKEN.
- Never disconnect the last valid component. If we detect errors there we
will just pass them up. This wasn't reasonable to deny access to the
whole provider because of one broken sector.

Prodded by: ru
MFC after: 3 days
ef806177416ab33073961f577f0a9366966d3f28 11-Feb-2006 pjd <pjd@FreeBSD.org> Mark array as CLEAN when there are no write requests in
kern.geom.mirror.idletime seconds. Write, not any requests.
Mark array as clean immediatelly on last write close.

Prodded by: ru
MFC after: 3 days
6f074b6d64c73a3076d8f1b86873b81770b1016c 01-Feb-2006 pjd <pjd@FreeBSD.org> Remove trailing spaces.
15eddd96beb523e19af1df49c87f07d8ad4dfe95 19-Apr-2005 pjd <pjd@FreeBSD.org> Remove the hack which allowed to use gmirror for root file system,
use root_mount KPI instead.
668a0286708d7bde5d5f9e9076fa8ffe8ec62f34 27-Feb-2005 pjd <pjd@FreeBSD.org> - Add md_provsize field to metadata, which will help with
shared-last-sector problem.
After this change, even if there is more than one provider with the same
last sector, the proper one will be chosen based on its size.
It still doesn't fix the 'c' partition problem (when da0s1 can be confused
with da0s1c) and situation when 'a' partition starts at offset 0
(then da0s1a can be confused with da0s1 and da0s1c). One can use '-h'
option there, when creating device or avoid sharing last sector.
Actually, when providers share the same last sector and their size is equal,
they provide exactly the same data, so the name (da0s1, da0s1a, da0s1c)
isn't important at all.
- Provide backward compatibility.
- Update copyright's year.

MFC after: 1 week
c05fe5379b604d8900003675c7d6cebb81064296 16-Feb-2005 pjd <pjd@FreeBSD.org> Update copyright in files changed this year.
c1f23c6a62860ae177fdb27b66a767a67eba3980 04-Jan-2005 pjd <pjd@FreeBSD.org> Spoiling is now not possible, because we keep consumers open for writing
all the time. Remove unused code then.

MFC after: 4 days
fcf90f45ebd008ab6a30e3f155595c978d691939 03-Jan-2005 pjd <pjd@FreeBSD.org> Fix 'rebuild' command (we ignore retaste event now, so don't relay on it).
b58db25ebeed85a1cc3d68bda134815500157aaa 22-Dec-2004 pjd <pjd@FreeBSD.org> - Add genid field to the metadata which will allow to improve reliability a bit.
After this change, when component is disconnected because of an I/O error,
it will not be connected and synchronized automatically, it will be logged
as broken and skipped. Autosynchronization can occur, when component is
disconnected (on orphan event) and connected again - there were no I/O
error, so there is no need to not connected the component, but when there were
writes while it wasn't connected, it will be synchronized.
This fix cases, when component is disconnected because of I/O error and can be
connected again and again.
- Bump version number.
- Add version change history.
- Implement backward compatibility mechanism. After this change when metadata in
old version is detected, it is automatically upgraded to the new (current)
version.
d0890a743f87d1d7deac22426dce80d425c91527 05-Nov-2004 pjd <pjd@FreeBSD.org> MFp4:
- Fix for good (I hope) force-stopping mirrors and some filure cases
(e.g. the last good component dies when synchronization is in progress).
Don't use ->nstart/->nend consumer's fields, as this could be racy,
because those fields are used in g_down/g_up, use ->index consumer's
field instead for tracking number of not finished requests.

Reported by: marcel

- After 5 seconds of idle time (this should be configurable) mark all
dirty providers as clean, so when mirror is not used in 5 seconds
and there will be power failure, no synchronization on boot is needed.

Idea from: sorry, I can't find who suggested this

- When there are no ACTIVE components and no NEW components destroy whole
mirror, not only provider.

- Fix one debug to show information about I/O request, before we change
its command.
63dd0f756be07fcbaa764dfb7930f49f32d41de7 28-Sep-2004 pjd <pjd@FreeBSD.org> Just use MAXPHYS as maximum I/O request size, instead of using my own
#define for this purpose.
No functional change.
9b6a1c588aad1bc07aa35da71fc8c312e432fa7c 26-Sep-2004 pjd <pjd@FreeBSD.org> Forgot to commit addition of ds_resync field.
d1919d79384771e5d693429d7e432a60250c947c 11-Aug-2004 pjd <pjd@FreeBSD.org> MFp4: Simplify code a bit:
- Remove kern.geom.mirror.sync_block_size sysctl. It is quite obvious that we
want to use the biggest size possible.
- Do not use UMA zone for sync data allocations. There could be only one
synchronization request per synchronized disk at a time, so allocate memory
for one request on whole synchronization process related to one disk.

Tested by synchronizing one component (out of three) and by synchronizing
two components (out of three) in parallel.
2f865036c5149ecc203cfbfc643f9239291bfd55 11-Aug-2004 pjd <pjd@FreeBSD.org> Actually, HARDCODED flag isn't stored in metadata, so don't bother
dumping it.
e5e381074884d9db68bbcef1488e683b612faed0 11-Aug-2004 pjd <pjd@FreeBSD.org> - Fix typo.
- Dump HARDCODED flag.
a98f2557009185f782b7d19053597e414ef9fb3a 09-Aug-2004 pjd <pjd@FreeBSD.org> - Introduce option for hardcoding providers' names into metadata.
It allows to fix problems when last provider's sector is shared between few
providers.
- Bump version number for CONCAT and STRIPE and add code for backward
compatibility.
- Do not bump version number of MIRROR, as it wasn't officially introduced yet.
Even if someone started to play with it, there is no big deal, because
wrong MD5 sum of metadata will deny those providers.
- Update manual pages.
- Add version history to g_(stripe|concat).h files.
0b32901632214fa88085bdbeb1c2e94bb3fa2d07 04-Aug-2004 pjd <pjd@FreeBSD.org> - Add two fields to bio structure: 'bio_cflags' which can be used by
consumer and 'bio_pflags' which can be used by provider.
- Remove BIO_FLAG1 and BIO_FLAG2 flags. From now on new fields should be
used for internal flags.
- Update g_bio(9) manual page.
- Update some comments.
- Update GEOM_MIRROR, which was the only one using BIO_FLAGs.

Idea from: phk
Reviewed by: phk
c111951680cf2a7e0f1c54bb95aec29bab5f1cb6 04-Aug-2004 pjd <pjd@FreeBSD.org> - Add "prefer" balance algorithm. When used, only disk with the biggest
priority will be used for reading.
- Bump version number.
e9aabe3b500c70831e6e013f19daa12b6b7e26cf 31-Jul-2004 pjd <pjd@FreeBSD.org> Remove unused field.
adaa0482b446a8db32a6bb1f2986d1a743c769dd 30-Jul-2004 pjd <pjd@FreeBSD.org> Add GEOM_MIRROR class which provide RAID1 functionality and has many useful
features. The gmirror(8) utility should be used for control of this class.
There is no manual page yet, but I'm working on it with keramida@.

Many useful tests provided by: simon (thank you!)
Some ideas from: scottl, simon, phk