summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Move UPCALL related data structure out of kse, introduce a newdavidxu2003-01-2614-1389/+1548
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data structure called kse_upcall to manage UPCALL. All KSE binding and loaning code are gone. A thread owns an upcall can collect all completed syscall contexts in its ksegrp, turn itself into UPCALL mode, and takes those contexts back to userland. Any thread without upcall structure has to export their contexts and exit at user boundary. Any thread running in user mode owns an upcall structure, when it enters kernel, if the kse mailbox's current thread pointer is not NULL, then when the thread is blocked in kernel, a new UPCALL thread is created and the upcall structure is transfered to the new UPCALL thread. if the kse mailbox's current thread pointer is NULL, then when a thread is blocked in kernel, no UPCALL thread will be created. Each upcall always has an owner thread. Userland can remove an upcall by calling kse_exit, when all upcalls in ksegrp are removed, the group is atomatically shutdown. An upcall owner thread also exits when process is in exiting state. when an owner thread exits, the upcall it owns is also removed. KSE is a pure scheduler entity. it represents a virtual cpu. when a thread is running, it always has a KSE associated with it. scheduler is free to assign a KSE to thread according thread priority, if thread priority is changed, KSE can be moved from one thread to another. When a ksegrp is created, there is always N KSEs created in the group. the N is the number of physical cpu in the current system. This makes it is possible that even an userland UTS is single CPU safe, threads in kernel still can execute on different cpu in parallel. Userland calls kse_create to add more upcall structures into ksegrp to increase concurrent in userland itself, kernel is not restricted by number of upcalls userland provides. The code hasn't been tested under SMP by author due to lack of hardware. Reviewed by: julian
* - Add the ule scheduler. This is intended to be a general purpose processjeff2003-01-261-0/+697
| | | | | scheduler with many SMP benefits. It is still very experimental and should be used only in test environments.
* - Call sched_sleep() instead of rolling our own in cv_waitq_add().jeff2003-01-261-2/+2
|
* Bring shm functions closer the the opengroup standards.alfred2003-01-252-5/+5
| | | | | PR: 47469 Submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Bring semop() closer the the opengroup standards.alfred2003-01-252-4/+5
| | | | | PR: 47471 Submitted by: Craig Rodrigues <rodrigc@attbi.com>
* Add sysctl kern.timecounter.nsetclock which indicates the number ofphk2003-01-251-0/+2
| | | | | | | | | | potential discontinuities in our UTC timescale. Applications can monitor this variable if they want to be informed about steps in the timescale. Slews (ntp and adjtime(2)) and frequency adjustments (ntp) will not increment this counter, only operations which set the clock. No attempt is made to classify size or direction of the step.
* Remove extraneous FILEDESC_LOCKs around atomic reads.hsu2003-01-241-4/+0
| | | | Reviewed by: jhb
* Added comment why this workaround is required.ume2003-01-221-1/+7
| | | | | Suggested by: sam MFC after: 1 week
* getpeername() returns with no error but didn't fill struct sockaddrume2003-01-221-0/+2
| | | | | | | | | | correctly against PF_LOCAL. It seems that the test always fails then sockaddr was not filled. So, I added else clause for workaround. I doubt if it is right fix. However, it is better than nothing. I found that NetBSD has same potential problem. But, fortunately, NetBSD has equivalent else clause. MFC after: 1 week
* There's absolutely no need for a struct-within-a-struct, so move thedes2003-01-212-28/+24
| | | | counters out of the inner struct and remove it.
* Add missing SMP file locks around read-modify-write operations onhsu2003-01-211-1/+5
| | | | | | the flag field. Reviewed by: rwatson
* Correct an off-by-one in the boundary check. Otherwise, resourcetmm2003-01-211-1/+1
| | | | | allocations would fail if the desired allocation size was equal to the boundary.
* #ifdef NO_GEOM all of this file.phk2003-01-211-0/+2
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-2165-312/+312
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* preserve the order of tags copied by m_tag_copy_chainsam2003-01-211-3/+2
| | | | Obtained from: OpenBSD
* Rewrite the SMP filedesc locking in knote_attach() in order tohsu2003-01-211-23/+11
| | | | | | | | | | | | | 1. eliminate unnecessary loop which frees and re-allocates the just allocated array 2. eliminate the newsize recomputation 3. eliminate unnecessary unlock and relock around free 4. correctly match the free with the malloc into M_KQUEUE instead of M_TEMP 5. eliminate conditional assignment of oldlist, which is equivalent to a simple assignment 6. eliminate the oldlist temporary variable completely Reviewed by: jhb
* Perform VOP_GETATTR() before mac_check_vnode_exec() so thatrwatson2003-01-211-5/+5
| | | | | | | the cached attributes are available to MAC modules. Submitted by: mike halderman <mrh@nosc.mil> Obtained from: TrustedBSD Project
* Resolve relative relocations in klds before trying to parse the module'sjake2003-01-213-73/+93
| | | | | | | | | | | | metadata. This fixes module dependency resolution by the kernel linker on sparc64, where the relocations for the metadata are different than on other architectures; the relative offset is in the addend of an Elf_Rela record instead of the original value of the location being patched. Also fix printf formats in debug code. Submitted by: Hartmut Brandt <brandt@fokus.gmd.de> PR: 46732 Tested on: alpha (obrien), i386, sparc64
* Close the remaining user address mapping races for physicaldillon2003-01-203-9/+50
| | | | | | | I/O, CAM, and AIO. Still TODO: streamline useracc() checks. Reviewed by: alc, tegge MFC after: 7 days
* disk_dev_synth() is a NO_GEOM hack.phk2003-01-201-0/+4
|
* Only include <sys/diskslice.h> ifdef NO_GEOMphk2003-01-201-1/+1
|
* - Hold the page queues lock around vm_page_hold().alc2003-01-201-0/+2
| | | | | - Assert that the page queues lock rather than Giant is held in vm_page_hold().
* Remove a KASSERT that can now happen and add a missing setrunnable.julian2003-01-203-2/+4
|
* #ifdef NO_GEOM these files entirely. When NO_GEOM is removed as anphk2003-01-192-0/+4
| | | | option the files can be removed.
* Remove unnecessary locking of Giant around nanotime() in clock_gettime().tjr2003-01-191-2/+0
|
* Mark more code #ifdef NODEVFSphk2003-01-191-1/+6
|
* Originally when DEVFS was added, a global variable "devfs_present"phk2003-01-194-29/+27
| | | | | | | | | | | | was used to control code which were conditional on DEVFS' precense since this avoided the need for large-scale source pollution with #include "opt_geom.h" Now that we approach making DEVFS standard, replace these tests with an #ifdef to facilitate mechanical removal once DEVFS becomes non-optional. No functional change by this commit.
* When we use DEVFS, we don't need the /dev/tty pseudo-driver to dophk2003-01-191-0/+89
| | | | | | | | | | | | more than return ENXIO from its open routine, so most of this file is unneeded. A straight #ifdef'ing would look quite messy, and make the file quite unreadable, so instead I have simply added the DEVFS version of the file at the top, protected by #ifndef NODEVFS. Once we have removed NODEVFS option, we can retain 86 the 86 lines at the top and drop the other 287 lines.
* useracc() is mpsafe so we only need to hold Giantalfred2003-01-191-10/+5
| | | | | | over the call to nanosleep1() Pointed out by: tjr
* Fix comment about what we do when there are no listeners.imp2003-01-191-13/+3
|
* Move alpha_fix_srm_checksum() from subr_diskmbr.c to subr_disklabel.cphk2003-01-172-17/+16
|
* Remove the unused DSO_* options.phk2003-01-171-31/+6
|
* Disallow listen() on sockets which are in the SS_ISCONNECTED ortmm2003-01-171-0/+4
| | | | | | | | | | | SS_ISCONNECTING state, returning EINVAL (which is what POSIX mandates in this case). listen() on connected or connecting sockets would cause them to enter a bad state; in the TCP case, this could cause sockets to go catatonic or panics, depending on how the socket was connected. Reviewed by: -net MFC after: 2 weeks
* Move dkmodpart() from subr_diskslice.c to subr_disklabel.c.phk2003-01-172-6/+6
|
* Move a local variable to avoid the compiler warning about it being unused.phk2003-01-161-1/+2
|
* hardpps() wants the raw hardware counter value converted to nanoseconds.jhay2003-01-161-7/+7
|
* Fix two long-standing, but likely harmless, errors in the use ofalc2003-01-161-2/+2
| | | | | | | | | | | | | vm_pageout_deficit: 1. Update vm_pageout_deficit before VM_WAIT. There is no sense in delaying the update; the sooner the pageout daemon receives this information the better. Reviewed by: tegge 2. Update vm_pageout_deficit according to the number of pages still needed to complete the allocation, not the original size of the allocation. Submitted by: tegge (These errors have existed since the introduction of vm_pageout_deficit in revision 1.144.)
* Merge all the various copies of vmapbuf() and vunmapbuf() into a singledillon2003-01-151-0/+76
| | | | | | | | portable copy. Note that pmap_extract() must be used instead of pmap_kextract(). This is precursor work to a reorganization of vmapbuf() to close remaining user/kernel races (which can lead to a panic).
* Don't forget to disconnect object from class.davidxu2003-01-151-2/+3
|
* Introduce the ability to flag a sysctl for operation at secure level 2 or 3dillon2003-01-141-2/+3
| | | | | | | | | | | | in addition to secure level 1. The mask supports up to a secure level of 8 but only add defines through CTLFLAG_SECURE3 for now. As per the missif in the log entry for 1.11 of ip_fw2.c which added the secure flag to the IPFW sysctl's in the first place, change the secure level requirement from 1 to 3 now that we have support for it. Reviewed by: imp With Design Suggestions by: imp
* - Update vm_pageout_deficit using atomic operations. It's a simplealc2003-01-141-2/+4
| | | | | counter outside the scope of existing locks. - Eliminate a redundant clearing of vm_pageout_deficit.
* It is possible for an active aio to prevent shared memory from beingdillon2003-01-134-25/+20
| | | | | | | | | | | | | dereferenced when a process exits due to the vmspace ref-count being bumped. Change shmexit() and shmexit_myhook() to take a vmspace instead of a process and call it in vmspace_dofree(). This way if it is missed in exit1()'s early-resource-free it will still be caught when the zombie is reaped. Also fix a potential race in shmexit_myhook() by NULLing out vmspace->vm_shm prior to calling shm_delete_mapping() and free(). MFC after: 7 days
* style(9) fixes, mostly add parens around return arguments.alfred2003-01-131-63/+65
|
* - Unbreak world. I did not notice that libkvm was still used in some placesjeff2003-01-131-7/+5
| | | | | | to access the pctcpu. This will have to be sorted out more later as the new scheduler requires a procedural interface for this data. A more complete solution will follow.
* Bow to the whining masses and change a union back into void *. Retaindillon2003-01-1315-140/+129
| | | | | removal of unnecessary casts and throw in some minor cleanups to see if anyone complains, just for the hell of it.
* - Move ke_pctcpu and ke_cpticks into the scheduler specific datastructure.jeff2003-01-121-15/+30
| | | | | This will prevent access through mechanisms other than the published interfaces.
* Allowing nent < 0 in aio_suspend() and lio_listio() is just asking fortjr2003-01-121-2/+2
| | | | trouble. Return EINVAL instead.
* Remove "XXX undocumented" comment from lio_listio().tjr2003-01-121-1/+1
|
* vm_hold_load_pages() needn't clear PG_ZERO because it didn't passalc2003-01-121-1/+0
| | | | VM_ALLOC_ZERO to vm_page_alloc(). (PG_ZERO is clear by default.)
* Change struct file f_data to un_data, a union of the correct structdillon2003-01-1215-128/+125
| | | | | | | | | | pointer types, and remove a huge number of casts from code using it. Change struct xfile xf_data to xun_data (ABI is still compatible). If we need to add a #define for f_data and xf_data we can, but I don't think it will be necessary. There are no operational changes in this commit.
OpenPOWER on IntegriCloud