summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Add SDT DTrace probes for namei():rwatson2009-04-061-1/+14
| | | | | | | | | vfs:namei:lookup:entry takes parent directory vnode pointer, path to look up, and lookup flags. vfs:namei:lookup:return takes an error value, and if successful, the returned vnode pointer. MFC after: 1 month
* Fix KBI breakage by r190520 which affects older linux.ko binaries:dchagin2009-04-051-1/+1
| | | | | | | | | | | | | | 1) Move the new field (brand_note) to the end of the Brandinfo structure. 2) Add a new flag BI_BRAND_NOTE that indicates that the brand_note pointer is valid. 3) Use the brand_note field if the flag BI_BRAND_NOTE is set and as old modules won't have the flag set, so the new field brand_note would be ignored. Suggested by: jhb Reviewed by: jhb Approved by: kib (mentor) MFC after: 6 days
* Revert change 190655 temporarily. It breaks many setups where nullfs iskan2009-04-041-1/+1
| | | | used and needs to be revisited.
* PowerPC, meet kernel core dumps. The support is basedmarcel2009-04-041-9/+0
| | | | | | | | | | | | | | | | | | on a generic dumper that creates an ELF core file and uses PMAP functions to scan and iterate over memory chunks, as well as handle memory mappings used during dumping. the PMAP layer can choose to return physical memory chunks or virtual memory chunks. For minidumps, the chunks should be virtual. The default MMU I/F implementation for the scan_md() method returns NULL. Thus, when a PMAP implementation does not implement the required methods, an empty core file is created. Here, empty means having an ELF header only. Obtained from: Juniper Networks
* Add a how argument to root_mount_hold() so it can be passed NOWAIT and be calledthompsa2009-04-031-2/+6
| | | | in situations where sleeping isnt allowed.
* vn_vptocnp() unlocks the name cache and forgets to re-lock it beforepeter2009-04-021-1/+1
| | | | | returning in one error case, and mistakenly unlocks it for the umount -f case.
* Fix memory leak in semunload().brueffer2009-03-301-0/+1
| | | | | | PR: 133064 Submitted by: Mateusz Guzik <mjguzik@gmail.com> MFC after: 1 week
* Further rate limit the root wait status, it will be printed once perthompsa2009-03-301-4/+8
| | | | root_mount_rel() wakeup.
* Replace v_dd vnode pointer with v_cache_dd pointer to struct namecachekan2009-03-292-33/+91
| | | | | | | | | | | | in directory vnodes. Allow namecache dotdot entry to be created pointing from child vnode to parent vnode if no existing links in opposite direction exist. Use direct link from parent to child for dotdot lookups otherwise. This restores more efficient dotdot caching in NFS filesystems which was lost when vnodes stoppped being type stable. Reviewed by: kib
* Whitespace/spelling fixes in advance of upcoming functional changes.jamie2009-03-271-12/+12
| | | | Approved by: bz (mentor)
* Skip the allocation of the root hold token if the mount already happened.thompsa2009-03-271-0/+5
|
* When looking up the parent devclass of a new devclass, create the parentjhb2009-03-251-1/+1
| | | | devclass if it doesn't already exist.
* When a file lookup fails due to encountering a doomed vnode from a forcedjhb2009-03-242-7/+9
| | | | | | | unmount, consistently return ENOENT rather than EBADF. Reviewed by: kib MFC after: 1 month
* Clean up MI inittodr(9) and kill noop code.jkim2009-03-231-21/+13
| | | | | | | | | | It was derived from i386 version long ago but never resync'ed again. Originally, i386 version compared the current time from realtime clock with time_second (which was just `time' in the old days). When this MI version was written, it was wrongly compared against `base' AND never used because of a bug (typo?) in the code. This check was killed in i386 version when home-rolled calendaric calculation was removed. Now, we just remove the code here as well to make the code simpler.
* Improve the description of a few sysctls.jhb2009-03-232-12/+13
| | | | | Submitted by: bde (partially) MFC after: 3 days
* Add safety check that does not allow empty strings to be queuedkan2009-03-231-0/+6
| | | | | | | | to the devctl notification queue. Empty strings cause devctl read call to return 0 and result in devd exiting prematurely. The actual offender (ugen notes for root hubs) will be fixed by separate commit.
* Correctly sanity-check timer IDs. [SA-09:06]cperciva2009-03-232-4/+9
| | | | | | | | | | Limit the size of malloced buffer when dumping environment variables. [EN-09:01] Approved by: so (cperciva) Approved by: re (kensmith) Security: FreeBSD-SA-09:06.ktimer Errata: FreeBSD-EN-09:01.kenv
* Fix several issues with parsing the notes for ELF objects.kib2009-03-221-5/+5
| | | | | | | | | | | | | | | | | | | Badly formed ELF note may cause the caclulated pointer to the next note to point both after the note region, that was checked in the code, but also to point before the region, that was not checked [1]. Remember the first note location in note0 and leap out if the note is not between note0 and note_end. In the similar way, badly formed note may cause infinite loop by pointing next note into the same or previous note. Guard against this by limiting amount of loop iterations by arbitrary choosen big number. For clarity, check the calculated note alignment in each iteration. Reported by: Chris Palmer <chris noncombatant org> [1] PR: kern/132886 Reviewed and tested by: dchagin MFC after: 3 days
* Do not underflow the buffer and then report the problem. Check for thekib2009-03-201-6/+6
| | | | | | | | condition before the buffer write. Also, since buflen is unsigned, previous check was ignored. Reviewed by: marcus Tested by: pho
* Remove unneeded braces to reduce used vertical screen space.kib2009-03-201-2/+1
| | | | The location was missed in r190140.
* Do not forget to adjust buflen for the first resolution of the pathkib2009-03-201-1/+2
| | | | | | | | from namecache. While there, compare pointers for equiality. Reviewed by: marcus Tested by: pho
* The nc_nlen member of the struct namecache contains the length of the cachedkib2009-03-201-1/+1
| | | | | | | | | name, not the length + 1. PR: 132620, 132542 Reported by: bf2006a yahoo com Tested by: bf2006a, pho Reviewed by: marcus
* When ktracing namei operations, log a result of the __getcwd().kib2009-03-201-0/+9
| | | | MFC after: 1 week
* Remove unneeded braces to reduce used vertical screen space.kib2009-03-201-4/+2
|
* Fix an old-standing bug that crept in along the several revisions:attilio2009-03-171-15/+15
| | | | | | | | | | B_DELWRI cleanup and vnode disassociation should happen just before to assign the buffer to a queue. Reported by: miwi, Volker <volker at vwsoft dot com>, Ben Kaduk <minimarmot at gmail dot com>, Christopher Mallon <christoph dot mallon at gmx dot de> Tested by: lulf, miwi
* Supply AT_EXECPATH auxinfo entry to the interpreter, both for native andkib2009-03-172-2/+31
| | | | | | | compat32 binaries. Tested by: pho Reviewed by: kan
* Use the properly sized types for ELF object header and program headers.kib2009-03-171-4/+4
| | | | | | | | | This fixes osrel fetching from the FreeBSD branding note for the 64bit platforms. Reported by: swell.k gmail com Reviewed by: dchagin Tested by: dchagin, swell.k gmail com
* Initial suspend/resume support for amd64.jkim2009-03-171-0/+48
| | | | | | This code is heavily inspired by Takanori Watanabe's experimental SMP patch for i386 and large portion was shamelessly cut and pasted from Peter Wemm's AP boot code.
* Fix two issues with bufdaemon, often causing the processes to hang inkib2009-03-161-45/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the "nbufkv" sleep. First, ffs background cg group block write requests a new buffer for the shadow copy. When ffs_bufwrite() is called from the bufdaemon due to buffers shortage, requesting the buffer deadlock bufdaemon. Introduce a new flag for getnewbuf(), GB_NOWAIT_BD, to request getblk to not block while allocating the buffer, and return failure instead. Add a flag argument to the geteblk to allow to pass the flags to getblk(). Do not repeat the getnewbuf() call from geteblk if buffer allocation failed and either GB_NOWAIT_BD is specified, or geteblk() is called from bufdaemon (or its helper, see below). In ffs_bufwrite(), fall back to synchronous cg block write if shadow block allocation failed. Since r107847, buffer write assumes that vnode owning the buffer is locked. The second problem is that buffer cache may accumulate many buffers belonging to limited number of vnodes. With such workload, quite often threads that own the mentioned vnodes locks are trying to read another block from the vnodes, and, due to buffer cache exhaustion, are asking bufdaemon for help. Bufdaemon is unable to make any substantial progress because the vnodes are locked. Allow the threads owning vnode locks to help the bufdaemon by doing the flush pass over the buffer cache before getnewbuf() is going to uninterruptible sleep. Move the flushing code from buf_daemon() to new helper function buf_do_flush(), that is called from getnewbuf(). The number of buffers flushed by single call to buf_do_flush() from getnewbuf() is limited by new sysctl vfs.flushbufqtarget. Prevent recursive calls to buf_do_flush() by marking the bufdaemon and threads that temporarily help bufdaemon by TDP_BUFNEED flag. In collaboration with: pho Reviewed by: tegge (previous version) Tested by: glebius, yandex ... MFC after: 3 weeks
* Remove IFF_NEEDSGIANT, a compatibility infrastructure introducedrwatson2009-03-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in FreeBSD 5.x to allow network device drivers to run with Giant despite the network stack being Giant-free. This significantly simplifies calls into ioctl() on network interfaces, especially in the multicast code, as well as eliminates deferred invocation of interface if_start routines. Disable the build on device drivers still depending on IFF_NEEDSGIANT as they no longer compile. They will be removed in a few weeks if they haven't been made MPSAFE in that time. Disabled drivers: if_ar if_axe if_aue if_cdce if_cue if_kue if_ray if_rue if_rum if_sr if_udav if_ural if_zyd Drivers that were already disabled because of tty changes: if_ppp if_sl Discussed on: arch@
* - Wrap lock profiling state variables in #ifdef LOCK_PROFILING blocks.jeff2009-03-154-14/+34
|
* - Implement a new mechanism for resetting lock profiling. We nowjeff2009-03-152-9/+104
| | | | | | | | | | | | | | | | | guarantee that all cpus have acknowledged the cleared enable int by scheduling the resetting thread on each cpu in succession. Since all lock profiling happens within a critical section this guarantees that all cpus have left lock profiling before we clear the datastructures. - Assert that the per-thread queue of locks lock profiling is aware of is clear on thread exit. There were several cases where this was not true that slows lock profiling and leaks information. - Remove all objects from all lists before clearing any per-cpu information in reset. Lock profiling objects can migrate between per-cpu caches and previously these migrated objects could be zero'd before they'd been removed Discussed with: attilio Sponsored by: Nokia
* - When a mutex is destroyed while locked we need to inform lock profilingjeff2009-03-141-0/+1
| | | | that it has been released.
* - Call lock_profile_release when we're transitioning a lock to be owned byjeff2009-03-141-1/+3
| | | | | | LK_KERNPROC. Discussed with: attilio
* - Fix an error that occurs when mp_ncpu is an odd number. steal_threshjeff2009-03-141-4/+9
| | | | | | | | | | | | | | is calculated as 0 which causes errors elsewhere. Submitted by: KOIE Hidetaka <koie@suri.co.jp> - When sched_affinity() is called with a thread that is not curthread we need to handle the ON_RUNQ() case by adding the thread to the correct run queue. Submitted by: Justin Teller <justin.teller@gmail.com> MFC after: 1 Week
* Implement new way of branding ELF binaries by looking to adchagin2009-03-131-51/+101
| | | | | | | | | | | | ".note.ABI-tag" section. The search order of a brand is changed, now first of all the ".note.ABI-tag" is looked through. Move code which fetch osreldate for ELF binary to check_note() handler. PR: 118473 Approved by: kib (mentor)
* 1) Check NULL pointer before calling umtx_pi_adjust_locked(), this avoidsdavidxu2009-03-131-24/+26
| | | | | | a PANIC. 2) Rework locking for POSIX priority-mutex, this fixes a race where a thread may wait there forever even if the mutex is unlocked.
* Change the sysctls for maxbcache and maxswzone from int to long. I missedjhb2009-03-121-2/+2
| | | | this earlier since these sysctls don't exist in 7.x yet.
* Export the current values of nbuf, ncallout, and nswbuf via read-onlyjhb2009-03-121-0/+6
| | | | | | sysctls that match the tunable names. MFC after: 3 days
* Ensure that the semaphore value is re-checked after sem_lockbms2009-03-121-1/+1
| | | | | | | | is re-acquired, after the condition variable is signalled. PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545 MFC after: 5 days Reviewed by: attilio
* Make semaphore debugging output more useful.bms2009-03-121-2/+8
| | | | | | PR: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545 MFC after: 5 days Submitted by: Philip Semanchuk
* When writing out updated pollfd records when returning fromrwatson2009-03-111-1/+22
| | | | | | | | | | | | | | | | | poll(), only copy out the revents field, not the whole pollfd structure. Otherwise, if the events field is updated concurrently by another thread, that update may be lost. This issue apparently causes problems for the JDK on FreeBSD, which expects the Linux behavior of not updating all fields (somewhat oddly, Solaris does not implement the required behavior, but presumably our adaptation of the JDK is based on the Linux port?). MFC after: 2 weeks PR: kern/130924 Submitted by: Kurt Miller <kurt @ intricatesoftware.com> Discussed with: kib
* Add a new type of KTRACE record for sysctl(3) invocations. It uses thejhb2009-03-112-2/+49
| | | | | | | | internal sysctl_sysctl_name() handler to map the MIB array to a string name and logs this name in the trace log. This can be useful to see exactly which sysctls a thread is invoking. MFC after: 1 month
* Gah, fix the code to match the comment. For non-open lookups use ajhb2009-03-111-1/+1
| | | | | | shared vnode lock for the leaf vnode if LOCKSHARED is set. Submitted by: rdivacky
* Add a new internal mount flag (MNTK_EXTENDED_SHARED) to indicate that ajhb2009-03-113-8/+50
| | | | | | | | | | | | | | | | | | | | | | | | filesystem supports additional operations using shared vnode locks. Currently this is used to enable shared locks for open() and close() of read-only file descriptors. - When an ISOPEN namei() request is performed with LOCKSHARED, use a shared vnode lock for the leaf vnode only if the mount point has the extended shared flag set. - Set LOCKSHARED in vn_open_cred() for requests that specify O_RDONLY but not O_CREAT. - Use a shared vnode lock around VOP_CLOSE() if the file was opened with O_RDONLY and the mountpoint has the extended shared flag set. - Adjust md(4) to upgrade the vnode lock on the vnode it gets back from vn_open() since it now may only have a shared vnode lock. - Don't enable shared vnode locks on FIFO vnodes in ZFS and UFS since FIFO's require exclusive vnode locks for their open() and close() routines. (My recent MPSAFE patches for UDF and cd9660 already included this change.) - Enable extended shared operations on UFS, cd9660, and UDF. Submitted by: ups Reviewed by: pjd (ZFS bits) MFC after: 1 month
* Minor nits notice by jhb@imp2009-03-111-3/+2
|
* - Make maxpipekva a signed long rather than an unsigned long as overflowjhb2009-03-102-7/+7
| | | | | | | is more likely to be noticed with signed types. - Make amountpipekva a long as well to match maxpipekva. Discussed with: bde
* In the ABI shim for vfs.bufspace, rather than truncating values larger thanjhb2009-03-101-1/+4
| | | | | | | INT_MAX to INT_MAX, just go ahead and write out the full long to give an error of ENOMEM to the user process. Requested by: bde
* - Remove a recently added comment from kernel_sysctlbyname() that isn'tjhb2009-03-101-9/+1
| | | | | | | | | needed. - Move the release of the sysctl sx lock after the vsunlock() in userland_sysctl() to restore the original memlock behavior of minimizing the amount of memory wired to handle sysctl requests. MFC after: 1 week
* Add an ABI compat shim for the vfs.bufspace sysctl for sysctl requests thatjhb2009-03-101-0/+27
| | | | | try to fetch it as an int rather than a long. If the current value is greater than INT_MAX it reports a value of INT_MAX.
OpenPOWER on IntegriCloud