des [Thu, 11 Dec 2003 07:46:08 +0000 (07:46 +0000)]
Revert part of revision 1.74 after bde reminded me of a detail I'd
forgotten about how sysctl works. This removes a potential (though
not very likely) race that 1.74 introduced.
peter [Thu, 11 Dec 2003 04:47:53 +0000 (04:47 +0000)]
CACHE_LINE_SIZE is 64 on athlon and amd64 chips, not 32. This should
probably be 128 since that is what the hardware prefetch fill size is
on both the p3, p4 and athlon* cpus.
jeff [Thu, 11 Dec 2003 04:23:39 +0000 (04:23 +0000)]
- Don't let the pctcpu rate limiter throttle us if we have recorded over
SCHED_CPU_TICKS ticks. This was allowing processes to display
(1/SCHED_CPU_TIME * 100) % more cpu than they had used.
jeff [Thu, 11 Dec 2003 04:00:49 +0000 (04:00 +0000)]
- In sched_switch(), if a thread has been assigned, don't touch the runqueues
or load. These things have already been taken care of in sched_bind()
which should be the only place that we're switching in an assigned thread.
jeff [Thu, 11 Dec 2003 03:57:10 +0000 (03:57 +0000)]
- Add support for CPU groups to ule. All SMT cores on the same physical
cpu are added to a group.
- Don't place a cpu into the kseq_idle bitmask until all cpus in that group
have idled.
- Prefer idle groups over idle group members in the new kseq_transfer()
function. In this way we will prefer to balance load across full cores
rather than add further load a partial core.
- Before a cpu goes idle, check the other group members for threads. Since
SMT cpus may freely share threads, this is cheap.
- SMT cores may be individually pinned and bound to now. This contrasts the
old mechanism where binding or pinning would have allowed a thread to run
on any available cpu.
- Remove some unnecessary logic from sched_switch(). Priority propagation
should be properly taken care of in sched_prio() now.
jeff [Thu, 11 Dec 2003 03:48:31 +0000 (03:48 +0000)]
- Add the mp_topology() function to mp_machdep.c. This function builds up
the smp_topology structure to reflect the layout of HTT enabled machines.
- Add a prototype for mp_topology() in smp.h
peter [Thu, 11 Dec 2003 01:09:51 +0000 (01:09 +0000)]
Move the ia32_sigtramp.S file back under amd64/. This interfaces closely
with the sendsig code in the MD area. It is not safe to assume that all
the register conventions will be the same. Also, the way of producing
32 bit code (.code32 directives) in this file is amd64 specific.
peter [Thu, 11 Dec 2003 01:05:09 +0000 (01:05 +0000)]
Assimilate ia64 back into the fold with the common freebsd32/ia32 code.
The split-up code is derived from the ia64 code originally.
Note that I have only compile-tested this, not actually run-tested it.
The ia64 side of the force is missing some significant chunks of signal
delivery code.
peter [Wed, 10 Dec 2003 22:31:46 +0000 (22:31 +0000)]
The osigpending, oaccept, orecvfrom and ogetdirentries entries were
accidently being compiled in as standard. These are part of the
set of unimplemented COMPAT_43 syscall set.
des [Wed, 10 Dec 2003 22:11:51 +0000 (22:11 +0000)]
Fix a couple of issues in the interrupt code:
- Replace overly-complicated (and buggy) -a logic with a much simpler
version: -a causes all interrupts to be displayed, otherwise only
those that have occurred are displayed. This removes the need for
any MD code.
- Instead of just making sure intrcnt is large enough, figure out the
exact size it needs to be. We derive nintr from this number, and we
don't want to risk printing garbage. Note that on sparc64, we end up
printing garbage anyway because the names of non-existent interrupts
are left uninitialized by the kernel.
jhb [Wed, 10 Dec 2003 19:29:39 +0000 (19:29 +0000)]
Use NAPICID for the maximum number of local APICs rather than MAXCPU when
doing the HTT fixup. This is a step closer to possibly having an apic.ko
module someday.
rwatson [Wed, 10 Dec 2003 18:48:05 +0000 (18:48 +0000)]
interpvnodelabel can be NULL in mac_test_execve_transition(). This
only turned up when running mac_test side by side with a transitioning
policy such as SEBSD. Make the NULL testing match
mac_test_execve_will_transition(), which already tested the vnode
label pointer for NULL.
green [Wed, 10 Dec 2003 16:10:34 +0000 (16:10 +0000)]
Implement seeking to earlier offsets in gzipfs. This allows my loader
to e.g. correctly load all .ko.gz's I've tried, as opposed to messing
up trying to read section headers on some of them.
grehan [Wed, 10 Dec 2003 13:11:03 +0000 (13:11 +0000)]
PowerPC-conditional changes:
- include ashldi3.c/ashrdi3.c from libc for UFS 64-bit arith
- pull in syncicache.c from libc, and define _STANDALONE for
loader usage
grehan [Wed, 10 Dec 2003 09:16:22 +0000 (09:16 +0000)]
- Bring Makefile up to rev with sparc64 in terms of config options and rules
- Move loader relocation up to 0x1C00000. This is in line with OSX bootx,
and allows more space for boot-time modules/ramdisks without conflicting
with OpenFirmware's use of RAM
grehan [Wed, 10 Dec 2003 08:55:53 +0000 (08:55 +0000)]
- removed obsolete ppc_exit/ppc_boot functions
- OpenFirmware returns overlapping memory regions. Use a simple
brute force algorithm to merge these into non-overlapping
regions. This fixes bugs in reporting of available memory
and also prevents pages from being added twice in the VM system.
obrien [Wed, 10 Dec 2003 02:49:17 +0000 (02:49 +0000)]
Add just enough of i386/include/pcvt_ioctl.h to amd64/include/pcvt_ioctl.h
such that 'ispcvt' can build. Unforunately 'ispcvt' is needed in order for
/etc/rc.d/syscons to run. This fixes the bug where I could not get my
keymap effective at boot.
marcel [Wed, 10 Dec 2003 02:38:51 +0000 (02:38 +0000)]
Add a short description of the kse_switchin(2) syscall to the kse
manpage and add a kse_switchin link. While here, list kse_thr_interrupt
before kse_wakeup in the MLINKS variable and the synopsis.
marcel [Wed, 10 Dec 2003 01:59:23 +0000 (01:59 +0000)]
Write the thread pointer (val) in the kse mailbox (loc) before we
set the new context in kse_switchin(2). This allows us to return
an error to the calling context when the suword() fails.
deischen [Tue, 9 Dec 2003 23:40:27 +0000 (23:40 +0000)]
accept() returns a file descriptor when it succeeds which is very
likely to be non-zero. When leaving the cancellation point, check
the return value against -1 to see if cancellation should be
checked. While I'm here, make the same change to connect() just
to be consisitent.
jhb [Tue, 9 Dec 2003 21:14:31 +0000 (21:14 +0000)]
Adjust an assertion for the TDF_TSNOBLOCK race handling in
turnstile_unpend(). A racing thread that does not have TDI_LOCK set may
either be running on another CPU or it may be sitting on a run queue if it
was preempted during the very small window in turnstile_wait() between
unlocking the turnstile chain lock and locking sched_lock.
jhb [Tue, 9 Dec 2003 21:09:04 +0000 (21:09 +0000)]
Revert the previous race fix and replace it with a more general fix. The
case of a turnstile having no threads is just one instance of the more
general case where the thread we are examining has been partially awakened
already in that it has been removed from the turnstile's blocked list but
still has TDI_LOCK set. We detect that case by checking to see if the
thread has already had a turnstile reassigned to it.
mtm [Tue, 9 Dec 2003 11:20:01 +0000 (11:20 +0000)]
Take a stab at fixing some of the macro-nightmare.
PTHREAD_NEW_STATE should work as expected now: a thread
marked PS_RUNNING will get sent a SIGTHR.
Still more cleanups necessary.
mtm [Tue, 9 Dec 2003 11:12:11 +0000 (11:12 +0000)]
Fix the wrapper function around signals so that a signal handling
thread on one of the mutex or condition variable queues is removed
from those queues before the real signal handler is called.
marcel [Tue, 9 Dec 2003 09:52:14 +0000 (09:52 +0000)]
Don't panic for misalignment traps when the onfault handler is set.
Not all transfers between kernel and user space are byte oriented
and thus alignment safe. Especially fuword*() and suword*() are
sensitive to alignment but in general more optimal than block copies.
By catching the misalignment trap we avoid pessimizing the common
case of properly aligned memory accesses which we would do if we
were to use byte copies or adding tests for proper alignment.
Note that the expectation that the kernel produces aligned pointers
is unchanged. This change therefore relates to possible unaligned
pointers generated in userland.
mtm [Tue, 9 Dec 2003 08:51:11 +0000 (08:51 +0000)]
o Rename devfs_link() to make_symlink() and turn it into a generic
symlinking routine.
o Modify rc.d/jail to create its own symlink relative to the jail's
filesystem
marcel [Tue, 9 Dec 2003 08:35:17 +0000 (08:35 +0000)]
Fix the build of libski now that we use the "official" MADT table
definitions. Those are slightly different than the ones we used
before ACPI-CA 20031203 got imported. No structural or functional
change.
mtm [Tue, 9 Dec 2003 08:17:33 +0000 (08:17 +0000)]
If rc.d/mountcritlocal is unable to mount local filesystems,
then immediately terminate the shell (during boot this
also terminates the parent rc(8) shell). This was the pre-rcNG behaviour.
imp [Tue, 9 Dec 2003 07:41:07 +0000 (07:41 +0000)]
Older versions of the intersil firmware is a lot slower than newer
versions of the firmware. It responds more slowly to commands, and we
bogusly failed them. We assume that all versions of the intersil
firmware before 1.0 are 10 times slower and will give it 10x the time
to finish.