1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/sys/dev/ata
Alexander Motin 227d67aa54 Merge CAM locking changes from the projects/camlock branch to radically
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
2013-10-21 12:00:26 +00:00
..
chipsets Add missing NULL check after malloc(M_NOWAIT). 2013-07-25 09:12:46 +00:00
ata_if.m Remove all legacy ATA code parts, not used since options ATA_CAM enabled in 2013-04-04 07:12:24 +00:00
ata-all.c Merge CAM locking changes from the projects/camlock branch to radically 2013-10-21 12:00:26 +00:00
ata-all.h - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related 2013-04-06 19:12:49 +00:00
ata-card.c Allow the legacy CDROM device to be accessed in a FreeBSD guest, while 2013-10-10 22:46:49 +00:00
ata-cbus.c - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related 2013-04-06 19:12:49 +00:00
ata-dma.c Remove all legacy ATA code parts, not used since options ATA_CAM enabled in 2013-04-04 07:12:24 +00:00
ata-isa.c - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related 2013-04-06 19:12:49 +00:00
ata-lowlevel.c Fix several typos 2013-05-12 16:43:26 +00:00
ata-pci.c Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI 2013-08-12 23:30:01 +00:00
ata-pci.h Add new Coleto Creek device support: SATA, SMBus, and Watchdog devices. 2013-07-19 21:37:40 +00:00
ata-sata.c - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) related 2013-04-06 19:12:49 +00:00