summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Modify the alq(9) alq_open() API to accept a file creation mode, ratherrwatson2005-04-162-5/+5
| | | | | | | | | than defaulting the cmode argument to vn_open() to 0. Supply a default argument of ALQ_DEFAULT_CMODE (0600) in current callers. Discussed with/pointed out by: hmp Reveiwed by: jeff, hmp MFC after: 3 days
* Fix a typo in the comment.maxim2005-04-151-1/+1
| | | | Noticed by: Samy Al Bahra
* Close a race between sleepq_broadcast() and sleepq_catch_signals().jhb2005-04-141-47/+21
| | | | | | | | | | | | | | | | | | | | | | Specifically, sleepq_broadcast() uses td_slpq for its private pending queue of threads that it is going to wake up after it takes them off the sleep queue. The problem is that if one of the threads is actually not asleep yet, then we can end up with td_slpq being corrupted and/or the thread being made runnable at the wrong time resulting in the td_sleepqueue == NULL assertion failures occasionally reported under heavy load. The fix is to stop being so fancy and ditch the whole pending queue bit. Instead, sleepq_remove_thread() and sleepq_resume_thread() were merged into one function that requires the caller to hold sched_lock. This fixes several places that unlocked sched_lock only to call a function that then locked sched_lock, so even though sched_lock is now held slightly longer, removing the extra lock acquires (1 pair instead of 3 in some cases) probably makes it an overall win if you don't include the fact that it closes a race. This is definitely a 5.4 candidate. PR: kern/79693 Submitted by: Steven Sears stevenjsears at yahoo dot com MFC after: 4 days
* - Remove a debugging printf that slipped in.jeff2005-04-131-1/+0
| | | | Spotted by: Peter Wemm
* According to the comment in struct tty, t_modem is optional; hence we shouldavatar2005-04-131-2/+4
| | | | | | | | guard against NULL t_modem entry. Otherwise, driver doesn't have t_modem callback implemented(such like sys/dev/usb/ucycom.c) would panic when someone opens the driver's associated tty device. Reviewed by: phk, sam (mentor)
* - Change all filesystems and vfs_cache to relock the dvp once the child isjeff2005-04-131-3/+5
| | | | | | locked in the ISDOTDOT case. Se vfs_lookup.c r1.79 for details. Sponsored by: Isilon Systems, Inc.
* - Change vop_lookup_post assertions to reflect recent vfs_lookup changes.jeff2005-04-131-12/+2
| | | | Sponsored by: Isilon Systems, Inc.
* - Further simplify lookup; Force all filesystems to relock in the DOTDOTjeff2005-04-131-30/+23
| | | | | | | | | | | case. There are bugs in some which didn't unlock in the ISDOTDOT case to begin with that need to be addressed seperately. This simplifies things anyway. - Fix relookup() to prevent it from vrele()'ing the dvp while the vp is locked. Catch up to other lookup changes. Sponsored by: Isilon Systems, Inc. Reported by: Peter Wemm
* Implement unix(4) socket options LOCAL_CREDS and LOCAL_CONNWAIT.mdodd2005-04-131-15/+105
| | | | | | | | - Add unp_addsockcred() (for LOCAL_CREDS). - Add an argument to unp_connect2() to differentiate between PRU_CONNECT and PRU_CONNECT2. (for LOCAL_CONNWAIT) Obtained from: NetBSD (with some changes)
* Consistently style function declarations in kern_malloc.c.rwatson2005-04-121-23/+7
| | | | MFC after: 3 days
* Use PCPU_LAZY_INC() for cnt.v_{intr,trap,syscalls} rather than atomicjhb2005-04-121-1/+1
| | | | operations in some places and simple non-per CPU math in others.
* The latest release of the FreeBSD driver (twa) forvkashyap2005-04-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 3ware's 9xxx series controllers. This corresponds to the 9.2 release (for FreeBSD 5.2.1) on the 3ware website. Highlights of this release are: 1. The driver has been re-architected to use a "Common Layer" (all tw_cl* files), which is a consolidation of all OS-independent parts of the driver. The FreeBSD OS specific portions of the driver go into an "OS Layer" (all tw_osl* files). This re-architecture is to achieve better maintainability, consistency of behavior across OS's, and better portability to new OS's (drivers for new OS's can be written by just adding an OS Layer that's specific to the OS, by complying to a "Common Layer Programming Interface" API. 2. The driver takes advantage of multiple processors. 3. The driver has a new firmware image bundled, the new features of which include Online Capacity Expansion and multi-lun support, among others. More details about 3ware's 9.2 release can be found here: http://www.3ware.com/download/Escalade9000Series/9.2/9.2_Release_Notes_Web.pdf Since the Common Layer is used across OS's, the FreeBSD specific include path for header files (/sys/dev/twa) is not part of the #include pre-processor directive in any of the source files. For being able to integrate twa into the kernel despite this, Makefile.<arch> has been changed to add the include path to CFLAGS. Reviewed by: scottl
* resource_list_purge: release the resources in this list, and purge theimp2005-04-121-0/+21
| | | | | | elements of this list (eg, reset it). Man page to follow
* rman_set_device() seems to have been omitted by mistake. Implement it.imp2005-04-121-0/+6
|
* - Remove unused include.jeff2005-04-121-1/+0
|
* - Differentiate two UPGRADE panics so I have a better idea of what's goingjeff2005-04-121-1/+3
| | | | on here.
* Return the resource created/found in resource_list_add to avoid an extraimp2005-04-121-2/+3
| | | | | | | resouce_list_find in some places. Suggested by: sam Found by: Coventry Analysis tool.
* - Mark the VOPs that require exclusive locks. Those that aren't markedjeff2005-04-111-26/+26
| | | | | | | | | with E may be called with a shared lock held. This list really could be made per filesystem if we had any filesystems which differed from ffs in locking guarantees. VFS itself is not sensitive to this except where vgone() etc. are concerned. Sponsored by: Isilon Systems, Inc.
* - Enable ASSERT_VOP_ELOCKED and assert_vop_elocked() now that vnode_if.awkjeff2005-04-111-1/+1
| | | | | | uses it. Sponsored by: Isilon Systems, Inc.
* - Change the VOP_LOCK UPGRADE in vput() to do a LK_NOWAIT to avoid ajeff2005-04-111-39/+43
| | | | | | | | | | | | potential lock order reversal. Also, don't unlock the vnode if this fails, lockmgr has already unlocked it for us. - Restructure vget() now that vn_lock() does all of VI_DOOMED checking for us and also handles the case where there is no real lock type. - If VI_OWEINACT is set, we need to upgrade the lock request to EXCLUSIVE so that we can call inactive. It's not legal to vget a vnode that hasn't had INACTIVE called yet. Sponsored by: Isilon Systems, Inc.
* - Assert that we're no longer doing recursive vn_locks in inactive/reclaimjeff2005-04-111-3/+12
| | | | | | | | | | | | | as I'd like to get rid of the vxthread. - Handle lock requests which don't actually want a lock as this is a much more convenient place to handle this condition than in vget(). These requests simply want to know that VI_DOOMED isn't set. - Correct a test at the end of vn_lock, if error !=0 should be if error == 0, this has been broken since I comitted the VI_DOOMED changes, but no one ran into it because vget() duplicated this functionality. Sponsored by: Isilon Systems, Inc.
* - vput(tvp) before vrele(tdvp) in kern_rename() to avoid lock order issues.jeff2005-04-112-4/+4
|
* Add debugging prints to all the methods in case there are problems withnjl2005-04-101-7/+70
| | | | | managing levels. This can be enabled with the debug.cpufreq.verbose tunable and sysctl.
* Suspend all other threads in the process while generating a core dump.das2005-04-101-1/+11
| | | | | | | | | | | | The main reason for doing this is that the ELF dump handler expects the thread list to be fixed while the dump header is generated, so an upcall that occurs at the wrong time can lead to buffer overruns and other Bad Things. Another solution would be to grab sched_lock in the ELF dump handler, but we might as well single-thread, since the process is about to die. Furthermore, I think this should ensure that the register sets in the core file are sequentially consistent.
* CDEV lock should be before 'system map' lock.pjd2005-04-091-0/+6
| | | | | | | Hardcode this order to help track down reported LOR. LOR reported by: Thierry Herbelot <thierry@herbelot.com> LOR info: http://sources.zabbadoz.net/freebsd/lor.html#080
* - Remove the namei NOOBJ flag. It is meaningless now.jeff2005-04-092-26/+20
| | | | Sponsored by: Isilon Systems, Inc.
* - If we vrele() a dvp while the child is locked we can potentially deadlockjeff2005-04-091-51/+60
| | | | | | | | | | | | | | | | | | when vrele() acquires the directory lock in the wrong order. Fix this via the following changes: - Keep the directory locked after VOP_LOOKUP() until we've determined what we're going to do with the child. This allows us to remove the complicated post LOOKUP code which determins whether we should lock or unlock the parent. This means we may have to vput() in the appropriate cases later, rather than doing an unsafe vrele. - in NDFREE() keep two flags to indicate whether we need to unlock vp or dvp. This allows us to vput rather than vrele in the appropriate cases without rechecking the flags. Move the code to handle dvp after we handle vp. - Remove some dead code from namei() that was the result of changes to VFS_LOCK_GIANT(). Sponsored by: Isilon Systems, Inc.
* Add a missing terminator.pjd2005-04-091-0/+1
| | | | Confirmed by: rwatson
* Add additional newline to debug.mutex.prof.stats header, so thatglebius2005-04-081-1/+1
| | | | column names are printed exactly above the columns.
* Sprinkle some volatile magic and rearrange things a bit to avoid raceups2005-04-084-8/+14
| | | | | | conditions in critical_exit now that it no longer blocks interrupts. Reviewed by: jhb
* Fix bug in vfs_hash_rehash(): use correct bucket. This only affectedphk2005-04-071-1/+1
| | | | msdosfs which is broken in other ways too.
* Constify hexdump() harder.phk2005-04-061-2/+2
|
* - Remove dead code.jeff2005-04-061-26/+2
|
* - Assert that the bufobj matches in flushbuflists. I still haven't gottenjeff2005-04-061-0/+3
| | | | | | | | | | to root cause on exactly how this happens. - If the assert is disabled, we presently try to handle this case, but the BUF_UNLOCK was missing. Thus, if this condition ever hit we would leak a buf lock. Many thanks to Peter Holm for all his help in finding this bug. He really put more effort into it than I did.
* - Move NDFREE() from vfs_subr to vfs_lookup where namei() is.jeff2005-04-052-38/+38
|
* - Use taskqueue_thread rather than taskqueue_swi since our task is goingjeff2005-04-051-1/+1
| | | | | to vrele, which may vop lock. This is not safe in a software interrupt context.
* Assert that the vnode is locked. This is meant to catch bugs orcsjp2005-04-051-0/+1
| | | | | mis-use of the vnode API in conditions where IO_NODELOCKED has been used without the vnode actually being locked.
* Divorce critical sections from spinlocks. Critical sections as denoted byjhb2005-04-045-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | critical_enter() and critical_exit() are now solely a mechanism for deferring kernel preemptions. They no longer have any affect on interrupts. This means that standalone critical sections are now very cheap as they are simply unlocked integer increments and decrements for the common case. Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter() and spinlock_exit(). This KPI is responsible for providing whatever MD guarantees are needed to ensure that a thread holding a spin lock won't be preempted by any other code that will try to lock the same lock. For now all archs continue to block interrupts in a "spinlock section" as they did formerly in all critical sections. Note that I've also taken this opportunity to push a few things into MD code rather than MI. For example, critical_fork_exit() no longer exists. Instead, MD code ensures that new threads have the correct state when they are created. Also, we no longer try to fixup the idlethreads for APs in MI code. Instead, each arch sets the initial curthread and adjusts the state of the idle thread it borrows in order to perform the initial context switch. This change is largely a big NOP, but the cleaner separation it provides will allow for more efficient alternative locking schemes in other parts of the kernel (bare critical sections rather than per-CPU spin mutexes for per-CPU data for example). Reviewed by: grehan, cognet, arch@, others Tested on: i386, alpha, sparc64, powerpc, arm, possibly more
* Document that devclass_get_maxunit(9) returns one greater than the currentnjl2005-04-041-0/+3
| | | | | | | highest unit. Reviewed by: dfr MFC after: 2 weeks
* Add devclass_get_drivers(9) which provides an array of pointers to drivernjl2005-04-041-0/+41
| | | | | | | | instances in a given devclass. This is useful for systems that want to call code in driver static methods, similar to device_identify(). Reviewed by: dfr MFC after: 2 weeks
* - Add a missing unlock of the vnode_free_list_mtx.jeff2005-04-041-1/+3
| | | | Spotted by: Antoine Brodin
* - Instead of waiting forever to get a vnode in getnewvnode() wait forjeff2005-04-041-1/+3
| | | | | | | | | | one to become available for one second and then return ENFILE. We can run out of vnodes, and there must be a hard limit because without one we can quickly run out of KVA on x86. Presently the system can deadlock if there are maxvnodes directories in the namecache. The original 4.x BSD behavior was to return ENFILE if we reached the max, but 4.x BSD did not have the vnlru proc so it was less profitable to wait.
* - Include opt_vfs.h for LOOKUP_SHARED.jeff2005-04-031-8/+16
| | | | | - Control the behavior of shared lookups with the lookup_shared sysctl which has its default behavior set via the LOOKUP_SHARED option.
* maxunit is actually one higher than the greatest currently-allocated unitnjl2005-04-031-1/+1
| | | | | | | | | in a devclass. All the other uses of maxunit are correct and this one was safe since it checks the return value of devclass_get_device(), which would always say that the highest unit device doesn't exist. Reviewed by: dfr MFC after: 3 days
* - Slightly restructure acquire() so I can add more ktr information andjeff2005-04-031-18/+14
| | | | | an assert to help find two strange bugs. - Remove some nearby spls.
* - Now that writes to character devices supporting softupdates canjeff2005-04-031-3/+4
| | | | | | | | | generate dirty bufs even with a locked vnode, 100 retries is not that many. This should probably change from a retry count to an abort when we are no longer cleaning any buffers. - Don't call vprint() while we still hold the vnode locked. Move the call to later in the function. - Clean up a comment.
* Remove GIANT_REQUIRED from elfN_load_section().alc2005-04-031-2/+0
|
* - Change the vm_mmap() function to accept an objtype_t parameter specifyingjhb2005-04-011-2/+4
| | | | | | | | | | | | the type of object represented by the handle argument. - Allow vm_mmap() to map device memory via cdev objects in addition to vnodes and anonymous memory. Note that mmaping a cdev directly does not currently perform any MAC checks like mapping a vnode does. - Unbreak the DRM getbufs ioctl by having it call vm_mmap() directly on the cdev the ioctl is acting on rather than trying to find a suitable vnode to map from. Reviewed by: alc, arch@
* Actually commit the code for kern_sched_get_rr_interval().jhb2005-03-311-13/+20
|
* Implement kern_adjtime(), kern_readv(), kern_sched_rr_get_interval(),jhb2005-03-313-47/+91
| | | | | kern_settimeofday(), and kern_writev() to allow for further stackgap reduction in the compat ABIs.
OpenPOWER on IntegriCloud