#
2905ade2 |
| 27-Jun-2006 |
Pawel Jakub Dawidek <pjd@FreeBSD.org> |
- Use suser_cred(9) instead of checking cr_ruid directly. - For privileged processes safe two mutex operations.
We may want to consider if this is good idea to use SUSER_ALLOWJAIL here, but for now
- Use suser_cred(9) instead of checking cr_ruid directly. - For privileged processes safe two mutex operations.
We may want to consider if this is good idea to use SUSER_ALLOWJAIL here, but for now I didn't wanted to change the original behaviour.
Reviewed by: rwatson
show more ...
|
Revision tags: release/5.5.0_cvs, release/5.5.0, release/6.1.0_cvs, release/6.1.0 |
|
#
795a11d0 |
| 16-Mar-2006 |
David Xu <davidxu@FreeBSD.org> |
Fix a race between file operations and rfork(RFCFDG) by parking all other threads at user boundary, the race can crash kernel under stress testing.
Reviewed by: jhb MFC after: 3 days
|
#
eb2da9a5 |
| 08-Feb-2006 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Simplify system time accounting for profiling.
Rename struct thread's td_sticks to td_pticks, we will need the other name for more appropriately named use shortly. Reduce it from uint64_t to u_int.
Simplify system time accounting for profiling.
Rename struct thread's td_sticks to td_pticks, we will need the other name for more appropriately named use shortly. Reduce it from uint64_t to u_int.
Clear td_pticks whenever we enter the kernel instead of recording its value as reference for userret(). Use the absolute value of td->pticks in userret() and eliminate third argument.
show more ...
|
#
2c9d9d39 |
| 06-Feb-2006 |
John Baldwin <jhb@FreeBSD.org> |
We don't need the proc lock to check P_KTHREAD on curthread since it is only set before the kthread starts executing and is never cleared.
|
#
ad20c8f3 |
| 06-Feb-2006 |
Wayne Salamon <wsalamon@FreeBSD.org> |
Audit the args to rfork(), and the child PID for all fork system calls.
Obtained from: TrustedBSD Project Approved by: rwatson (mentor)
|
#
fcf7f27a |
| 02-Feb-2006 |
Robert Watson <rwatson@FreeBSD.org> |
Hook up audit to fork() and exit() events. These changes manage the audit state on processes, not auditing of these events.
Much work by: wsalamon Obtained from: TrustedBSD Project
|
#
2c255e9d |
| 13-Nov-2005 |
Robert Watson <rwatson@FreeBSD.org> |
Moderate rewrite of kernel ktrace code to attempt to generally improve reliability when tracing fast-moving processes or writing traces to slow file systems by avoiding unbounded queueuing and droppe
Moderate rewrite of kernel ktrace code to attempt to generally improve reliability when tracing fast-moving processes or writing traces to slow file systems by avoiding unbounded queueuing and dropped records. Record loss was previously possible when the global pool of records become depleted as a result of record generation outstripping record commit, which occurred quickly in many common situations.
These changes partially restore the 4.x model of committing ktrace records at the point of trace generation (synchronous), but maintain the 5.x deferred record commit behavior (asynchronous) for situations where entering VFS and sleeping is not possible (i.e., in the scheduler). Records are now queued per-process as opposed to globally, with processes responsible for committing records from their own context as required.
- Eliminate the ktrace worker thread and global record queue, as they are no longer used. Keep the global free record list, as records are still used.
- Add a per-process record queue, which will hold any asynchronously generated records, such as from context switches. This replaces the global queue as the place to submit asynchronous records to.
- When a record is committed asynchronously, simply queue it to the process.
- When a record is committed synchronously, first drain any pending per-process records in order to maintain ordering as best we can. Currently ordering between competing threads is provided via a global ktrace_sx, but a per-process flag or lock may be desirable in the future.
- When a process returns to user space following a system call, trap, signal delivery, etc, flush any pending records.
- When a process exits, flush any pending records.
- Assert on process tear-down that there are no pending records.
- Slightly abstract the notion of being "in ktrace", which is used to prevent the recursive generation of records, as well as generating traces for ktrace events.
Future work here might look at changing the set of events marked for synchronous and asynchronous record generation, re-balancing queue depth, timeliness of commit to disk, and so on. I.e., performing a drain every (n) records.
MFC after: 1 month Discussed with: jhb Requested by: Marc Olzheim <marcolz at stack dot nl>
show more ...
|
Revision tags: release/6.0.0_cvs, release/6.0.0 |
|
#
571dcd15 |
| 01-Jul-2005 |
Suleiman Souhlal <ssouhlal@FreeBSD.org> |
Fix the recent panics/LORs/hangs created by my kqueue commit by:
- Introducing the possibility of using locks different than mutexes for the knlist locking. In order to do this, we add three argumen
Fix the recent panics/LORs/hangs created by my kqueue commit by:
- Introducing the possibility of using locks different than mutexes for the knlist locking. In order to do this, we add three arguments to knlist_init() to specify the functions to use to lock, unlock and check if the lock is owned. If these arguments are NULL, we assume mtx_lock, mtx_unlock and mtx_owned, respectively.
- Using the vnode lock for the knlist locking, when doing kqueue operations on a vnode. This way, we don't have to lock the vnode while holding a mutex, in filt_vfsread.
Reviewed by: jmg Approved by: re (scottl), scottl (mentor override) Pointyhat to: ssouhlal Will be happy: everyone
show more ...
|
Revision tags: release/5.4.0_cvs, release/5.4.0 |
|
#
3d5c30f7 |
| 20-Apr-2005 |
David Xu <davidxu@FreeBSD.org> |
Inherit signal mask for child process in fork1(), RELENG_4 and other *BSD have this behaviour, also it is required by POSIX.
PR: kern/80130 Submitted by: Kostik Belousov konstantin.belousov at zoral
Inherit signal mask for child process in fork1(), RELENG_4 and other *BSD have this behaviour, also it is required by POSIX.
PR: kern/80130 Submitted by: Kostik Belousov konstantin.belousov at zoral dot com dot ua
show more ...
|
#
c6a37e84 |
| 04-Apr-2005 |
John Baldwin <jhb@FreeBSD.org> |
Divorce critical sections from spinlocks. Critical sections as denoted by critical_enter() and critical_exit() are now solely a mechanism for deferring kernel preemptions. They no longer have any a
Divorce critical sections from spinlocks. Critical sections as denoted by 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
show more ...
|
Revision tags: release/4.11.0_cvs, release/4.11.0 |
|
#
9454b2d8 |
| 07-Jan-2005 |
Warner Losh <imp@FreeBSD.org> |
/* -> /*- for copyright notices, minor format tweaks as necessary
|
#
c113083c |
| 14-Dec-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Add new function fdunshare() which encapsulates the necessary light magic for ensuring that a process' filedesc is not shared with anybody.
Use it in the two places which previously had private impl
Add new function fdunshare() which encapsulates the necessary light magic for ensuring that a process' filedesc is not shared with anybody.
Use it in the two places which previously had private implmentations.
This collects all fd_refcnt handling in kern_descrip.c
show more ...
|
#
6004362e |
| 27-Nov-2004 |
David Schultz <das@FreeBSD.org> |
Don't include sys/user.h merely for its side-effect of recursively including other headers.
|
#
6db36923 |
| 21-Nov-2004 |
David Schultz <das@FreeBSD.org> |
Remove local definitions of RANGEOF() and use __rangeof() instead. Also remove a few bogus casts.
|
#
8b059651 |
| 20-Nov-2004 |
David Schultz <das@FreeBSD.org> |
Malloc p_stats instead of putting it in the U area. We should consider simply embedding it in struct proc.
Reviewed by: arch@
|
#
124e4c3b |
| 13-Nov-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not an issue.
The distinction will become significant once we final
Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not an issue.
The distinction will become significant once we finalize the exact lock-type to use for this kind of case.
show more ...
|
#
598b7ec8 |
| 08-Nov-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Use more intuitive pointer for fdinit() and fdcopy().
Change fdcopy() to take unlocked filedesc.
|
#
8ec21e3a |
| 07-Nov-2004 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Allow fdinit() to be called with a NULL fdp argument so we can use it when setting up init.
Make fdinit() lock the fdp argument as needed.
|
Revision tags: release/5.3.0_cvs, release/5.3.0 |
|
#
cda5aba4 |
| 07-Oct-2004 |
David Schultz <das@FreeBSD.org> |
Back out rev 1.240; it is unnecessary. In particular, p1 == curthread, so _PHOLD(p1) will not have to block to swap in p1.
Noticed by: jhb
|
#
299bc736 |
| 01-Oct-2004 |
David Schultz <das@FreeBSD.org> |
Avoid calling _PHOLD(p1) with p2's lock held, since _PHOLD() may block to swap in p1. Instead, call _PHOLD earlier, at a point where the only lock held happens to be p1's.
|
#
a3aa5592 |
| 14-Sep-2004 |
Julian Elischer <julian@FreeBSD.org> |
make some of these conditions apply equally to both threading systems.
|
#
ed062c8d |
| 05-Sep-2004 |
Julian Elischer <julian@FreeBSD.org> |
Refactor a bunch of scheduler code to give basically the same behaviour but with slightly cleaned up interfaces.
The KSE structure has become the same as the "per thread scheduler private data" stru
Refactor a bunch of scheduler code to give basically the same behaviour but with slightly cleaned up interfaces.
The KSE structure has become the same as the "per thread scheduler private data" structure. In order to not make the diffs too great one is #defined as the other at this time.
The KSE (or td_sched) structure is now allocated per thread and has no allocation code of its own.
Concurrency for a KSEGRP is now kept track of via a simple pair of counters rather than using KSE structures as tokens.
Since the KSE structure is different in each scheduler, kern_switch.c is now included at the end of each scheduler. Nothing outside the scheduler knows the contents of the KSE (aka td_sched) structure.
The fields in the ksegrp structure that are to do with the scheduler's queueing mechanisms are now moved to the kg_sched structure. (per ksegrp scheduler private data structure). In other words how the scheduler queues and keeps track of threads is no-one's business except the scheduler's. This should allow people to write experimental schedulers with completely different internal structuring.
A scheduler call sched_set_concurrency(kg, N) has been added that notifies teh scheduler that no more than N threads from that ksegrp should be allowed to be on concurrently scheduled. This is also used to enforce 'fainess' at this time so that a ksegrp with 10000 threads can not swamp a the run queue and force out a process with 1 thread, since the current code will not set the concurrency above NCPU, and both schedulers will not allow more than that many onto the system run queue at a time. Each scheduler should eventualy develop their own methods to do this now that they are effectively separated.
Rejig libthr's kernel interface to follow the same code paths as linkse for scope system threads. This has slightly hurt libthr's performance but I will work to recover as much of it as I can.
Thread exit code has been cleaned up greatly. exit and exec code now transitions a process back to 'standard non-threaded mode' before taking the next step. Reviewed by: scottl, peter MFC after: 1 week
show more ...
|
#
94ddc707 |
| 03-Sep-2004 |
Alan Cox <alc@FreeBSD.org> |
Push Giant deep into vm_forkproc(), acquiring it only if the process has mapped System V shared memory segments (see shmfork_myhook()) or requires the allocation of an ldt (see vm_fault_wire()).
|
#
2630e4c9 |
| 01-Sep-2004 |
Julian Elischer <julian@FreeBSD.org> |
Give setrunqueue() and sched_add() more of a clue as to where they are coming from and what is expected from them.
MFC after: 2 days
|
#
99e9dcb8 |
| 31-Aug-2004 |
Julian Elischer <julian@FreeBSD.org> |
Remove sched_free_thread() which was only used in diagnostics. It has outlived its usefulness and has started causing panics for people who turn on DIAGNOSTIC, in what is otherwise good code.
MFC af
Remove sched_free_thread() which was only used in diagnostics. It has outlived its usefulness and has started causing panics for people who turn on DIAGNOSTIC, in what is otherwise good code.
MFC after: 2 days
show more ...
|