| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
suspend on machines with em(4) now that it uses intr_barrier(9).
ok krw@
|
|
|
|
|
|
|
|
| |
the sense that it guarantees that the specified CPU went through the
scheduler. This also guarantees that interrupt handlers running on that CPU
will have finished when sched_barrier() returns.
ok miod@, guenther@
|
|
|
|
|
|
|
| |
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.
ok tedu@ deraadt@
|
|
|
|
|
|
|
| |
and SPCF_HALTED, these flags only make sense on secondary CPUs which are
unlikely to be present on a SP kernel.
ok kettenis@
|
|
|
|
|
|
|
|
| |
and return the current current CPU, otherwise sched_stop_secondary_cpus()
will spin forever trying to empty its run queues. Fixes hangs during suspend
that many people reported over the last couple of days.
ok bcook@, guenther@
|
|
|
|
|
|
|
|
|
|
| |
TAILQ_FOREACH() isn't safe to use in sched_chooseproc() to iterate
over the run queues because within the loop body we remove the threads
from their run queues and reinsert them elsewhere. As a result, we
end up only draining the first thread of each run queue rather than
all of them.
ok kettenis
|
|
|
|
|
|
|
| |
and FORK_SYSTEM as a flag to set them. This eliminates needing to
peek into other processes threads in various places. Inspired by NetBSD
ok miod@ matthew@
|
|
|
|
|
|
|
|
| |
Linux-compat clone() syscall when *not* using CLONE_THREAD. pirofti@
confirms Opera runs in compat without this, so out it goes; one less hair
to choke on in kern_exit.c
ok tedu@ pirofti@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a race condition which might trigger a case where two cpus try
to run the same idle thread.
The problem arises when one cpu steals the idle proc of another cpu and
this other cpu ends up running the idle thread via spc->spc_idleproc,
resulting in two cpus trying to cpu_switchto(idleX).
On startup, idle procs are scaterred around different runqueues, the
decision for scheduling is:
1 look at my runqueue.
2 if empty, look at other dudes runqueue.
3 if empty, select idle proc via spc->spc_idleproc.
The problem is that cpu0's idle0 might be running on cpu1 due to step 1
or 2 and cpu0 hits step 3.
So cpu0 will select idle0, while cpu1 is in fact running it already.
The solution is to never place idle on a runqueue, therefore being
only selectable through spc->spc_idleproc.
This race can be more easily triggered on a HT cpu on virtualized
environments, where the guest more often than not doesn't have the cpu
for itself, so timing gets shuffled.
ok tedu@ guenther@
go ahead after t2k13 deraadt@
|
|
|
|
| |
ok matthew@ deraadt@
|
|
|
|
| |
ok deraadt
|
|
|
|
|
|
| |
the scheduler.
ok hasbaert@. deraadt@
|
|
|
|
|
|
|
| |
of per-rthread. Handling of per-thread tick and runtime counters
inspired by how FreeBSD does it.
ok kettenis@
|
|
|
|
| |
ok tedu@
|
|
|
|
|
|
| |
they apply.
ok oga@ deraadt@
|
|
|
|
|
|
|
| |
KERNEL_PROC_LOCK -> KERNEL_LOCK
KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK
oga@ ok
|
|
|
|
|
|
| |
and incorrect. Kills an XXX comment.
ok syuu, thib, art, kettenis, millert, deraadt
|
|
|
|
|
|
|
|
|
|
| |
Also make sure not to take the scheduler lock once we have stopped a CPU such
that we can safely take it away without having to worry about deadlock
because it happened to own the scheduler lock.
Fixes issues with suspen on SMP machines.
ok mlarkin@, marco@, art@, deraadt@
|
|
|
|
| |
ok miod@, thib@, oga@, jsing@
|
|
|
|
|
| |
since it is time to start transitioning away from the no-op behaviour.
ok oga kettenis
|
|
|
|
|
|
|
| |
give them back again, effectively stopping and starting these CPUs. Use
the stop function in sys_reboot().
ok marco@, deraadt@
|
|
|
|
|
|
|
| |
Use this to do a shutdown with only the boot processor running. This should
avoid nasty races during shutdown.
help from art@, ok deraadt@, miod@
|
|
|
|
| |
for sys_reboot() to hang forever.
|
|
|
|
|
|
|
| |
particular CPU such that it just sits and spins in the idle loop, effectively
halting that CPU.
ok deraadt@, miod@
|
|
|
|
|
|
|
|
|
| |
sched_exit(). This means that cpu_exit() and whatever it does (for instance
calling free(), as well as the deadproc p_hash handling are now locked as well.
This may have been one of the causes of the reaper panics, especially with
rthread patches... which were terminating a lot of threads very quickly onto
the deadproc p_hash list.
ok kurt kettenis miod
|
|
|
|
|
|
| |
idle proc. p_cpu might be necessary in the future and pegging is just
to be extra safe (although we'll be horribly broken if the idle proc
ever ends up where that flag is checked).
|
|
|
|
|
|
|
|
|
|
| |
something to do. Walk the highest priority queue looking for a proc
to steal and skip those that are pegged.
We could consider walking the other queues in the future too, but this
should do for now.
kettenis@ guenther@ ok
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Split up choosing of cpu between fork and "normal" cases. Fork is
very different and should be treated as such.
- Instead of implicitly choosing a cpu in setrunqueue, do it outside
where it actually makes sense.
- Just because a cpu is marked as idle doesn't mean it will be soon.
There could be a thundering herd effect if we call wakeup from an
interrupt handler, so subtract cpus with queued processes when
deciding which cpu is actually idle.
- some simplifications allowed by the above.
kettenis@ ok (except one bugfix that was not in the intial diff)
|
|
|
|
| |
forever.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Split up run queues so that every cpu has one.
- Make setrunqueue choose the cpu where we want to make this process
runnable (this should be refined and less brutal in the future).
- When choosing the cpu where we want to run, make some kind of educated
guess where it will be best to run (very naive right now).
Other:
- Set operations for sets of cpus.
- load average calculations per cpu.
- sched_is_idle() -> curcpu_is_idle()
tested, debugged and prodded by many@
|
| |
|
| |
|
|
|
|
| |
ok thib beck art
|
|
|
|
|
|
|
|
| |
file copies to nfsv2 causes the system to eventually peg the console.
On the console ^T indicates that the load is increasing rapidly, ddb
indicates many calls to getbuf, there is some very slow nfs traffic
making none (or extremely slow) progress. Eventually some machines
seize up entirely.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) remove multiple size queues, introduced as a stopgap.
2) decouple pages containing data from their mappings
3) only keep buffers mapped when they actually have to be mapped
(right now, this is when buffers are B_BUSY)
4) New functions to make a buffer busy, and release the busy flag
(buf_acquire and buf_release)
5) Move high/low water marks and statistics counters into a structure
6) Add a sysctl to retrieve buffer cache statistics
Tested in several variants and beat upon by bob and art for a year. run
accidentally on henning's nfs server for a few months...
ok deraadt@, krw@, art@ - who promises to be around to deal with any fallout
|
|
|
|
| |
already have on in sched.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
code. At this moment all architectures get the copy of the old code
except i386 which gets a new shiny implementation that doesn't spin
at splhigh (doh!) and doesn't try to grab the biglock when releasing
the biglock (double doh!).
Shaves 10% of system time during kernel compile and might solve a few
bugs as a bonus.
Other architectures coming shortly.
miod@ deraadt@ ok
|
|
- Move the functionality of choosing a process from cpu_switch into
a much simpler function: cpu_switchto. Instead of having the locore
code walk the run queues, let the MI code choose the process we
want to run and only implement the context switching itself in MD
code.
- Let MD context switching run without worrying about spls or locks.
- Instead of having the idle loop implemented with special contexts
in MD code, implement one idle proc for each cpu. make the idle
loop MI with MD hooks.
- Change the proc lists from the old style vax queues to TAILQs.
- Change the sleep queue from vax queues to TAILQs. This makes
wakeup() go from O(n^2) to O(n)
there will be some MD fallout, but it will be fixed shortly.
There's also a few cleanups to be done after this.
deraadt@, kettenis@ ok
|