Commit Graph

355 Commits

Author SHA1 Message Date
ad 8ef40c772a Get the pre-loaded module code working. 2008-05-01 14:44:48 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
sborrill cbfd0202cd It's only a typo in a comment, but it reduces the number of diffs in my local
tree :-)
2008-04-24 08:51:06 +00:00
ad 08b44dd8b9 timer fixes for PR 37093:
- Fix serious concurrency problems, making the code MT and MP safe in
  the process.
- Don't allocate memory or inspect process state from hardclock().
2008-04-21 00:13:46 +00:00
ad db0173b9a6 SSP: block interrupts when enabling, and move the init to just before
starting secondary processors.
2008-04-14 18:07:51 +00:00
ad 520b46da7e Use multiple kthreads to process config_interrupts tasks. Proposed on
tech-kern.
2008-04-01 10:37:42 +00:00
ad bb61e73cd5 Add code for dynamically allocated mutexes, as posted on tech-kern. 2008-03-27 19:11:05 +00:00
yamt 91ae756395 - for some ports, especially for ones without pmap_growkernel,
buf_memcalc is used by bootstrap as well.  fix NULL dereference for them.
- limit kva usage for each cache to 20% of vm_map.  XXX a bit arbitrary.
- add a comment.
2008-03-25 23:21:42 +00:00
yamt 93109cd91b when calculating some cache sizes, consider the amount of available kva.
PR/33185.
2008-03-23 10:39:52 +00:00
ad 40379c8716 Commit the "per-CPU" select patch. This is the result of much work and
testing by rmind@ and myself.

Which approach to use is still being discussed, but I would like to get
this out of my working tree. If we decide to use a different approach
there is no problem with revisiting this.
2008-03-22 18:04:42 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
rmind 92ae34c400 Remove include of sys/pset.h in sys/lwp.h header.
Include it in few appropriate sources.
2008-03-09 15:39:14 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
ad bbc79e58a6 Pull in my modules code for review/test/hacking. 2008-01-16 12:34:50 +00:00
rmind 5c71a4d49f Implementation of processor-sets, affinity and POSIX real-time extensions.
Add schedctl(8) - a program to control scheduling of processes and threads.

Notes:
- This is supported only by SCHED_M2;
- Migration of LWP mechanism will be revisited;

Proposed on: <tech-kern>. Reviewed by: <ad>.
2008-01-15 03:37:10 +00:00
yamt ea8e75911e add a per-cpu storage allocator. 2008-01-14 12:40:02 +00:00
ad 9ac502f441 Remove curlwp check, all ports should hopefully be doing the right thing
now (NOTICE: curlwp should be set before main()).
2008-01-12 23:31:40 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
elad cb6146bcbd Call pax_init() for PAX_ASLR. 2007-12-27 13:34:43 +00:00
ad ea3f10f7e0 Merge more changes from vmlocking2, mainly:
- Locking improvements.
- Use pool_cache for more items.
2007-12-26 16:01:34 +00:00
yamt 949e16d902 use binuptime for l_stime/l_rtime. 2007-12-22 01:14:53 +00:00
pooka db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
ad 0239b151ae Add a bit of locking around timecounter attachment / selection. 2007-11-15 20:12:04 +00:00
ad adec684ce8 Boot the secondary processors just before the interrupt-enabled section
of autoconfig. This is needed if APs are able to take interrupts.
2007-11-14 19:45:44 +00:00
yamt f638ba54b7 call debug_init earlier. ie. before malloc is used. 2007-11-14 11:04:07 +00:00
matt fb0b1fa0b8 Use C99 structures initializers when possible.
[from matt-armv6]
2007-11-07 16:51:28 +00:00
ad d37935697b Merge tty changes from the vmlocking branch. 2007-11-07 15:56:11 +00:00
ad c3f5a622f9 Merge from vmlocking. 2007-11-07 00:19:08 +00:00
ad d831186d55 Merge scheduler changes from the vmlocking branch. All discussed on
tech-kern:

- Invert priority space so that zero is the lowest priority. Rearrange
  number and type of priority levels into bands. Add new bands like
  'kernel real time'.
- Ignore the priority level passed to tsleep. Compute priority for
  sleep dynamically.
- For SCHED_4BSD, make priority adjustment per-LWP, not per-process.
2007-11-06 00:42:39 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
ad 9c3109d6c5 Add _SC_NPROCESSORS_ONLN and _SC_NPROCESSORS_CONF for sysconf(). These
are extensions but are provided by many Unix systems.
2007-10-15 14:12:54 +00:00
ad 11dc639958 Merge from vmlocking:
- G/C spinlockmgr() and simple_lock debugging.
- Always include the kernel_lock functions, for LKMs.
- Slightly improved subr_lockdebug code.
- Keep sizeof(struct lock) the same if LOCKDEBUG.
2007-10-11 19:45:24 +00:00
ad 36a1712707 Merge run time accounting changes from the vmlocking branch. These make
the LWP "start time" per-thread instead of per-CPU.
2007-10-08 20:06:17 +00:00
ad 451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
martin cadfc6aaa0 No need to db_init_commands() early any more - it will happen on first
entry to ddb.
2007-10-01 22:05:15 +00:00
ad 19e070934b Make previous conditional upon !__i386__ && !__x86_64__. I know this is
gross but it's a debug check that's not intended to live very long.
curlwp is about to become a function on x86 (and so can't be assigned to).
2007-09-25 22:33:59 +00:00
ad 0c1c910f91 If curlwp is not set before main(), moan about it but continue to set it.
curlwp will need to be available earlier for UVM/pmap bootstrap.
2007-09-25 21:41:59 +00:00
martin 2fd15d17ad db_init_commands() early 2007-09-24 00:00:52 +00:00
rmind 2cecf9bbe9 Implementation of POSIX message queues.
Reviewed by: <ad>, <tech-kern>
2007-09-07 18:56:02 +00:00
xtraeme c371d1d093 Convert the sysmon watchdog framework to use mutex(9) rather than
simple_locks and initialize them on init_main via sysmon_wdog_init().

All the sysmon code now is cleaned up and doesn't use old style locking.
2007-09-02 00:41:24 +00:00
ad 18af8ee9bd Add cpuctl(8). For now this is not much more than a toy for debugging and
benchmarking that allows taking CPUs online/offline.
2007-08-04 11:02:56 +00:00
pooka a06e97c8ef move setrootfstime() from init_main.c to vfs_subr2.c 2007-07-30 08:45:26 +00:00
xtraeme 5623c9a1de Convert sysmon_taskqueue to use mutex(9) and condvar(9) and initialize
them in init_main.c via sysmon_task_queue_preinit().

Reviewed and ok by ad@.
2007-07-21 23:15:16 +00:00
ad b5a9ff06f1 Replace some uses of lockmgr(). 2007-07-21 19:51:47 +00:00
tsutsui 92501230f2 Defer callout_startup2() (which calls softintr_establish(9)) call
after cpu_configure(9) for now because softintr(9) is initialized
in cpu_configure(9) on some ports.

Ok'ed by ad@ on current-users, and fixes hangs on m68k ports
during scsi probe.
2007-07-20 22:15:47 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
ad 73ebbed2a1 Remove kcont:
- There are no users in tree.
- Its functionality has largely been replaced by workqueues and generic
  soft interrupts.
- It's not MP friendly.
2007-07-09 10:05:26 +00:00