History log of /freebsd-head/sys/geom/raid/md_ddf.c
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
8581c5bfb9de3f11e1f9daa843cae6dc5b1a8eae 17-Jun-2019 delphij <delphij@FreeBSD.org> Separate kernel crc32() implementation to its own header (gsb_crc32.h) and
rename the source to gsb_crc32.c.

This is a prerequisite of unifying kernel zlib instances.

PR: 229763
Submitted by: Yoshihiro Ota <ota at j.email.ne.jp>
Differential Revision: https://reviews.freebsd.org/D20193
2e026938033ce5a0a5c7d8f69c54220fbcf6d4bd 05-Apr-2018 sbruno <sbruno@FreeBSD.org> Squash error from geom by sizing ident strings to DISK_IDENT_SIZE.

Display attribute in future error strings and differentiate g_handleattr()
error messages for ease of debugging in the future.

"g_handleattr: md1 bio_length 24 strlen 31 -> EFAULT"

Reported by: swills
Reviewed by: imp cem avg
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D14962
c8da6fae2c8073f216b7a35739f7dfa140c9a8d9 25-Dec-2017 kan <kan@FreeBSD.org> Do pass removing some write-only variables from the kernel.

This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385
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.
71cd794fea9c05c313ae6b50d8b13dbdd80d288a 12-Jan-2017 cem <cem@FreeBSD.org> g_raid: Prevent tasters from attempting excessively large reads

Some g_raid tasters attempt metadata reads in multiples of the provider
sectorsize. Reads larger than MAXPHYS are invalid, so detect and abort
in such situations.

Spiritually similar to r217305 / PR 147851.

PR: 214721
Sponsored by: Dell EMC Isilon
30f99dbeefc844112679b1d34c674426abfb24c8 08-Nov-2016 bdrewery <bdrewery@FreeBSD.org> Fix improper use of "its".

Sponsored by: Dell EMC Isilon
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
bd88c5334ca14635998cac65b7083ed3c1065c71 12-May-2016 pfg <pfg@FreeBSD.org> MFC r298755:
sys/geom: spelling fixes.

These affect debugging messages.
586d106e191628e927b30d43c75a8684094fe6e6 28-Apr-2016 pfg <pfg@FreeBSD.org> sys/geom: spelling fixes.

These affect debugging messages.

MFC after: 2 weeks
fc01419148d065603607b1008d536431465f3bc3 26-Apr-2016 pfg <pfg@FreeBSD.org> sys: extend use of the howmany() macro when available.

We have a howmany() macro in the <sys/param.h> header that is
convenient to re-use as it makes things easier to read.
df9f601cbcdbfe062c43e38da3dd1a4351c46fdf 08-May-2014 mav <mav@FreeBSD.org> MFC r265054:
Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code. Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

Sponsored by: iXsystems, Inc.
b384f8775fb9dac291a6c48827c9f7c4bd2bc455 28-Apr-2014 mav <mav@FreeBSD.org> Reduce number of opens by REOM RAID during provider taste.

Instead opening/closing provider by each of metadata classes, do it only
once in core code. Since for SCSI disks open/close means sending some
SCSI commands to the device, this change reduces taste time.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.
c2e3819ca878695957fd074a79b0f1341f57860b 24-Apr-2014 mav <mav@FreeBSD.org> MFC r264318:
Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.

This caused incorrect behavior of arrays with big-endian DDF metadata.
Little-endian (like used by Adaptec controllers) should not be harmed.
Add workaround should be enough to manage compatibility.
bc9e83bd99832f56ccff013498c1ef4f5ddaec20 10-Apr-2014 mav <mav@FreeBSD.org> Fix wrong sizes used to access PD_Type and PD_State DDF metadata fields.

This caused incorrect behavior of arrays with big-endian DDF metadata.
Little-endian (like used by Adaptec controllers) should not be harmed.
Add workaround should be enough to manage compatibility.

MFC after: 2 weeks
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
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
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
da1d4b7e77246f92792d33f8b31ed07cf2a475fb 20-May-2013 mav <mav@FreeBSD.org> Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit.
In some cases it could cause kernel panic during failed drive replacement.

Reported by: trasz
MFC after: 1 week
a1b987fb96fceedb0c447645ff9785d5cbd8cd1a 07-Mar-2013 mav <mav@FreeBSD.org> Fix panic when Secondary_Element_Count == 1 and Secondary_Element_Seq
is not set (255).

Reported by: sbruno
MFC after: 1 week
a43d540d9efdfd22157e434662f6be55d1437f32 29-Oct-2012 mav <mav@FreeBSD.org> Add basic BIO_DELETE support to GEOM RAID class for all RAID levels.

If at least one subdisk in the volume supports it, BIO_DELETE requests
will be propagated down. Unfortunatelly, for RAID levels with redundancy
unmapped blocks will be mapped back during first rebuild/resync process.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
bfb53c205cc5070309c8d61379cb48a0522ecade 07-Oct-2012 mav <mav@FreeBSD.org> Make graid command line a bit more friendly by allowing volume name or
provider name to be specified instead of geom name (first argument in all
subcommands except label). In most cases there is only one array used
any way, so it is not really useful to make user type ugly geom names like
Intel-f0bdf223 or SiI-732c2b9448cf. Though they can be used in some cases.

Sponsored by: iXsystems, Inc.
MFC after: 1 month
db9e01aca9af40e4b56657bc713041a28462e06b 13-Sep-2012 mav <mav@FreeBSD.org> Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.

MFC after: 3 days
64e3d8819be3cb969d4d2ac00804ddd38ae320cf 06-May-2012 mav <mav@FreeBSD.org> Remove some hardcoded constants from code.
6710f450f7a9e9efe9980ca61ce3d87b66627ea4 06-May-2012 mav <mav@FreeBSD.org> Plug small memory leaks.
3d44dd0fea21a2108201e4e627a1ebb119cebdd4 06-May-2012 mav <mav@FreeBSD.org> Add support for RAID5R. Slightly improve support for RAIDMDF.
3f57d6ecd5469f6795c7306903247ca8bba1a12d 04-May-2012 mav <mav@FreeBSD.org> Fix bug causing memory corruption and panics with big-endian metadata.
6a0688c8fd793f12e94493c122206163820eeff4 03-May-2012 mav <mav@FreeBSD.org> Add optional -o argument to the `graid label ` to specify some metadata
format options. Use it for specifying byte order for the DDF metadata:
big-endian defined by specification and little-endian used by Adaptec.
ecf215ed8d6ad3a4ddceabaa8e5c02c4774d1320 01-May-2012 mav <mav@FreeBSD.org> Improve spare disks support. Unluckily, for some reason Adaptec 1430SA
RAID BIOS doesn't want to understand spare disks created by graid. But
at least spares created by BIOS are working fine now.
08b90a5b47616790b430cf96b814ac353d03ab53 01-May-2012 mav <mav@FreeBSD.org> Implement volume deletion if disk has more then one partition.
3a7fb06834aafafa8754109ea3659317424a3bb2 01-May-2012 mav <mav@FreeBSD.org> Improve DDF metadata writing.
dbcc3abc523ff7cb6a79aff875fce65fdb715261 30-Apr-2012 mav <mav@FreeBSD.org> Add to GEOM RAID class module, supporting the DDF metadata format, as
defined by the SNIA Common RAID Disk Data Format Specification v2.0.

Supports multiple volumes per array and multiple partitions per disk.
Supports standard big-endian and Adaptec's little-endian byte ordering.
Supports all single-layer RAID levels. Dual-layer RAID levels except
RAID10 are not supported now because of GEOM RAID design limitations.

Some work is still to be done, but the present code already manages basic
interoperation with RAID BIOS of the Adaptec 1430SA SATA RAID controller.

MFC after: 1 month
Sponsored by: iXsystems, Inc.