History log of /freebsd-head/sys/geom/raid3/g_raid3.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
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.
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
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
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.
08db162dbda317ea202dd3fdd1e9fb3d37c731c6 29-Dec-2009 mav <mav@FreeBSD.org> MFC r200821:
Make graid3 fallback to malloc() when component request size is bigger
then maximal prepared UMA zone size. This fixes crash with MAXPHYS > 128K.
3edd147826811d68c173891011e586667f465361 21-Dec-2009 mav <mav@FreeBSD.org> Make graid3 fallback to malloc() when component request size is bigger
then maximal prepared UMA zone size. This fixes crash with MAXPHYS > 128K.
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.
94bc1342b1d5ad3d583b7df77f4e1cef2403fa67 10-May-2006 pjd <pjd@FreeBSD.org> MFC: sys/geom/raid3/g_raid3.c 1.60,1.62,1.63,1.66
sys/geom/raid3/g_raid3.h 1.18
sys/geom/raid3/g_raid3_ctl.c 1.16

Sync graid3 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.

- Use G_RAID3_FOREACH_SAFE_BIO() macro instead of G_RAID3_FOREACH_BIO() in
two places where g_io_request() is called. g_io_request() can free bio
structure so we can't reference it after and G_RAID3_FOREACH_BIO() macro
was doing this.

Found by: Coverity Prevent analysis tool (with my new models)
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
a56f32107157bed828162f50bde199be25b12c62 20-Mar-2006 pjd <pjd@FreeBSD.org> MFC: graid3(8)

Synchronize graid3(8) with HEAD:
- Speed up synchronization process by using configurable number of parallel
I/O requests.
- Reimplement graid3 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.
349adc9b525fdf960528de1a0ae2e4150e9c529b 13-Mar-2006 pjd <pjd@FreeBSD.org> - Reimplement I/O data allocation to prevent deadlocks.

Submitted by: green

- Speed up synchronization process by using configurable number of I/O
requests in parallel.
+ Add kern.geom.raid3.sync_requests tunable which defines how many parallel
I/O requests should be used.
+ Retire kern.geom.raid3.reqs_per_sync and kern.geom.raid3.syncs_per_sec
sysctls.
- Fix race between regular and synchronization requests.
- Reimplement raid3'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.

Tested by: Mike Tancsa <mike@sentex.net>
MFC after: 3 days
beaa5fcb4dc63683c0f73e0326cddc7838be2776 11-Feb-2006 pjd <pjd@FreeBSD.org> - Add kern.geom.raid3.disconnect_on_failure sysctl/tunnable (default to 1
to preserve currect behaviour). When set to 0, components are not
disconnected - graid3 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 'graid3 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
26f9aeb047de2274a8a3e54cbd27ae8e642b7db2 11-Feb-2006 pjd <pjd@FreeBSD.org> Mark array as CLEAN when there are no write requests in
kern.geom.raid3.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.
5312e7b17e33bed7c129db352dc8d898e7826903 05-Aug-2005 pjd <pjd@FreeBSD.org> MFC: g_raid3.c 1.41
g_raid3.h 1.12

Use root_mount KPI for RAID3 to delay root file system mount.
Actually, one cannot setup root file system on RAID3 device, but when
other file system exist in /etc/fstab which are placed on RAID3 device,
boot process will be interrupted when these devices are missing.

Approved by: re (kensmith)
eb467446d554f35934e398955fb9792fd5df2f34 27-Jul-2005 pjd <pjd@FreeBSD.org> Use root_mount KPI for RAID3 to delay root file system mount.
Actually, one cannot setup root file system on RAID3 device, but when
other file system exist in /etc/fstab which are placed on RAID3 device,
boot process will be interrupted when these devices are missing.

MFC after: 3 days
X-MFC-note: MFC only to RELENG_6, as RELENG_5 doesn't have root_mount KPI.
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.
589a9682ce2f41d12724fc0d82575eeac5f45938 04-Jan-2005 pjd <pjd@FreeBSD.org> - Fix 'rebuild' command - it can no longer relay on retaste event
(we ignore it).
- Remove code used for handling spoil events, as spoiling is not possible
anymore, because we keep consumers open for writing all the time.

MFC after: 4 days
0bb72c3b0079d6d298270e90f40b74b0836d4dc2 25-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.
- Implement backward compatibility mechanism. After this change when metadata in
old version is detected, it is automatically upgraded to the new (current)
version.
b004592010cec9accc33d6a1fb047e0abc18c1b5 05-Nov-2004 pjd <pjd@FreeBSD.org> - Mark all raid3 components as clean after kern.geom.raid3.idletime seconds.
- Make kern.geom.raid3.timeout variable tunable.
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.
34196975cf61be2d2e5af2931ec15659f5d0d8c2 27-Sep-2004 pjd <pjd@FreeBSD.org> Avoid race while synchronizing components. It is very hard to bump into,
but it is possible:
1. Read data from good component for synchronization.
2. Write data to the same area.
3. Write synchronization data, which are now stale.

Found by: tegge (for gmirror)
7e2ef21ad90efdeb778bd1faea580f1c1687ffe6 22-Aug-2004 pjd <pjd@FreeBSD.org> Implementation of 'verify reading' algorithm, which uses parity data for
verification of regular data when device is in complete state.
On verification error, EIO error is returned for the bio and sysctl
kern.geom.raid3.stat.parity_mismatch is increased.

Suggested by: phk
2acdd880f4604706669461ec3a52a73bb41dd081 21-Aug-2004 pjd <pjd@FreeBSD.org> Add version history.
c3c6740d1ae2ca36dd507650dbed6962cc1b206d 21-Aug-2004 pjd <pjd@FreeBSD.org> Implement new reading algorithm, which will use parity component for reading
as well, even if device is in complete state.
I observe 40% of speed-up with this option for random read operations,
but slowdown for sequential reads.
Basically, without this option reading from a RAID3 device built from 5
components (c0-c4) looks like this:

Request no. Used components
1 c0+c1+c2+c3
2 c0+c1+c2+c3
3 c0+c1+c2+c3

With the new feature:

Request no. Used components
1 c0+c1+c2+c3
2 (c1^c2^c3^c4)+c1+c2+c3
3 c0+(c0^c2^c3^c4)+c2+c3
4 c0+c1+(c0^c1^c3^c4)+c3
5 c0+c1+c2+(c0^c1^c2^c4)
6 c0+c1+c2+c3
[...]
8394d51046ccd71b29fd905b0a01fb62b743a0c6 16-Aug-2004 pjd <pjd@FreeBSD.org> Introduce GEOM RAID3 class, i.e. kernel module, which implements RAID3
transformation and graid3(8) userland utility, which can be used for
configuration. No manual page yet, sorry.

Hardware provided by: Daniel Seuffert