summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_queue.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r271588: Update CAM CCB accounting for the new status quo.mav2014-10-141-2/+0
| | | | | | | | | | devq_openings counter lost its meaning after allocation queues has gone. held counter is still meaningful, but problematic to update due to separate locking of CCB allocation and queuing. To fix that replace devq_openings counter with allocated counter. held is now calculated on request as difference between number of allocated, queued and active CCBs.
* MFC Alexander Motin's direct dispatch, multi-queue, and finer-grainedscottl2014-01-071-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | locking support for CAM r256826: Fix several target mode SIMs to not blindly clear ccb_h.flags field of ATIO CCBs. Not all CCB flags there belong to them. r256836: Remove hard limit on number of BIOs handled with one ATA TRIM request. r256843: 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. r256888: Unconditionally acquire periph reference on CCB allocation failure. r256895: Fix memory and references leak due to unfreed path. r256960: Move CAM_UNQUEUED_INDEX setting to the last moment and under the periph lock. This fixes race condition with cam_periph_ccbwait(), causing use-after-free. r256975: Minor (mostly cosmetical) addition to r256960. r257054: Some microoptimizations for da and ada drivers: - 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. r257482: Fix lock recursion, triggered by `smartctl -a /dev/adaX`. r257501: Make getenv_*() functions and respectively TUNABLE_*_FETCH() macros not allocate memory and so not require sleepable environment. getenv() has already used on-stack temporary storage, so just use it more rationally. getenv_string() receives buffer as argument, so don't need another one. r257914: Some CAM locks polishing: - Fix LOR and possible lock recursion when handling high-power commands. Introduce new lock to protect left power quota and list of frozen devices. - Correct locking around xpt periph creation. - Remove seems never used XPT_FLAG_OPEN xpt periph flag. Again, Netflix assisted with testing the merge, but all of the credit goes to Alexander and iX Systems. Submitted by: mav Sponsored by: iX Systems
* MFprojects/camlock r249505:mav2013-08-051-23/+8
| | | | | | | | | | | | | | | Change CCB queue resize logic to be able safely handle overallocations: - (re)allocate queue space in power of 2 chunks with 64 elements minimum and never shrink it; with only 4/8 bytes per element size is insignificant. - automatically reallocate the queue to double size if it is overflowed. - if queue reallocation failed, store extra CCBs in unsorted TAILQ, fetching them back as soon as some queue element is freed. To free space in CCB for TAILQ linking, change highpowerq from keeping high-power CCBs to keeping devices frozen due to high-power CCBs. This encloses all pieces of queue resize logic inside of cam_queue.[ch], removing some not obvious duties from xpt_release_ccb().
* MFprojects/camlock r248890, r248897, r248898, r248900, r248903, r248905,mav2013-04-141-17/+4
| | | | | | | | | | | | | | | | | | r248917, r248918, r248978, r249001, r249014, r249030: Remove multilevel freezing mechanism, implemented to handle specifics of the ATA/SATA error recovery, when post-reset recovery commands should be allocated when queues are already full of payload requests. Instead of removing frozen CCBs with specified range of priorities from the queue to provide free openings, use simple hack, allowing explicit CCBs over- allocation for requests with priority higher (numerically lower) then CAM_PRIORITY_OOB threshold. Simplify CCB allocation logic by removing SIM-level allocation queue. After that SIM-level queue manages only CCBs execution, while allocation logic is localized within each single device. Suggested by: gibbs
* Increase device CCB queue array size by CAM_RL_VALUES - 1 (4) elements.mav2012-10-111-2/+3
| | | | | | | | | | It is required to store extra recovery requests in case of bus resets. On ATA/SATA this fixes assertion panics on HEAD with INVARIANTS enabled or possible memory corruptions otherwise if timeout/reset happens when device CCB queue is already full. Reported by: gibbs@ MFC after: 1 week
* Change queue overflow checks from DIAGNOSTIC+panic() to KASSERT() to makemav2012-09-281-9/+7
| | | | | them enabled on HEAD by default. It is probably better to do single compare then hunt for unexpected memory corruption.
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-071-3/+3
| | | | This means that their use is restricted to a single C file.
* MFp4:mav2009-11-141-1/+0
| | | | Some more missed parts from previous commits.
* After thinking again, implement cam_ccbq_fini().mav2009-10-221-1/+8
| | | | This is effectively NULL change, but makes this API a bit more consistent.
* - Providing fine-grained malloc statistic by replacing M_DEVBUF withavatar2005-07-011-13/+18
| | | | | | | | | | | | | module-specific malloc types. These should help us to pinpoint the possible memory leakage in the future. - Implementing xpt_alloc_ccb_nowait() and replacing all malloc/free based CCB memory management with xpt_alloc_ccb[_nowait]/xpt_free_ccb. Hopefully this would be helpful if someday we move the CCB allocator to use UMA instead of malloc(). Encouraged by: jeffr, rwatson Reviewed by: gibbs, scottl Approved by: re (scottl)
* Start each of the license/copyright comments with /*-imp2005-01-051-1/+1
|
* Use __FBSDID().obrien2003-06-101-2/+4
|
* Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/schweikh2002-12-301-1/+1
| | | | Add FreeBSD Id tag where missing.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Fix a long standing bug in the camq teardown code.gibbs1999-08-161-3/+3
|
* cam_periph.c:gibbs1999-04-191-21/+36
| | | | | | | | | | | | | | | | | Move handling of CAM_AUTOSENSE_FAIL into block dealing with all other scsi status errors. cam_queue.c: cam_queue.h: Fix 'off by one' heap bug in a more efficient manner. Since heap algorithms like to deal with indexes started from 1, offset our heap array pointer at allocation time to make this so for a C environment. This makes the implementation of the algorithm a bit more efficient. cam_xpt.c: Use macros for accessing the head of the heap so that code is isolated from implementation details of the heap.
* Remove camq_regen(). We already perform modular comparisonsgibbs1999-04-071-44/+6
| | | | | | | for generation counts, so no further steps to deal with generation count wrap are required. Fix an off by one problem in the camq heap code.
* CAM Transport Layer (XPT).gibbs1998-09-151-0/+441
Submitted by: The CAM Team
OpenPOWER on IntegriCloud