summaryrefslogtreecommitdiff
path: root/sys/kern/sys_process.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Clear p_stops when doing PT_DETACH.Xin LI2015-06-011-0/+1
| | | | | | | | | | | | | | Without this, if a process was being traced by truss(1), which uses different p_stops bits than gdb(1), the latter would misbehave because of the unexpected bits. Reported by: jceel Submitted by: sef Sponsored by: iXsystems, Inc. MFC after: 2 weeks Notes: svn path=/head/; revision=283889
* Add KTR tracing for some MI ptrace events.John Baldwin2015-05-251-1/+74
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D2643 Reviewed by: kib Notes: svn path=/head/; revision=283546
* Add a facility for non-init process to declare itself the reaper ofKonstantin Belousov2014-12-151-191/+0
| | | | | | | | | | | | | | the orphaned descendants. Base of the API is modelled after the same feature from the DragonFlyBSD. Requested by: bapt Reviewed by: jilles (previous version) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Notes: svn path=/head/; revision=275800
* Plug unnecessary PRS_NEW check in kern_procctl.Mateusz Guzik2014-10-221-4/+1
| | | | | | | pfind does not return processes in such state. Notes: svn path=/head/; revision=273452
* Require p_cansched() for changing a process' protection status viaJohn Baldwin2014-10-021-1/+1
| | | | | | | | | | procctl() rather than p_cansee(). Submitted by: rwatson MFC after: 3 days Notes: svn path=/head/; revision=272449
* Correct the problems with the ptrace(2) making the debuggee an orphan.Konstantin Belousov2014-08-071-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One problem is inferior(9) looping due to the process tree becoming a graph instead of tree if the parent is traced by child. Another issue is due to the use of p_oppid to restore the original parent/child relationship, because real parent could already exited and its pid reused (noted by mjg). Add the function proc_realparent(9), which calculates the parent for given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head element of the p_orphan list and than stepping back to its container to find the parent process. If the parent has already exited, the init(8) is returned. Move the P_ORPHAN and the new helper flag from the p_flag* to new p_treeflag field of struct proc, which is protected by proctree lock instead of proc lock, since the orphans relationship is managed under the proctree_lock already. The remaining uses of p_oppid in ptrace(PT_DETACH) and process reapping are replaced by proc_realparent(9). Phabric: D417 Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=269656
* Extend the support for exempting processes from being killed when swap isJohn Baldwin2013-09-191-0/+195
| | | | | | | | | | | | | | | | | | | | | | | | | exhausted. - Add a new protect(1) command that can be used to set or revoke protection from arbitrary processes. Similar to ktrace it can apply a change to all existing descendants of a process as well as future descendants. - Add a new procctl(2) system call that provides a generic interface for control operations on processes (as opposed to the debugger-specific operations provided by ptrace(2)). procctl(2) uses a combination of idtype_t and an id to identify the set of processes on which to operate similar to wait6(). - Add a PROC_SPROTECT control operation to manage the protection status of a set of processes. MADV_PROTECT still works for backwards compatability. - Add a p_flag2 to struct proc (and a corresponding ki_flag2 to kinfo_proc) the first bit of which is used to track if P_PROTECT should be inherited by new child processes. Reviewed by: kib, jilles (earlier version) Approved by: re (delphij) MFC after: 1 month Notes: svn path=/head/; revision=255708
* Revert r253939:Attilio Rao2013-08-051-6/+5
| | | | | | | | | | | | | | | | We cannot busy a page before doing pagefaults. Infact, it can deadlock against vnode lock, as it tries to vget(). Other functions, right now, have an opposite lock ordering, like vm_object_sync(), which acquires the vnode lock first and then sleeps on the busy mechanism. Before this patch is reinserted we need to break this ordering. Sponsored by: EMC / Isilon storage division Reported by: kib Notes: svn path=/head/; revision=253953
* The page hold mechanism is fast but it has couple of fallouts:Attilio Rao2013-08-041-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | - It does not let pages respect the LRU policy - It bloats the active/inactive queues of few pages Try to avoid it as much as possible with the long-term target to completely remove it. Use the soft-busy mechanism to protect page content accesses during short-term operations (like uiomove_fromphys()). After this change only vm_fault_quick_hold_pages() is still using the hold mechanism for page content access. There is an additional complexity there as the quick path cannot immediately access the page object to busy the page and the slow path cannot however busy more than one page a time (to avoid deadlocks). Fixing such primitive can bring to complete removal of the page hold mechanism. Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff Tested by: pho Notes: svn path=/head/; revision=253939
* Switch some "low-hanging fruit" to acquire read lock on vmobjectsAttilio Rao2013-04-081-5/+5
| | | | | | | | | | | rather than write locks. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho Notes: svn path=/head/; revision=249277
* Switch the vm_object mutex to be a rwlock. This will enable in theAttilio Rao2013-03-091-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pages are accessed for reading purposes. The change is mostly mechanical but few notes are reported: * The KPI changes as follow: - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK() - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK() - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK() - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED() (in order to avoid visibility of implementation details) - The read-mode operations are added: VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(), VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED() * The vm/vm_pager.h namespace pollution avoidance (forcing requiring sys/mutex.h in consumers directly to cater its inlining functions using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h consumers now must include also sys/rwlock.h. * zfs requires a quite convoluted fix to include FreeBSD rwlocks into the compat layer because the name clash between FreeBSD and solaris versions must be avoided. At this purpose zfs redefines the vm_object locking functions directly, isolating the FreeBSD components in specific compat stubs. The KPI results heavilly broken by this commit. Thirdy part ports must be updated accordingly (I can think off-hand of VirtualBox, for example). Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: pjd (ZFS specific review) Discussed with: alc Tested by: pho Notes: svn path=/head/; revision=248084
* Merge from vmobj-rwlock branch:Attilio Rao2013-02-261-1/+0
| | | | | | | | | | | Remove unused inclusion of vm/vm_pager.h and vm/vnode_pager.h. Sponsored by: EMC / Isilon storage division Tested by: pho Reviewed by: alc Notes: svn path=/head/; revision=247297
* When vforked child is traced, the debugging events are not generatedKonstantin Belousov2013-02-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | until child performs exec(). The behaviour is reasonable when a debugger is the real parent, because the parent is stopped until exec(), and sending a debugging event to the debugger would deadlock both parent and child. On the other hand, when debugger is not the parent of the vforked child, not sending debugging signals makes it impossible to debug across vfork. Fix the issue by declining generating debug signals only when vfork() was done and child called ptrace(PT_TRACEME). Set a new process flag P_PPTRACE from the attach code for PT_TRACEME, if P_PPWAIT flag is set, which indicates that the process was created with vfork() and still did not execed. Check P_PPTRACE from issignal(), instead of refusing the trace outright for the P_PPWAIT case. The scope of P_PPTRACE is exactly contained in the scope of P_PPWAIT. Found and tested by: zont Reviewed by: pluknet MFC after: 2 weeks Notes: svn path=/head/; revision=246484
* Remove the support for using non-mpsafe filesystem modules.Konstantin Belousov2012-10-221-3/+1
| | | | | | | | | | | | | | | In particular, do not lock Giant conditionally when calling into the filesystem module, remove the VFS_LOCK_GIANT() and related macros. Stop handling buffers belonging to non-mpsafe filesystems. The VFS_VERSION is bumped to indicate the interface change which does not result in the interface signatures changes. Conducted and reviewed by: attilio Tested by: pho Notes: svn path=/head/; revision=241896
* Always initialize pl_event.Konstantin Belousov2012-08-081-0/+1
| | | | | | | | Submitted by: Andrey Zonov <andrey@zonov.org> MFC after: 3 days Notes: svn path=/head/; revision=239135
* If you have pressed CTRL+Z and a process is suspended, then you use gdbDavid Xu2012-07-091-4/+4
| | | | | | | | | | | | | | | to attach to the process, it is surprising that the process is resumed without inputting any gdb commands, however ptrace manual said: The tracing process will see the newly-traced process stop and may then control it as if it had been traced all along. But the current code does not work in this way, unless traced process received a signal later, it will continue to run as a background task. To fix this problem, just send signal SIGSTOP to the traced process after we resumed it, this works like that you are attaching to a running process, it is not perfect but better than nothing. Notes: svn path=/head/; revision=238287
* Allow the parent to gather the exit status of the children reparentedKonstantin Belousov2012-02-231-3/+0
| | | | | | | | | | | | | to the debugger. When reparenting for debugging, keep the child in the new orphan list of old parent. When looping over the children in kern_wait(), iterate over both children list and orphan list to search for the process by pid. Submitted by: Dmitry Mikulin <dmitrym juniper.net> MFC after: 2 weeks Notes: svn path=/head/; revision=232048
* Mark the automatically attached child with PL_FLAG_CHILD in structKonstantin Belousov2012-02-101-0/+2
| | | | | | | | | | lwpinfo flags, for PT_FOLLOWFORK auto-attachment. In collaboration with: Dmitry Mikulin <dmitrym juniper net> MFC after: 1 week Notes: svn path=/head/; revision=231320
* In order to maximize the re-usability of kernel code in user space thisKip Macy2011-09-161-2/+2
| | | | | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz) Notes: svn path=/head/; revision=225617
* Add comment from CSRG rev 7.27 (1992/06/23 19:56:55; author: mckusick)David E. O'Brien2011-06-171-0/+9
| | | | Notes: svn path=/head/; revision=223212
* We should not return ECHILD when debugging a child and the parent does aDavid E. O'Brien2011-06-141-2/+6
| | | | | | | | | | "wait4(-1, ..., WNOHANG, ...)". Instead wait(2) should behave as if the child does not wish to report status at this time. Reviewed by: jhb Notes: svn path=/head/; revision=223088
* Add macro to test the sv_flags of any process. Change some places to testDmitry Chagin2011-01-261-1/+1
| | | | | | | | | | the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month Notes: svn path=/head/; revision=217896
* Allow debugger to specify that children of the traced process should beKonstantin Belousov2011-01-251-1/+15
| | | | | | | | | | | automatically traced. Extend the ptrace(PL_LWPINFO) to report that child just forked. Reviewed by: davidxu, jhb MFC after: 2 weeks Notes: svn path=/head/; revision=217819
* Introduce vm_fault_hold() and use it to (1) eliminate a long-standing raceAlan Cox2010-12-201-63/+17
| | | | | | | | | | | | | condition in proc_rwmem() and to (2) simplify the implementation of the cxgb driver's vm_fault_hold_user_pages(). Specifically, in proc_rwmem() the requested read or write could fail because the targeted page could be reclaimed between the calls to vm_fault() and vm_page_hold(). In collaboration with: kib@ MFC after: 6 weeks Notes: svn path=/head/; revision=216604
* Add the ability for GDB to printout the thread name along with otherAttilio Rao2010-11-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | thread specific informations. In order to do that, and in order to avoid KBI breakage with existing infrastructure the following semantic is implemented: - For live programs, a new member to the PT_LWPINFO is added (pl_tdname) - For cores, a new ELF note is added (NT_THRMISC) that can be used for storing thread specific, miscellaneous, informations. Right now it is just popluated with a thread name. GDB, then, retrieves the correct informations from the corefile via the BFD interface, as it groks the ELF notes and create appropriate pseudo-sections. Sponsored by: Sandvine Incorporated Tested by: gianni Discussed with: dim, kan, kib MFC after: 2 weeks Notes: svn path=/head/; revision=215679
* Create a global thread hash table to speed up thread lookup, useDavid Xu2010-10-091-14/+3
| | | | | | | | | | | | | rwlock to protect the table. In old code, thread lookup is done with process lock held, to find a thread, kernel has to iterate through process and thread list, this is quite inefficient. With this change, test shows in extreme case performance is dramatically improved. Earlier patch was reviewed by: jhb, julian Notes: svn path=/head/; revision=213642
* Extend ptrace(PT_LWPINFO) to report siginfo for the signal that causedKonstantin Belousov2010-07-041-3/+62
| | | | | | | | | | debugee stop. The change should keep the ABI. Take care of compat32. Discussed with: davidxu, jhb MFC after: 2 weeks Notes: svn path=/head/; revision=209688
* Use ISO C99 integer types in sys/kern where possible.Ed Schouten2010-06-211-3/+3
| | | | | | | | | There are only about 100 occurences of the BSD-specific u_int*_t datatypes in sys/kern. The ISO C99 integer types are used here more often. Notes: svn path=/head/; revision=209390
* Ignore the 'addr' argument passed to PT_STEP (it is required to be '1'John Baldwin2010-05-251-14/+20
| | | | | | | | | | for PT_STEP which means "ignore") and PT_DETACH. PR: kern/146167 MFC after: 1 week Notes: svn path=/head/; revision=208555
* Reorganize syscall entry and leave handling.Konstantin Belousov2010-05-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend struct sysvec with three new elements: sv_fetch_syscall_args - the method to fetch syscall arguments from usermode into struct syscall_args. The structure is machine-depended (this might be reconsidered after all architectures are converted). sv_set_syscall_retval - the method to set a return value for usermode from the syscall. It is a generalization of cpu_set_syscall_retval(9) to allow ABIs to override the way to set a return value. sv_syscallnames - the table of syscall names. Use sv_set_syscall_retval in kern_sigsuspend() instead of hardcoding the call to cpu_set_syscall_retval(). The new functions syscallenter(9) and syscallret(9) are provided that use sv_*syscall* pointers and contain the common repeated code from the syscall() implementations for the architecture-specific syscall trap handlers. Syscallenter() fetches arguments, calls syscall implementation from ABI sysent table, and set up return frame. The end of syscall bookkeeping is done by syscallret(). Take advantage of single place for MI syscall handling code and implement ptrace_lwpinfo pl_flags PL_FLAG_SCE, PL_FLAG_SCX and PL_FLAG_EXEC. The SCE and SCX flags notify the debugger that the thread is stopped at syscall entry or return point respectively. The EXEC flag augments SCX and notifies debugger that the process address space was changed by one of exec(2)-family syscalls. The i386, amd64, sparc64, sun4v, powerpc and ia64 syscall()s are changed to use syscallenter()/syscallret(). MIPS and arm are not converted and use the mostly unchanged syscall() implementation. Reviewed by: jhb, marcel, marius, nwhitehorn, stas Tested by: marcel (ia64), marius (sparc64), nwhitehorn (powerpc), stas (mips) MFC after: 1 month Notes: svn path=/head/; revision=208453
* On Alan's advice, rather than do a wholesale conversion on a singleKip Macy2010-04-301-4/+4
| | | | | | | | | | | | | | | architecture from page queue lock to a hashed array of page locks (based on a patch by Jeff Roberson), I've implemented page lock support in the MI code and have only moved vm_page's hold_count out from under page queue mutex to page lock. This changes pmap_extract_and_hold on all pmaps. Supported by: Bitgravity Inc. Discussed with: alc, jeffr, and kib Notes: svn path=/head/; revision=207410
* Provide groundwork for 32-bit binary compatibility on non-x86 platforms,Nathan Whitehorn2010-03-111-16/+14
| | | | | | | | | | | | for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32 option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts of the kernel and enhances the freebsd32 compatibility code to support big-endian platforms. Reviewed by: kib, jhb Notes: svn path=/head/; revision=205014
* Initialize pve_fsid and pve_fileid to VNOVAL.Marcel Moolenaar2010-02-111-0/+3
| | | | Notes: svn path=/head/; revision=203788
* o Add support for COMPAT_IA32.Marcel Moolenaar2010-02-111-69/+123
| | | | | | | | | | | | | o Incorporate review comments: - Properly reference and lock the map - Take into account that the VM map can change inbetween requests - Add the fileid and fsid attributes Credits: kib@ Reviewed by: kib@ Notes: svn path=/head/; revision=203783
* Unbreak building kernels with COMPAT_32 enabled. The actual supportMarcel Moolenaar2010-02-091-0/+19
| | | | | | | | | for the PT_VM_ENTRY request from 32-bit processes will follow. Pointy hat: marcel Notes: svn path=/head/; revision=203708
* Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process canMarcel Moolenaar2010-02-091-0/+103
| | | | | | | | | | | obtain the memory map of the traced process. PT_VM_TIMESTAMP can be used to check if the memory map changed since the last time to avoid iterating over all the VM entries unnecesarily. MFC after: 1 month Notes: svn path=/head/; revision=203696
* For PT_TO_SCE stop that stops the ptraced process upon syscall entry,Konstantin Belousov2010-01-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | syscall arguments are collected before ptracestop() is called. As a consequence, debugger cannot modify syscall or its arguments. For i386, amd64 and ia32 on amd64 MD syscall(), reread syscall number and arguments after ptracestop(), if debugger modified anything in the process environment. Since procfs stopeven requires number of syscall arguments in p_xstat, this cannot be solved by moving stop/trace point before argument fetching. Move the code to read arguments into separate function fetch_syscall_args() to avoid code duplication. Note that ktrace point for modified syscall is intentionally recorded twice, once with original arguments, and second time with the arguments set by debugger. PT_TO_SCX stop is executed after cpu_syscall_set_retval() already. Reported by: Ali Polatel <alip exherbo org> Briefly discussed with: jhb MFC after: 3 weeks Notes: svn path=/head/; revision=202882
* Replace VM_PROT_OVERRIDE_WRITE by VM_PROT_COPY. VM_PROT_OVERRIDE_WRITE hasAlan Cox2009-11-261-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | represented a write access that is allowed to override write protection. Until now, VM_PROT_OVERRIDE_WRITE has been used to write breakpoints into text pages. Text pages are not just write protected but they are also copy-on-write. VM_PROT_OVERRIDE_WRITE overrides the write protection on the text page and triggers the replication of the page so that the breakpoint will be written to a private copy. However, here is where things become confused. It is the debugger, not the process being debugged that requires write access to the copied page. Nonetheless, the copied page is being mapped into the process with write access enabled. In other words, once the debugger sets a breakpoint within a text page, the program can write to its private copy of that text page. Whereas prior to setting the breakpoint, a SIGSEGV would have occurred upon a write access. VM_PROT_COPY addresses this problem. The combination of VM_PROT_READ and VM_PROT_COPY forces the replication of a copy-on-write page even though the access is only for read. Moreover, the replicated page is only mapped into the process with read access, and not write access. Reviewed by: kib MFC after: 4 weeks Notes: svn path=/head/; revision=199819
* Update a comment to reflect the previous change.Alan Cox2009-10-251-1/+1
| | | | Notes: svn path=/head/; revision=198463
* o Introduce vm_sync_icache() for making the I-cache coherent withMarcel Moolenaar2009-10-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | the memory or D-cache, depending on the semantics of the platform. vm_sync_icache() is basically a wrapper around pmap_sync_icache(), that translates the vm_map_t argumument to pmap_t. o Introduce pmap_sync_icache() to all PMAP implementation. For powerpc it replaces the pmap_page_executable() function, added to solve the I-cache problem in uiomove_fromphys(). o In proc_rwmem() call vm_sync_icache() when writing to a page that has execute permissions. This assures that when breakpoints are written, the I-cache will be coherent and the process will actually hit the breakpoint. o This also fixes the Book-E PMAP implementation that was missing necessary locking while trying to deal with the I-cache coherency in pmap_enter() (read: mmu_booke_enter_locked). The key property of this change is that the I-cache is made coherent *after* writes have been done. Doing it in the PMAP layer when adding or changing a mapping means that the I-cache is made coherent *before* any writes happen. The difference is key when the I-cache prefetches. Notes: svn path=/head/; revision=198341
* Clean up a number of aspects of token generation from audit arguments toRobert Watson2009-07-021-1/+0
| | | | | | | | | | | | | | | | | | | system calls: - Centralize generation of argument tokens for VM addresses in a macro, ADDR_TOKEN(), and properly encode 64-bit addresses in 64-bit arguments. - Fix up argument numbers across a large number of syscalls so that they match the numeric argument into the system call. - Don't audit the address argument to ioctl(2) or ptrace(2), but do keep generating tokens for mmap(2), minherit(2), since they relate to passing object access across execve(2). Approved by: re (audit argument blanket) Obtained from: TrustedBSD Project MFC after: 1 week Notes: svn path=/head/; revision=195280
* Replace AUDIT_ARG() with variable argument macros with a set more moreRobert Watson2009-06-271-5/+5
| | | | | | | | | | | | | | | | | specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week Notes: svn path=/head/; revision=195104
* Implement global and per-uid accounting of the anonymous memory. AddKonstantin Belousov2009-06-231-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rlimit RLIMIT_SWAP that limits the amount of swap that may be reserved for the uid. The accounting information (charge) is associated with either map entry, or vm object backing the entry, assuming the object is the first one in the shadow chain and entry does not require COW. Charge is moved from entry to object on allocation of the object, e.g. during the mmap, assuming the object is allocated, or on the first page fault on the entry. It moves back to the entry on forks due to COW setup. The per-entry granularity of accounting makes the charge process fair for processes that change uid during lifetime, and decrements charge for proper uid when region is unmapped. The interface of vm_pager_allocate(9) is extended by adding struct ucred *, that is used to charge appropriate uid when allocation if performed by kernel, e.g. md(4). Several syscalls, among them is fork(2), may now return ENOMEM when global or per-uid limits are enforced. In collaboration with: pho Reviewed by: alc Approved by: re (kensmith) Notes: svn path=/head/; revision=194766
* Use the p_sysent->sv_flags flag SV_ILP32 to detect 32bit processKonstantin Belousov2009-03-021-5/+4
| | | | | | | | | executing on 64bit kernel. This eliminates the direct comparisions of p_sysent with &ia32_freebsd_sysvec, that were left intact after r185169. Notes: svn path=/head/; revision=189282
* Revert rev 184216 and 184199, due to the way the thread_lock works,David Xu2008-11-051-0/+2
| | | | | | | | | it may cause a lockup. Noticed by: peter, jhb Notes: svn path=/head/; revision=184667
* Actually, for signal and thread suspension, extra process spin lock isDavid Xu2008-10-231-2/+0
| | | | | | | | | unnecessary, the normal process lock and thread lock are enough. The spin lock is still needed for process and thread exiting to mimic single sched_lock. Notes: svn path=/head/; revision=184199
* Move per-thread userland debugging flags into seperated field,David Xu2008-10-151-11/+6
| | | | | | | | | this eliminates some problems of locking, e.g, a thread lock is needed but can not be used at that time. Only the process lock is needed now for new field. Notes: svn path=/head/; revision=183911
* - Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice fromJeff Roberson2008-03-191-5/+1
| | | | | | | | | | requiring the per-process spinlock to only requiring the process lock. - Reflect these changes in the proc.h documentation and consumers throughout the kernel. This is a substantial reduction in locking cost for these fields and was made possible by recent changes to threading support. Notes: svn path=/head/; revision=177368
* Remove kernel support for M:N threading.Jeff Roberson2008-03-121-15/+0
| | | | | | | | | | | While the KSE project was quite successful in bringing threading to FreeBSD, the M:N approach taken by the kse library was never developed to its full potential. Backwards compatibility will be provided via libmap.conf for dynamically linked binaries and static binaries will be broken. Notes: svn path=/head/; revision=177091
* Use VM_FAULT_DIRTY to fault in pages for write access inStephan Uphoff2007-11-081-2/+3
| | | | | | | | | | | proc_rwmen. Otherwise copy on write may create an anonymous page that is not marked as dirty. Since writing data to these pages in this function also does not dirty these pages they may be later discarded by the pagedaemon. Notes: svn path=/head/; revision=173468