summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* There is no such thing any more as "struct bdevsw".julian1998-07-041-4/+5
| | | | | | | | | | | | | | | | | | There is only cdevsw (which should be renamed in a later edit to deventry or something). cdevsw contains the union of what were in both bdevsw an cdevsw entries. The bdevsw[] table stiff exists and is a second pointer to the cdevsw entry of the device. it's major is in d_bmaj rather than d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw). rawread()/rawwrite() went away as part of this though it's not strictly the same patch, just that it involves all the same lines in the drivers. cdroms no longer have write() entries (they did have rawwrite (?)). tapes no longer have support for bdev operations. Reviewed by: Eivind Eklund and Mike Smith Changes suggested by eivind.
* 64bit fixes: don't cast pointers to int.dfr1998-06-101-14/+14
|
* Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.des1998-04-171-4/+4
|
* Eradicate the variable "time" from the kernel, using various measures.phk1998-03-301-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "time" wasn't a atomic variable, so splfoo() protection were needed around any access to it, unless you just wanted the seconds part. Most uses of time.tv_sec now uses the new variable time_second instead. gettime() changed to getmicrotime(0. Remove a couple of unneeded splfoo() protections, the new getmicrotime() is atomic, (until Bruce sets a breakpoint in it). A couple of places needed random data, so use read_random() instead of mucking about with time which isn't random. Add a new nfs_curusec() function. Mark a couple of bogosities involving the now disappeard time variable. Update ffs_update() to avoid the weird "== &time" checks, by fixing the one remaining call that passwd &time as args. Change profiling in ncr.c to use ticks instead of time. Resolution is the same. Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call hzto() which subtracts time" sequences. Reviewed by: bde
* Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B anddufault1998-03-281-2/+2
| | | | | | | | | | | | | | | | _KPOSIX_PRIORITY_SCHEDULING options to work. Changes: Change all "posix4" to "p1003_1b". Misnamed files are left as "posix4" until I'm told if I can simply delete them and add new ones; Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux; Add man pages for _POSIX_PRIORITY_SCHEDULING system calls; Add options to LINT; Minor fixes to P1003_1B code during testing.
* Moved some #includes from <sys/param.h> nearer to where they are actuallybde1998-03-281-1/+2
| | | | used.
* Removed a stale comment and staler code.bde1998-02-251-7/+1
|
* Staticize.eivind1998-02-091-17/+17
|
* Back out DIAGNOSTIC changes.eivind1998-02-061-3/+1
|
* Turn DIAGNOSTIC into a new-style option.eivind1998-02-041-1/+3
|
* Quiet some lint.dyson1997-12-101-5/+5
|
* Correct prototypes to match POSIX. Correct return code for aio_cancel.dyson1997-12-081-2/+2
| | | | Submitted by: Alex Nash <nash@mcs.com>
* Fix a problem when creating a new kernel thread. In some cases, aio_readdyson1997-12-011-1/+2
| | | | | | | or aio_write can return the pid of the new thread. This is due to the way that return values from system calls being passed by side-effect in the proc structure now. This commit fixes the problem with aio_read and aio_write.
* Fix error handling for VCHR type I/O. Also, fix another spl problem, anddyson1997-12-011-342/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove alot of overly verbose debugging statements. ioproclist { int aioprocflags; /* AIO proc flags */ TAILQ_ENTRY(aioproclist) list; /* List of processes */ struct proc *aioproc; /* The AIO thread */ TAILQ_HEAD (,aiocblist) jobtorun; /* suggested job to run */ }; /* * data-structure for lio signal management */ struct aio_liojob { int lioj_flags; int lioj_buffer_count; int lioj_buffer_finished_count; int lioj_queue_count; int lioj_queue_finished_count; struct sigevent lioj_signal; /* signal on all I/O done */ TAILQ_ENTRY (aio_liojob) lioj_list; struct kaioinfo *lioj_ki; }; #define LIOJ_SIGNAL 0x1 /* signal on all done (lio) */ #define LIOJ_SIGNAL_POSTED 0x2 /* signal has been posted */ /* * per process aio data structure */ struct kaioinfo { int kaio_flags; /* per process kaio flags */ int kaio_maxactive_count; /* maximum number of AIOs */ int kaio_active_count; /* number of currently used AIOs */ int kaio_qallowed_count; /* maxiumu size of AIO queue */ int kaio_queue_count; /* size of AIO queue */ int kaio_ballowed_count; /* maximum number of buffers */ int kaio_queue_finished_count; /* number of daemon jobs finished */ int kaio_buffer_count; /* number of physio buffers */ int kaio_buffer_finished_count; /* count of I/O done */ struct proc *kaio_p; /* process that uses this kaio block */ TAILQ_HEAD (,aio_liojob) kaio_liojoblist; /* list of lio jobs */ TAILQ_HEAD (,aiocblist) kaio_jobqueue; /* job queue for process */ TAILQ_HEAD (,aiocblist) kaio_jobdone; /* done queue for process */ TAILQ_HEAD (,aiocblist) kaio_bufqueue; /* buffer job queue for process */ TAILQ_HEAD (,aiocblist) kaio_bufdone; /* buffer done queue for process */ }; #define KAIO_RUNDOWN 0x1 /* process is being run down */ #define KAIO_WAKEUP 0x2 /* wakeup process when there is a significant event */ TAILQ_HEAD (,aioproclist) aio_freeproc, aio_activeproc; TAILQ_HEAD(,aiocblist) aio_jobs; /* Async job list */ TAILQ_HEAD(,aiocblist) aio_bufjobs; /* Phys I/O job list */ TAILQ_HEAD(,aiocblist) aio_freejobs; /* Pool of free jobs */ static void aio_init_aioinfo(struct proc *p) ; static void aio_onceonly(void *) ; static int aio_free_entry(struct aiocblist *aiocbe); static void aio_process(struct aiocblist *aiocbe); static int aio_newproc(void) ; static int aio_aqueue(struct proc *p, struct aiocb *job, int type) ; static void aio_physwakeup(struct buf *bp); static int aio_fphysio(struct proc *p, struct aiocblist *aiocbe, int type); static int aio_qphysio(struct proc *p, struct aiocblist *iocb); static void aio_daemon(void *uproc); SYSINIT(aio, SI_SUB_VFS, SI_ORDER_ANY, aio_onceonly, NULL); static vm_zone_t kaio_zone=0, aiop_zone=0, aiocb_zone=0, aiol_zone=0, aiolio_zone=0; /* * Single AIOD vmspace shared amongst all of them */ static struct vmspace *aiovmspace = NULL; /* * Startup initialization */ void aio_onceonly(void *na) { TAILQ_INIT(&aio_freeproc); TAILQ_INIT(&aio_activeproc); TAILQ_INIT(&aio_jobs); TAILQ_INIT(&aio_bufjobs); TAILQ_INIT(&aio_freejobs); kaio_zone = zinit("AIO", sizeof (struct kaioinfo), 0, 0, 1); aiop_zone = zinit("AIOP", sizeof (struct aioproclist), 0, 0, 1); aiocb_zone = zinit("AIOCB", sizeof (struct aiocblist), 0, 0, 1); aiol_zone = zinit("AIOL", AIO_LISTIO_MAX * sizeof (int), 0, 0, 1); aiolio_zone = zinit("AIOLIO", AIO_LISTIO_MAX * sizeof (struct aio_liojob), 0, 0, 1); aiod_timeout = AIOD_TIMEOUT_DEFAULT; aiod_lifetime = AIOD_LIFETIME_DEFAULT; jobrefid = 1; } /* * Init the per-process aioinfo structure. * The aioinfo limits are set per-process for user limit (resource) management. */ void aio_init_aioinfo(struct proc *p) { struct kaioinfo *ki; if (p->p_aioinfo == NULL) { ki = zalloc(kaio_zone); p->p_aioinfo = ki
* Correct a last minute code change. Would have been an infinite loop underdyson1997-11-301-8/+4
| | | | | certain error conditions. Submitted by: pst@shockwave.com
* Fix an spl nit.dyson1997-11-301-1/+7
|
* Finish up the vast majority of the AIO/LIO functionality. Proper signaldyson1997-11-301-106/+552
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | support was missing in the previous version of the AIO code. More tunables added, and very efficient support for VCHR files has been added. Kernel threads are not used for VCHR files, all work for such files is done for the requesting process directly. Some attempt has been made to charge the requesting process for resource utilization, but more work is needed. aio_fsync is still missing (but the original fsync system call can be used for now.) aio_cancel is essentially a noop, but that is okay per POSIX. More aio_cancel functionality can be added later, if it is found to be needed. The functions implemented include: aio_read, aio_write, lio_listio, aio_error, aio_return, aio_cancel, aio_suspend. The code has been implemented to support the POSIX spec 1003.1b (formerly known as POSIX 1003.4 spec) features of the above. The async I/O features are truly async, with the VCHR mode of operation being essentially the same as physio (for appropriate files) for maximum efficiency. This code also supports the signal capability, is highly tunable, allowing management of resource usage, and has been written to allow a per process usage quota. Both the O'Reilly POSIX.4 book and the actual POSIX 1003.1b document were the reference specs used. Any filedescriptor can be used with these new system calls. I know of no exceptions where these system calls will not work. (TTY's will also probably work.)
* Disable the VCHR optimization for AIO until I have implemented it. Just indyson1997-11-291-1/+2
| | | | | case anyone wants to play with the POSIX AIO/LIO stuff. (As it is, it should work with ANY vnode, on UP systems only, for now.)
* Fix and complete the AIO syscalls. There are some performance enhancementsdyson1997-11-291-302/+781
| | | | coming up soon, but the code is functional. Docs will be forthcoming.
* Get locking stuff by #including <sys/lock.h> instead of <sys/vnode.h>.bde1997-11-181-2/+2
|
* Remove a bunch of variables which were unused both in GENERIC and LINT.phk1997-11-071-7/+4
| | | | Found by: -Wunused
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-17/+16
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Last major round (Unless Bruce thinks of somthing :-) of malloc changes.phk1997-10-121-2/+2
| | | | | | | | Distribute all but the most fundamental malloc types. This time I also remembered the trick to making things static: Put "static" in front of them. A couple of finer points by: bde
* Distribute and statizice a lot of the malloc M_* types.phk1997-10-111-1/+3
| | | | Substantial input from: bde
* Make the target for the number of AIO daemons work.dyson1997-10-111-2/+18
|
* Major cleanup and debugging of the new AIO/LIO code. The LIO code isdyson1997-10-091-65/+258
| | | | | | | | | now corrected. New tunables/instrumentation added. The code is now likely "good enough to use." I will add the userland support soon. The "high performance" mode for raw devices is still missing, and will be added next. POSIX system calls that now appear to work: aio_cancel, aio_error, aio_read, aio_return, aio_suspend, aio_write, lio_listio. Missing, but to be added soon: aio_fsync.
* Removed unused #includes.bde1997-09-021-9/+1
|
* Clean up some lint associated with the AIO code.dyson1997-07-171-4/+6
|
* This is an upgrade so that the kernel supports the AIO calls fromdyson1997-07-061-64/+977
| | | | | | | | | | | POSIX.4. Additionally, there is some initial code that supports LIO. This code supports AIO/LIO for all types of file descriptors, with few if any restrictions. There will be a followup very soon that will support significantly more efficient operation for VCHR type files (raw.) This code is also dependent on some kernel features that don't work under SMP yet. After I commit the changes to the kernel to support proper address space sharing on SMP, this code will also work under SMP.
* Add initial AIO/LIO kernel thread support files. This is preliminary, anddyson1997-06-161-0/+264
further features will be added.
OpenPOWER on IntegriCloud