summaryrefslogtreecommitdiffstats
path: root/sys/cam/ata
Commit message (Collapse)AuthorAgeFilesLines
* sys: extend use of the howmany() macro when available.pfg2016-04-261-7/+4
| | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read.
* sys: use our nitems() macro when param.h is available.pfg2016-04-211-1/+1
| | | | | | This should cover all the remaining cases in the kernel. Discussed in: freebsd-current
* Remove slightly used const values that can be replaced with nitems().pfg2016-04-211-5/+2
| | | | Suggested by: jhb
* Implement Auxiliary register. Add PIM_ATA_EXT flag to flag that a SIMimp2016-04-172-3/+3
| | | | | | | | | can handle it, and add the code to add it to the FIS that's sent to the drive. The mvs driver is the only other ATA driver in the system, and its hardware doesn't appear to support setting the Auxiliary register. Differential Revision: https://reviews.freebsd.org/D5598
* tag_action is not used at all in ata. It's set to 1 for orderedimp2016-04-171-1/+1
| | | | | | | | | | | | | transactions, but that value isn't used. It's bogusly used to report in devstat, due to a cut and paste error from SCSI. Mark it as unused in cam_fill_ataio. Reclaim the memory as a new ata_flags. In addition, tag_id and init_id are completely unused, so reclaim those as 'unused' now too. These were needlessly copied when ata was split from scsi. This allows us, in the future, to create structures that can communicate AUXILIARY regsiter to the SIMs, which cannot be done now. Differential Revision: https://reviews.freebsd.org/D5598
* Dell has an OEM drive from Samsung that has issues. NCQ Trim isn'timp2016-04-171-0/+9
| | | | | | broken on this drive, but it doesn't support it and the fallback logic is failing. Quirk it until those issues can be resolved in a more generic way.
* Expand CAM_IO_STATS #ifdef to logical unit.imp2016-04-151-4/+2
|
* Out of an abundance of caution treatimp2016-04-151-3/+11
| | | | | | | | | | | | * Samsung 843T Series SSDs (MZ7WD*) * Samsung PM851 Series SSDs (MZ7TE*) * Samsung PM853T Series SSDs (MZ7GE*) as known having broken NCQ TRIM support as they appear to be based on the same controller technology as the 840 and 850 series. I've had at least one report of the PM853 being broken, so err on the side of caution for the above drives. The PM863/SM863 appears to be based on a newer controller, so give it the benefit of the doubt.
* Add FCCT M500 to the NCQ black list. Linux added it in 4.2 (Augustimp2016-04-151-5/+13
| | | | | | | | | | | | | | | 2015). Correct the M500 firmware versions. EU07 was the engineering test version, not the release version with the fix. MU07 is the release version. It's the only Micron firmware version to actually work. Remove support for EU07. This brings the blacklist into parity with the Linux blacklist as of 4.5, except for the Micron M500 MU07 entry. I personally tested the MU07 firmware on 12 machines running 6 drives each with no corruption in the past 6 months with Netflix production loads. Prior versions of the M500 firmware wouldn't last more than a few days. Sponsored by: Netflix, Inc.
* Fix typos (intenral -> internal) in commentsngie2016-04-151-1/+1
|
* Add a comment about why the timeout for flush was lowered to 5s.imp2016-04-141-0/+5
|
* New CAM I/O scheduler for FreeBSD. The default I/O scheduler is the sameimp2016-04-142-85/+367
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | as before. The common scheduling bits have moved from inline code in each of the CAM periph drivers into a library that implements the default scheduling. In addition, a number of rate-limiting and I/O preference options can be enabled by adding CAM_IOSCHED_NETFLIX to your config file. A number of extra stats are also maintained. CAM_IOSCHED_NETFLIX isn't on by default because it uses a separate BIO_READ and BIO_WRITE queue, so doesn't honor BIO_ORDERED between these two types of operations. We already didn't honor it for BIO_DELETE, and we don't depend on BIO_ORDERED between reads and writes anywhere in the system (it is currently used with BIO_FLUSH in ZFS to make sure some writes are complete before others start and as a poor-man's soft dependency in one place in UFS where we won't be issuing READs until after the operation completes). However, out of an abundance of caution, it isn't enabled by default. Plus, this also brings in NCQ TRIM support for those SSDs that support it. A black list is also provided for known rogues that use NCQ trim as an excuse to corrupt the drive. It was difficult to separate out into a separate commit. This code has run in production at Netflix for over a year now. Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D4609
* Add sbuf variants ata_cmd_sbuf() and ata_res_sbuf(), and reimplement thescottl2016-04-132-24/+45
| | | | | | | | | | _string variants on top of this. This requires a change to the function signature of ata_res_sbuf(). Its use in the tree seems to be very limited, and the change makes it more consistent with the rest of the API. Reviewed by: imp, mav, kenm Sponsored by: Netflix Differential Revision: D5940
* CAM: Generalize 4k quirk to all Samsung MZ7* SSDsdumbbell2016-03-291-18/+5
| | | | | | | | | | | | This adds Samsung PM851 to the list. It can be found in Lenovo Thinkpad T440 for instance. Reviewed by: Kevin Bowling <kevin.bowling@kev009.com>, Jason Wolfe <j@nitrology.com> Approved by: Kevin Bowling <kevin.bowling@kev009.com>, Jason Wolfe <j@nitrology.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5753
* Add 4k enabled cam quirks for Samsung SM863 Series SSDssbruno2016-03-241-0/+8
| | | | | | | Submitted by: Jason (j@nitrology.com) MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D5711
* Add defines for WRITE_UNCORRECTABLE ATA command, and improve command loggingrpokala2016-02-041-17/+43
| | | | | | | | | | | | Add #defines for ATA_WRITE_UNCORRECTABLE48 and its features. Update the decoding in ATACAM to recognize the new values. Also improve command decoding for a few other commands (SMART, NOP, SET_FEATURES). Bring the decoding in ata(4) up to parity with ATACAM. Reviewed by: mav, imp MFC after: 1 month Sponsored by: Panasas, Inc. Differential Revision: https://reviews.freebsd.org/D5181
* Add asynchronous command support to the pass(4) driver, and the newken2015-12-031-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | camdd(8) utility. CCBs may be queued to the driver via the new CAMIOQUEUE ioctl, and completed CCBs may be retrieved via the CAMIOGET ioctl. User processes can use poll(2) or kevent(2) to get notification when I/O has completed. While the existing CAMIOCOMMAND blocking ioctl interface only supports user virtual data pointers in a CCB (generally only one per CCB), the new CAMIOQUEUE ioctl supports user virtual and physical address pointers, as well as user virtual and physical scatter/gather lists. This allows user applications to have more flexibility in their data handling operations. Kernel memory for data transferred via the queued interface is allocated from the zone allocator in MAXPHYS sized chunks, and user data is copied in and out. This is likely faster than the vmapbuf()/vunmapbuf() method used by the CAMIOCOMMAND ioctl in configurations with many processors (there are more TLB shootdowns caused by the mapping/unmapping operation) but may not be as fast as running with unmapped I/O. The new memory handling model for user requests also allows applications to send CCBs with request sizes that are larger than MAXPHYS. The pass(4) driver now limits queued requests to the I/O size listed by the SIM driver in the maxio field in the Path Inquiry (XPT_PATH_INQ) CCB. There are some things things would be good to add: 1. Come up with a way to do unmapped I/O on multiple buffers. Currently the unmapped I/O interface operates on a struct bio, which includes only one address and length. It would be nice to be able to send an unmapped scatter/gather list down to busdma. This would allow eliminating the copy we currently do for data. 2. Add an ioctl to list currently outstanding CCBs in the various queues. 3. Add an ioctl to cancel a request, or use the XPT_ABORT CCB to do that. 4. Test physical address support. Virtual pointers and scatter gather lists have been tested, but I have not yet tested physical addresses or scatter/gather lists. 5. Investigate multiple queue support. At the moment there is one queue of commands per pass(4) device. If multiple processes open the device, they will submit I/O into the same queue and get events for the same completions. This is probably the right model for most applications, but it is something that could be changed later on. Also, add a new utility, camdd(8) that uses the asynchronous pass(4) driver interface. This utility is intended to be a basic data transfer/copy utility, a simple benchmark utility, and an example of how to use the asynchronous pass(4) interface. It can copy data to and from pass(4) devices using any target queue depth, starting offset and blocksize for the input and ouptut devices. It currently only supports SCSI devices, but could be easily extended to support ATA devices. It can also copy data to and from regular files, block devices, tape devices, pipes, stdin, and stdout. It does not support queueing multiple commands to any of those targets, since it uses the standard read(2)/write(2)/writev(2)/readv(2) system calls. The I/O is done by two threads, one for the reader and one for the writer. The reader thread sends completed read requests to the writer thread in strictly sequential order, even if they complete out of order. That could be modified later on for random I/O patterns or slightly out of order I/O. camdd(8) uses kqueue(2)/kevent(2) to get I/O completion events from the pass(4) driver and also to send request notifications internally. For pass(4) devcies, camdd(8) uses a single buffer (CAM_DATA_VADDR) per CAM CCB on the reading side, and a scatter/gather list (CAM_DATA_SG) on the writing side. In addition to testing both interfaces, this makes any potential reblocking of I/O easier. No data is copied between the reader and the writer, but rather the reader's buffers are split into multiple I/O requests or combined into a single I/O request depending on the input and output blocksize. For the file I/O path, camdd(8) also uses a single buffer (read(2), write(2), pread(2) or pwrite(2)) on reads, and a scatter/gather list (readv(2), writev(2), preadv(2), pwritev(2)) on writes. Things that would be nice to do for camdd(8) eventually: 1. Add support for I/O pattern generation. Patterns like all zeros, all ones, LBA-based patterns, random patterns, etc. Right Now you can always use /dev/zero, /dev/random, etc. 2. Add support for a "sink" mode, so we do only reads with no writes. Right now, you can use /dev/null. 3. Add support for automatic queue depth probing, so that we can figure out the right queue depth on the input and output side for maximum throughput. At the moment it defaults to 6. 4. Add support for SATA device passthrough I/O. 5. Add support for random LBAs and/or lengths on the input and output sides. 6. Track average per-I/O latency and busy time. The busy time and latency could also feed in to the automatic queue depth determination. sys/cam/scsi/scsi_pass.h: Define two new ioctls, CAMIOQUEUE and CAMIOGET, that queue and fetch asynchronous CAM CCBs respectively. Although these ioctls do not have a declared argument, they both take a union ccb pointer. If we declare a size here, the ioctl code in sys/kern/sys_generic.c will malloc and free a buffer for either the CCB or the CCB pointer (depending on how it is declared). Since we have to keep a copy of the CCB (which is fairly large) anyway, having the ioctl malloc and free a CCB for each call is wasteful. sys/cam/scsi/scsi_pass.c: Add asynchronous CCB support. Add two new ioctls, CAMIOQUEUE and CAMIOGET. CAMIOQUEUE adds a CCB to the incoming queue. The CCB is executed immediately (and moved to the active queue) if it is an immediate CCB, but otherwise it will be executed in passstart() when a CCB is available from the transport layer. When CCBs are completed (because they are immediate or passdone() if they are queued), they are put on the done queue. If we get the final close on the device before all pending I/O is complete, all active I/O is moved to the abandoned queue and we increment the peripheral reference count so that the peripheral driver instance doesn't go away before all pending I/O is done. The new passcreatezone() function is called on the first call to the CAMIOQUEUE ioctl on a given device to allocate the UMA zones for I/O requests and S/G list buffers. This may be good to move off to a taskqueue at some point. The new passmemsetup() function allocates memory and scatter/gather lists to hold the user's data, and copies in any data that needs to be written. For virtual pointers (CAM_DATA_VADDR), the kernel buffer is malloced from the new pass(4) driver malloc bucket. For virtual scatter/gather lists (CAM_DATA_SG), buffers are allocated from a new per-pass(9) UMA zone in MAXPHYS-sized chunks. Physical pointers are passed in unchanged. We have support for up to 16 scatter/gather segments (for the user and kernel S/G lists) in the default struct pass_io_req, so requests with longer S/G lists require an extra kernel malloc. The new passcopysglist() function copies a user scatter/gather list to a kernel scatter/gather list. The number of elements in each list may be different, but (obviously) the amount of data stored has to be identical. The new passmemdone() function copies data out for the CAM_DATA_VADDR and CAM_DATA_SG cases. The new passiocleanup() function restores data pointers in user CCBs and frees memory. Add new functions to support kqueue(2)/kevent(2): passreadfilt() tells kevent whether or not the done queue is empty. passkqfilter() adds a knote to our list. passreadfiltdetach() removes a knote from our list. Add a new function, passpoll(), for poll(2)/select(2) to use. Add devstat(9) support for the queued CCB path. sys/cam/ata/ata_da.c: Add support for the BIO_VLIST bio type. sys/cam/cam_ccb.h: Add a new enumeration for the xflags field in the CCB header. (This doesn't change the CCB header, just adds an enumeration to use.) sys/cam/cam_xpt.c: Add a new function, xpt_setup_ccb_flags(), that allows specifying CCB flags. sys/cam/cam_xpt.h: Add a prototype for xpt_setup_ccb_flags(). sys/cam/scsi/scsi_da.c: Add support for BIO_VLIST. sys/dev/md/md.c: Add BIO_VLIST support to md(4). sys/geom/geom_disk.c: Add BIO_VLIST support to the GEOM disk class. Re-factor the I/O size limiting code in g_disk_start() a bit. sys/kern/subr_bus_dma.c: Change _bus_dmamap_load_vlist() to take a starting offset and length. Add a new function, _bus_dmamap_load_pages(), that will load a list of physical pages starting at an offset. Update _bus_dmamap_load_bio() to allow loading BIO_VLIST bios. Allow unmapped I/O to start at an offset. sys/kern/subr_uio.c: Add two new functions, physcopyin_vlist() and physcopyout_vlist(). sys/pc98/include/bus.h: Guard kernel-only parts of the pc98 machine/bus.h header with #ifdef _KERNEL. This allows userland programs to include <machine/bus.h> to get the definition of bus_addr_t and bus_size_t. sys/sys/bio.h: Add a new bio flag, BIO_VLIST. sys/sys/uio.h: Add prototypes for physcopyin_vlist() and physcopyout_vlist(). share/man/man4/pass.4: Document the CAMIOQUEUE and CAMIOGET ioctls. usr.sbin/Makefile: Add camdd. usr.sbin/camdd/Makefile: Add a makefile for camdd(8). usr.sbin/camdd/camdd.8: Man page for camdd(8). usr.sbin/camdd/camdd.c: The new camdd(8) utility. Sponsored by: Spectra Logic MFC after: 1 week
* Removed unused malloc types.mav2015-11-062-4/+0
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week
* Remove legacy CHS geometry from dmesg and unify capacity outputs.mav2015-10-111-6/+3
|
* Remove compatibility shims for legacy ATA device names.mav2015-10-111-24/+2
| | | | | We got new ATA stack in FreeBSD 8.x, switched to it at 9.x, completely removed old stack at 10.x, so at 11.x it is time to remove compat shims.
* Attach pass driver to LUNs is OFFLINE state.mav2015-08-291-1/+2
| | | | | | | Previously such LUNs were silently ignored. But while they indeed unable to process most of SCSI commands, some, like RTPG, they still can. MFC after: 1 month
* Remove some code duplication by using biofinish().mav2015-08-221-6/+2
| | | | | Submitted by: imp MFC after: 1 week
* Don't panic if disk lost TRIM support due to switching to PIO mode.mav2015-08-081-5/+8
| | | | MFC after: 1 week
* Add some additional quirks for various Western Digital Caviar MHDDseadler2015-03-301-1/+16
| | | | | | Submitted by: Jeremy Chadwick PR: 188685 MFC After: 1 month
* Improve ATA and SCSI versions printing.mav2015-03-171-12/+22
| | | | | | There is no "SCSI-6" and "ATA-9", but there is "SPC-4" and "ACS-2". MFC after: 2 weeks
* Explain a bit of tricky code dealing with trims and how it preventsimp2015-01-131-0/+10
| | | | | starvation. These side effects aren't obvious without extremely careful study, and are important to do just so.
* Fix CF ERASE breakage caused by 268205.smh2014-10-261-0/+6
| | | | | | | | | | | This prevents BIO_DELETE requests getting stuck in the TRIM queue which results in a panic on shutdown due to outstanding requests. PR: 194606 Reported by: Guido Falsi Reviewed by: mav MFC after: 3 days Sponsored by: Multiplay
* Add new quirks for the latest Samsung SSD, model 850.gnn2014-10-191-0/+8
| | | | | Submitted by: sbruno MFC after: 2 weeks
* Add 4k quirks for PM853T Samsung SSDsbruno2014-10-161-0/+8
| | | | | MFC after: 2 weeks Sponsored by: Limelight Networks
* Follow up to r225617. In order to maximize the re-usability of kernel codedavide2014-10-161-1/+1
| | | | | | | | in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe
* Add a few defines and packet types for SATA 3.2 and FPDMA (First Partyimp2014-08-301-0/+3
| | | | | | DMA). Sponsored by: Netflix
* We should never enter the PROBE_SETAN phase if we're not ATAPI, sinceimp2014-08-221-10/+5
| | | | | | | that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for non ATAPI protocols. The prior code incorrectly terminated the probe with a break, rather than arranging for probedone to get called. This caused panics or worse on some systems.
* Add the Samsung 843T as a 4k enabled drivesbruno2014-08-211-0/+8
| | | | | | Submitted by: Jason Wolfe <jason@llnw.com> MFC after: 2 weeks Sponsored by: Limelight Networks
* Turns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return dataimp2014-08-201-10/+8
| | | | | | | | | | | | | | that's only mostly similar. Specifically word 78 bits are defined for IDENTIFY DEVICE as 5 Supports Hardware Feature Control while a IDENTIFY PACKET DEVICE defines them as 5 Asynchronous notification supported Therefore, only pay attention to bit 5 when we're talking to ATAPI devices (we don't use the hardware feature control at this time). Ignore it for ATA devices. Remove kludge that papered over this issue for Samsung SATA SSDs, since Micron drives also have the bit set and the error was caused by this bad interpretation of the spec (which is quite easy to do, since bits aren't normally overlapping like this).
* Added 4K quirks for Corsair Force GT and Samsung 840 SSDssmh2014-08-141-2/+10
| | | | | MFC after: 1 week Sponsored by: Multiplay
* Rework the BIO_DELETE code slightly. Always queue the BIO_DELETEimp2014-07-031-90/+103
| | | | | | | | | | requests on the trim_queue, even for the CFA ERASE. This allows us, in the future, to collapse adjacent requests. Since CFA ERASE is only for CF cards, and it is so restrictive in what it can do, the collapse code is not presently here. This also brings the ada driver more in line with the da driver's treatment of BIO_DELETEs. Reviewed by: mav@
* Pull in r267961 and r267973 again. Fix for issues reported will follow.hselasky2014-06-282-22/+11
|
* Revert r267961, r267973:gjb2014-06-272-11/+22
| | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifhselasky2014-06-272-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies
* The code that combines adjacent ranges for BIO_DELETEs to optimizeimp2014-06-051-4/+1
| | | | | | | | | | trims to the device assumes the list is sorted. Don't apply the optimization of not sorting the queue when we have SSDs to the delete_queue, since it causes more discard traffic to the drive. While one could argue that the higher levels should coalesce the trims, that's not done today, so some optimization at this level is needed. CR: https://phabric.freebsd.org/D142
* Fix support for increased logical sector size (4K-native drives).mav2014-03-071-7/+10
| | | | | | | | | | - Logical sector size is measured in words, not bytes. - If physical sector is not bigger then logical sector, it does not mean it should be set equal to 512 bytes, but set to logical sector. PR: misc/187269 Submitted by: Ravi Pokala <rpokala@panasas.com> MFC after: 1 week
* Some microoptimizations for da and ada drivers:mav2013-10-241-14/+10
| | | | | | - Replace ordered_tag_count counter with single flag; - From da remove outstanding_cmds counter, duplicating pending_ccbs list; - From da_softc remove unused links field.
* Improve ZFS N-way mirror read performance by using load and localitysmh2013-10-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | information. The existing algorithm selects a preferred leaf vdev based on offset of the zio request modulo the number of members in the mirror. It assumes the devices are of equal performance and that spreading the requests randomly over both drives will be sufficient to saturate them. In practice this results in the leaf vdevs being under utilized. The new algorithm takes into the following additional factors: * Load of the vdevs (number outstanding I/O requests) * The locality of last queued I/O vs the new I/O request. Within the locality calculation additional knowledge about the underlying vdev is considered such as; is the device backing the vdev a rotating media device. This results in performance increases across the board as well as significant increases for predominantly streaming loads and for configurations which don't have evenly performing devices. The following are results from a setup with 3 Way Mirror with 2 x HD's and 1 x SSD from a basic test running multiple parrallel dd's. With pre-fetch disabled (vfs.zfs.prefetch_disable=1): == Stripe Balanced (default) == Read 15360MB using bs: 1048576, readers: 3, took 161 seconds @ 95 MB/s == Load Balanced (zfslinux) == Read 15360MB using bs: 1048576, readers: 3, took 297 seconds @ 51 MB/s == Load Balanced (locality freebsd) == Read 15360MB using bs: 1048576, readers: 3, took 54 seconds @ 284 MB/s With pre-fetch enabled (vfs.zfs.prefetch_disable=0): == Stripe Balanced (default) == Read 15360MB using bs: 1048576, readers: 3, took 91 seconds @ 168 MB/s == Load Balanced (zfslinux) == Read 15360MB using bs: 1048576, readers: 3, took 108 seconds @ 142 MB/s == Load Balanced (locality freebsd) == Read 15360MB using bs: 1048576, readers: 3, took 48 seconds @ 320 MB/s In addition to the performance changes the code was also restructured, with the help of Justin Gibbs, to provide a more logical flow which also ensures vdevs loads are only calculated from the set of valid candidates. The following additional sysctls where added to allow the administrator to tune the behaviour of the load algorithm: * vfs.zfs.vdev.mirror.rotating_inc * vfs.zfs.vdev.mirror.rotating_seek_inc * vfs.zfs.vdev.mirror.rotating_seek_offset * vfs.zfs.vdev.mirror.non_rotating_inc * vfs.zfs.vdev.mirror.non_rotating_seek_inc These changes where based on work started by the zfsonlinux developers: https://github.com/zfsonlinux/zfs/pull/1487 Reviewed by: gibbs, mav, will MFC after: 2 weeks Sponsored by: Multiplay
* Merge GEOM direct dispatch changes from the projects/camlock branch.mav2013-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge CAM locking changes from the projects/camlock branch to radicallymav2013-10-213-110/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reduce lock congestion and improve SMP scalability of the SCSI/ATA stack, preparing the ground for the coming next GEOM direct dispatch support. Replace big per-SIM locks with bunch of smaller ones: - per-LUN locks to protect device and peripheral drivers state; - per-target locks to protect list of LUNs on target; - per-bus locks to protect reference counting; - per-send queue locks to protect queue of CCBs to be sent; - per-done queue locks to protect queue of completed CCBs; - remaining per-SIM locks now protect only HBA driver internals. While holding LUN lock it is allowed (while not recommended for performance reasons) to take SIM lock. The opposite acquisition order is forbidden. All the other locks are leaf locks, that can be taken anywhere, but should not be cascaded. Many functions, such as: xpt_action(), xpt_done(), xpt_async(), xpt_create_path(), etc. are no longer require (but allow) SIM lock to be held. To keep compatibility and solve cases where SIM lock can't be dropped, all xpt_async() calls in addition to xpt_done() calls are queued to completion threads for async processing in clean environment without SIM lock held. Instead of single CAM SWI thread, used for commands completion processing before, use multiple (depending on number of CPUs) threads. Load balanced between them using "hash" of the device B:T:L address. HBA drivers that can drop SIM lock during completion processing and have sufficient number of completion threads to efficiently scale to multiple CPUs can use new function xpt_done_direct() to avoid extra context switch. Make ahci(4) driver to use this mechanism depending on hardware setup. Sponsored by: iXsystems, Inc. MFC after: 2 months
* MFprojects/camlock:mav2013-10-211-16/+14
| | | | Remove hard limit on number of BIOs handled with one ATA TRIM request.
* Unify periph invalidation and destruction reporting.mav2013-10-154-4/+26
| | | | | | | Print message containing device model and serial number on invalidation. Requested by: glebius MFC after: 1 week
* Added 4K quirks for Corsair Neutron GTX SSD'ssmh2013-10-151-0/+8
|
* Added 4K quirks for:-smh2013-08-141-0/+24
| | | | | | * OCZ Agility 2 SSDs * Marvell SSDs * Intel X25-M Series SSDs
* Fix returning incorrect bio_resid value with failed BIO_DELETE requests.mav2013-07-281-21/+23
| | | | | Neither residual length reported for ATA/SCSI command nor one from another BIO_DELETE request are in any way related to the value to be returned.
OpenPOWER on IntegriCloud