summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 1. Move code for scanning pending I/O from aio_fsync to aio_aqueue,davidxu2006-03-241-77/+51
| | | | | it has less overhead. 2. Avoid scheduling task if maximum number of I/O threads is reached.
* Implement aio_fsync() syscall.davidxu2006-03-231-78/+244
|
* 1. Remove aio entry from lists earlier in aio_free_entry,davidxu2006-02-261-19/+17
| | | | | | | | | | | | | | | | | | so other threads can not see it if we unlock the proc lock (this can happen in knlist_delete). Don't do wakeup, it is not necessary. 2. Decrease kaio_buffer_count in biohelper rather than doing it in aio_bio_done_notify. 3. In aio_bio_done_notify, don't send notification if KAIO_RUNDOWN was set, because the process is already in single thread mode. 4. Use assignment to initialize aiothreadflags. 5. AIOCBLIST_RUNDOWN is not useful, axe the code using it. 6. use LIO_NOP instead of zero.
* If block size is zero, use normal file operations to do I/O,davidxu2006-02-221-0/+3
| | | | | | this eliminates a divided-by-zero fault. Recommended by: phk
* Just like dofilewrite(), call bwillwrite before fo_write.davidxu2006-01-271-0/+2
|
* return final error code in aio_return rather than a hardcoded 0.davidxu2006-01-271-1/+0
|
* in aio_aqueue, store same return code into job->_aiocb_private.error.davidxu2006-01-261-3/+5
| | | | in aio_return, unlock proc lock before suword.
* Add locking annotation and comments about socket, pipe, fifo problem.davidxu2006-01-241-125/+126
| | | | Temporarily fix a locking problem for socket I/O.
* Er, rescure a deleted comment line.davidxu2006-01-241-0/+1
|
* More cleanup for aio code:davidxu2006-01-241-11/+9
| | | | | | | | | 1) unregsiter kqueue filter for EVFILT_LIO. 2) free uma_zones. 3) call setsid directly to enter another session rather than implementing by itself. Submitted by: jhb
* Add bracket.davidxu2006-01-231-1/+1
|
* Verify all supported notification types.davidxu2006-01-231-3/+18
|
* 1) Merge _aio_aqueue and aio_aqueue, check quota in aio_aqueue,davidxu2006-01-231-45/+29
| | | | | so that lio_listio won't exceed the quota. 2) Remove lio_ref_count, it is no longer used.
* Fix a bogus panic.davidxu2006-01-221-1/+1
|
* Decrease kaio_active_count first, because user process may go awaydavidxu2006-01-221-2/+5
| | | | after we notified it.
* Make aio code MP safe.davidxu2006-01-221-843/+574
|
* Initialize ki to p->p_aioinfo after we know it's going to be referencingcsjp2006-01-151-2/+2
| | | | | | | a valid kaioinfo structure. This avoids a potential NULL pointer dereference. Found with: Coverity Prevent(tm) MFC after: 2 weeks
* Return error from fget_write() rather than hardcoding EBADF now thatjhb2006-01-061-1/+1
| | | | | | fget_write() DTRT. Requested by: bde
* In aio_waitcomplete, do not return EAGAIN if no other threadsdavidxu2005-11-081-1/+1
| | | | | | | | | | | have started aio, instead, initialize aio management structure if it hasn't been done, the reason to adjust this behavior is to make it a bit friendly for threaded program, consider two threads, one submits aio_write, and another just calls aio_waitcomplete to wait any I/O to be completed and recycle the aio requests, before submitter doing any I/O, the recycler wants to wait in kernel. This also fixes inconsistency with other aio syscalls.
* Various and sundry cleanups:jhb2005-11-081-80/+84
| | | | | | | | | | | - Use curthread for calls to knlist_delete() and add a big comment explaining why as well as appropriate assertions. - Use TAILQ_FOREACH and TAILQ_FOREACH_SAFE instead of handrolling them. - Use fget() family of functions to lookup file objects instead of grovelling around in file descriptor tables. - Destroy the aio_freeproc mutex if we are unloaded. Tested on: i386
* Fix name compatible problem with POSIX standard. the sigval_ptr anddavidxu2005-11-041-2/+2
| | | | | | sigval_int really should be sival_ptr and sival_int. Also sigev_notify_function accepts a union sigval value but not a pointer.
* Support sending realtime signal information via signal queue, realtimedavidxu2005-11-031-8/+40
| | | | signal memory is pre-allocated, so kernel can always notify user code.
* Push down Giant into fdfree() and remove it from two of the callers.jhb2005-11-011-2/+0
| | | | | | | Other callers such as some rfork() cases weren't locking Giant anyway. Reviewed by: csjp MFC after: 1 week
* Fix sigevent's POSIX incompatible problem by adding member fieldsdavidxu2005-10-301-9/+63
| | | | | | | sigev_notify_function and sigev_notify_attributes. AIO syscalls use sigevent, so they have to be adjusted. Reviewed by: alc
* Fix tinderbox box by removing incomplete/bad spl usage. Proper giant freeambrisko2005-10-121-6/+0
| | | | | | locking is required in for aio. Pointed out by: imp
* Add in kqueue support to LIO event notification and fix how it handledambrisko2005-10-121-121/+198
| | | | | | | | | | | | | | | | | | notifications when LIO operations completed. These were the problems with LIO event complete notification: - Move all LIO/AIO event notification into one general function so we don't have bugs in different data paths. This unification got rid of several notification bugs one of which if kqueue was used a SIGILL could get sent to the process. - Change the LIO event accounting to count all AIO request that could have been split across the fast path and daemon mode. The prior accounting only kept track of AIO op's in that mode and not the entire list of operations. This could cause a bogus LIO event complete notification to occur when all of the fast path AIO op's completed and not the AIO op's that ended up queued for the daemon. Suggestions from: alc
* Eliminate inconsistency in the setting of the B_DONE flag. Specifically,alc2005-07-201-0/+1
| | | | | | | | | | | | | | | | make the b_iodone callback responsible for setting it if it is needed. Previously, it was set unconditionally by bufdone() without holding whichever lock is shared by the b_iodone callback and the corresponding top-half function. Consequently, in a race, the top-half function could conclude that operation was done before the b_iodone callback finished. See, for example, aio_physwakeup() and aio_fphysio(). Note: I don't believe that the other, more widely-used b_iodone callbacks are affected. Discussed with: jeff Reviewed by: phk MFC after: 2 weeks
* Fix the recent panics/LORs/hangs created by my kqueue commit by:ssouhlal2005-07-011-1/+1
| | | | | | | | | | | | | | | | | - Introducing the possibility of using locks different than mutexes for the knlist locking. In order to do this, we add three arguments to knlist_init() to specify the functions to use to lock, unlock and check if the lock is owned. If these arguments are NULL, we assume mtx_lock, mtx_unlock and mtx_owned, respectively. - Using the vnode lock for the knlist locking, when doing kqueue operations on a vnode. This way, we don't have to lock the vnode while holding a mutex, in filt_vfsread. Reviewed by: jmg Approved by: re (scottl), scottl (mentor override) Pointyhat to: ssouhlal Will be happy: everyone
* In lio_listio(2) change jobref from an int to a long so thatalc2005-06-071-1/+2
| | | | | | lio_listio(LIO_WAIT, ...) works correctly on 64-bit architectures. Reviewed by: tegge
* Eliminate an unused field from struct aio_liojob.alc2005-06-051-2/+0
|
* Eliminate the original method of requesting notification of aio_read(2) andalc2005-06-041-58/+14
| | | | | | | | | | | | | | | | | aio_write(2) completion through kevent(2). This method does not work on 64-bit architectures. It was deprecated in FreeBSD 4.4. See revisions 1.87 and 1.70.2.7. Change aio_physwakeup() to call psignal(9) directly rather than indirectly through a timeout(9). Discussed with: bde Correct a bug introduced in revision 1.65 that could result in premature delivery of a signal if an lio_listio(2) consisted of a mixture of direct/raw and queued I/O operations. Observed by: tegge Eliminate a field from struct kaioinfo that is now unused. Reviewed by: tegge
* Synchronize access to the per process aiocb lists in many of the functions.alc2005-06-031-2/+19
|
* In aio_waitcomplete() correct two cases of using an aiocb after freeing it.alc2005-06-021-2/+4
|
* Synchronize access to aio_freeproc with a mutex. Eliminate related splalc2005-05-301-12/+21
| | | | | | calls. Reduce the scope of Giant in aio_daemon().
* Use the proc mtx to prevent simultaneous changes to p_aioinfo.alc2005-05-301-16/+21
|
* Eliminate unnecessary calls to wakeup(); no one sleeps on &aio_freeproc.alc2005-05-301-12/+1
| | | | Eliminate an unused flag, AIOP_SCHED; it's cleared but never set.
* Eliminate aio_activeproc; it's unused.alc2005-05-301-6/+0
|
* Eliminate aio_bufjobs; it's unused.alc2005-05-291-5/+0
|
* - Acquire Giant in AIO's iodone routine. VFS will no longer do it for usjeff2005-04-301-0/+2
| | | | | | soon. Sponsored by: Isilon Systems, Inc.
* fix aio+kq... I've been running ambrisko's test program for much longerjmg2005-03-181-1/+1
| | | | | | | | | | | | w/o problems than I was before... This simply brings back the knote_delete as knlist_delete which will also drop the knote's, instead of just clearing the list and seeing _ONESHOT... Fix a race where if a note was _INFLUX and _DETACHED, it could end up being modified... whoopse.. MFC after: 1 week Prodded by: ambrisko and dwhite
* Make a SYSCTL_NODE staticphk2005-02-101-1/+1
|
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Remove buf->b_dev field.phk2004-11-041-1/+0
|
* Give dev_strategy() an explict cdev argument in preparation for removingphk2004-10-291-1/+1
| | | | | | | | | | | buf->b-dev. Put a bio between the buf passed to dev_strategy() and the device driver strategy routine in order to not clobber fields in the buf. Assert copyright on vfs_bio.c and update copyright message to canonical text. There is no legal difference between John Dysons two-clause abbreviated BSD license and the canonical text.
* Put the I/O block size in bufobj->bo_bsize.phk2004-10-261-1/+1
| | | | | | | We keep si_bsize_phys around for now as that is the simplest way to pull the number out of disk device drivers in devfs_open(). The correct solution would be to do an ioctl(DIOCGSECTORSIZE), but the point is probably mooth when filesystems sit on GEOM, so don't bother for now.
* cover soreadable and sowriteable with the corresponding socketbuffer locks.alfred2004-10-011-9/+9
|
* Eliminate DEV_STRATEGY() macro: call dev_strategy() directly.phk2004-09-231-1/+1
| | | | Make dev_strategy() handle errors and departing devices properly.
* Tag AIO as requiring Giant over the network stack usingrwatson2004-09-031-0/+2
| | | | | | NET_NEEDS_GIANT(). RELENG_5 candidate.
* Add locking to the kqueue subsystem. This also makes the kqueue subsystemjmg2004-08-151-10/+15
| | | | | | | | | | | | | a more complete subsystem, and removes the knowlege of how things are implemented from the drivers. Include locking around filter ops, so a module like aio will know when not to be unloaded if there are outstanding knotes using it's filter ops. Currently, it uses the MTX_DUPOK even though it is not always safe to aquire duplicate locks. Witness currently doesn't support the ability to discover if a dup lock is ok (in some cases). Reviewed by: green, rwatson (both earlier versions)
* clean up whitespace...jmg2004-08-131-55/+55
|
OpenPOWER on IntegriCloud