Commit Graph

33462 Commits

Author SHA1 Message Date
tmm
13841bc271 Miscellaneous fixes:
- always reinitialize the rx descriptors, even if the mbuf is kept.
  This should fix the hangs on ifconfig that were observed
- on an rx overflow, reinitialize the descriptor so that the interface
  will not hang
- correct some bus_dmamap_sync() calls
- correct some debug messages
- some minor nits
2002-07-14 12:09:48 +00:00
kato
b095d5165e MFi386: sys/i386/i386/machdep.c revision 1.522. 2002-07-14 09:33:26 +00:00
julian
b443e6894a part of a greater patch set..
1/ don't need to set td_state to TDS_RUNNING in fork_return.
it's already set in choosethread().
2/ Set a child process state to "normal" as opposed to "new"
when we allow it to be put on the run queue.
Allows child to receive signals from the parent if the parent
runs first and tries to immediatly signal he child.

Submitted by:  (part 2)	Thomas Moestl <tmoestl@gmx.net>
2002-07-14 08:29:15 +00:00
imp
1f90b85e30 Rearrange previous commit that passed the vendor id to the kernel in a way
that's binary compatible for -stable.  While binary compatibility doesn't
matter much in -current, it is critical for -stable.  This change requires
pccardd/pccardc to be recompiled.
2002-07-14 06:47:52 +00:00
julian
d84464f213 Thinking about it I came to the conclusion that the KSE states were incorrectly
formulated.  The correct states should be:
IDLE:  On the idle KSE list for that KSEG
RUNQ:  Linked onto the system run queue.
THREAD: Attached to a thread and slaved to whatever state the thread is in.

This means that most places where we were adjusting kse state can go away
as it is just moving around because the thread is..
The only places we need to adjust the KSE state is in transition to and from
the idle and run queues.

Reviewed by:	jhb@freebsd.org
2002-07-14 03:43:33 +00:00
keramida
bbe7923a86 Typo: do do -> to do.
Reviewed by:	imp
2002-07-14 02:25:21 +00:00
julian
660340d306 oops, state cannot be two different values at once..
use || instead of &&
2002-07-14 01:36:48 +00:00
jake
fd7d3c2e28 Try both upa-portid and portid properties when finding the module id of a
secondary cpu.  Its called portid on UltraSPARCIII machines.
2002-07-14 00:08:58 +00:00
jake
04b64987c3 Remove debug code. 2002-07-14 00:01:16 +00:00
alc
5258ed77bb o Lock page queue accesses by vm_page_unmanage().
o Assert that the page queues lock is held in vm_page_unmanage().
2002-07-13 23:55:30 +00:00
bde
61e58ad58c Quick fix for high resolution kernel profiling on i386's. Use
-finstrument-functions instead of -mprofiler-epilogue.  The former
works essentially the same as the latter but has a higher overhead
(about 22 more bytes per function for passing unused args to the
profiling functions).

Removed all traces of the IDENT Makefile variable, which had been
reduced to just a place for holding profiling's contribution to CFLAGS
(the IDENT that gives the kernel identity was renamed to KERN_IDENT).
2002-07-13 22:28:34 +00:00
peter
de5af3fe19 Two invlpg's slipped through that were not protected from I386_CPU
Pointed out by:	dillon
2002-07-13 21:55:11 +00:00
peter
823051bf35 invlpg() does not work too well on i386 cpus. Add token i386 support
back in to the pmap_zero_page* stuff.
2002-07-13 21:03:08 +00:00
peter
33ec32bcbf Do global shootdowns when switching to/from 4MB pages. I believe we can
do a shootdown on a 4MB "page" though, but this should be safer for now.

Noticed by:  tegge
2002-07-13 20:58:56 +00:00
peter
995438bbe5 Bandaid for SMP. Changing APTDpde without a global shootdown is not
safe yet.  We used to do a global shootdown here anyway so another day
or so shouldn't hurt.
2002-07-13 20:56:18 +00:00
alc
828e129a10 o Complete the locking of page queue accesses by vm_page_unwire().
o Assert that the page queues lock is held in vm_page_unwire().
 o Make vm_page_lock_queues() and vm_page_unlock_queues() visible
   to kernel loadable modules.
2002-07-13 20:55:21 +00:00
alc
a23831a538 o Lock some page queue accesses, in particular, those by vm_page_unwire(). 2002-07-13 20:13:34 +00:00
alc
ee17f219fb o Lock some page queue accesses, in particular, those by vm_page_unwire(). 2002-07-13 19:48:54 +00:00
bde
d738702902 Moved the setting of all profiling-related variables except the key one
(PROFLEVEL) to kern.pre.mk so that it is easier to manage.  Bumped config
version to match.

Moved the check for cputype being configured to a less bogus place in
mkmakefile.c.
2002-07-13 19:36:14 +00:00
alc
ee4b41f6c5 o Lock some page queue accesses, in particular, those by vm_page_unwire(). 2002-07-13 19:24:04 +00:00
alfred
5d4d98d796 Remove incorrect comment about now corrected manpage. 2002-07-13 17:11:17 +00:00
alfred
b349285ecb Move COMPAT_FREEBSD4 to arch-neutral sys/conf/NOTES.
Add COMPAT_FREEBSD4 to GENERIC for arches that existed in FreeBSD 4's time,
not just i386. (alpha and pc98)

Requested by: bde
2002-07-13 16:43:53 +00:00
ume
cbc723a036 When usb is kld, ucom and uplcom were failed to load because of
usbd_abort_pipe undefined.
2002-07-13 10:41:35 +00:00
mikeh
f71c1e3952 Typo. 2002-07-13 07:21:53 +00:00
alc
93d5e16501 Lock accesses to the page queues. 2002-07-13 04:37:22 +00:00
mini
517fea87d5 Add prototype for cred_free_thread() when DIAGNOSTIC is defined. 2002-07-13 04:37:10 +00:00
mini
a02f691cf3 Add additional cred_free_thread() calls that I had missed the first time.
Pointed out by:	jhb
2002-07-13 04:36:50 +00:00
alc
41fc8114c0 o Lock accesses to the page queues.
o Add a comment explaining why hoisting the page queue lock outside
   of a particular loop is not possible.
2002-07-13 04:09:45 +00:00
jhb
11a8bfb923 - Change chroot_refuse_vdir_fds() to require that the passed in struct
filedesc is already locked rather than having chroot() unlock the
  filedesc so chroot_refuse_vdir_fds() can immediately relock it.
- Reorder chroot() a bitso that we do the namei lookup before checking
  the process's struct filedesc.  This closes at least one potential race
  and allows us to only acquire the filedsec lock once in chroot().
- Push down Giant slightly into chroot().
2002-07-13 04:07:12 +00:00
jake
eefbe93dbb Use a fixed address for KERNBASE, so it doesn't change if the size of KVA
is increased.  Its confusing for all the kernel addresses to change, and
doesn't serve much purpose as far as conserving address space.
2002-07-13 03:29:10 +00:00
jake
5d43846206 Identify UltraSPARC-III and UltraSPARC-III+ cpus. 2002-07-13 03:23:29 +00:00
jhb
389f048e62 We don't need to clear oldcred here since newcred is not NULL yet. 2002-07-13 03:13:15 +00:00
alc
5bc529bb34 Lock accesses to the page queues by sendfile() and friends. 2002-07-13 03:10:55 +00:00
alc
80b0a79553 o Assert GIANT_REQUIRED on system maps in _vm_map_lock(),
_vm_map_lock_read(), and _vm_map_trylock().  Submitted by: tegge
 o Remove GIANT_REQUIRED from kmem_alloc_wait() and kmem_free_wakeup().
   (This clears the way for exec_map accesses to move outside of Giant.
   The exec_map is not a system map.)
 o Remove some premature MPSAFE comments.

Reviewed by:	tegge
2002-07-12 23:20:06 +00:00
luigi
7cb243d2f4 Avoid dereferencing a null pointer in ro_rt.
This was always broken in HEAD (the offending statement was introduced
in rev. 1.123 for HEAD, while RELENG_4 included this fix (in rev.
1.99.2.12 for RELENG_4) and I inadvertently deleted it in 1.99.2.30.

So I am also restoring these two lines in RELENG_4 now.
We might need another few things from 1.99.2.30.
2002-07-12 22:08:47 +00:00
dillon
dc5d856e71 Re-enable the idle page-zeroing code. Remove all IPIs from the idle
page-zeroing code as well as from the general page-zeroing code and use a
lazy tlb page invalidation scheme based on a callback made at the end
of mi_switch.

A number of people came up with this idea at the same time so credit
belongs to Peter, John, and Jake as well.

Two-way SMP buildworld -j 5 tests (second run, after stabilization)
    2282.76 real  2515.17 user  704.22 sys	before peter's IPI commit
    2266.69 real  2467.50 user  633.77 sys	after peter's commit
    2232.80 real  2468.99 user  615.89 sys	after this commit

Reviewed by:	peter, jhb
Approved by:	peter
2002-07-12 20:17:06 +00:00
julian
c5495020cb also set the KSE state for the idle KSE/thread case. 2002-07-12 20:16:46 +00:00
trhodes
931ad6a4ff Fix a type: s/your are/you are/ 2002-07-12 19:56:31 +00:00
jhb
91bb8201ee Set the thread state of the newly chosen to run thread to TDS_RUNNING in
choosethread() in MI C code instead of doing it in in assembly in all the
various cpu_switch() functions.  This fixes problems on ia64 and sparc64.

Reviewed by:	julian, peter, benno
Tested on:	i386, alpha, sparc64
2002-07-12 18:34:22 +00:00
alc
19a21418a0 Lock accesses to the page queues. 2002-07-12 17:21:22 +00:00
tmm
0f5d0637f1 Fix ptrace(PT_READ_*, ...) for non-little-endian architectures where
sizeof(register_t) != sizeof(int).
2002-07-12 16:48:05 +00:00
tmm
b08811be07 When sending cache flushing IPIs, don't try to IPI the triggering CPU
itself; this causes undefined behaviour on UltraSPARCs. In particular,
the interrupt packet data words will not necessarily be delivered
correctly, which would result in a crash.
This bug also caused the cache-flushing work to be done twice on the
triggering CPU (when it did not cause crashes).

Reviewed by:	jake
2002-07-12 16:26:49 +00:00
truckman
90d4a243cd Back out the previous change, since it looks like locking udbinfo provides
sufficient protection.
2002-07-12 09:55:48 +00:00
peter
326ff2eb35 Be specific about which reason caused vm86_addpages to panic 2002-07-12 08:15:42 +00:00
truckman
eadeed2263 Lock inp while we're accessing it. 2002-07-12 08:05:22 +00:00
peter
4d88d6566a Revive backed out pmap related changes from Feb 2002. The highlights are:
- It actually works this time, honest!
- Fine grained TLB shootdowns for SMP on i386.  IPI's are very expensive,
  so try and optimize things where possible.
- Introduce ranged shootdowns that can be done as a single IPI.
- PG_G support for i386
- Specific-cpu targeted shootdowns.  For example, there is no sense in
  globally purging the TLB cache for where we are stealing a page from
  the local unshared process on the local cpu.  Use pm_active to track
  this.
- Add some instrumentation for the tlb shootdown code.
- Rip out SMP code from <machine/cpufunc.h>
- Try and fix some very bogus PG_G and PG_PS interactions that were bad
  enough to cause vm86 bios calls to break.  vm86 depended on our existing
  bugs and this was the cause of the VESA panics last time.
- Fix the silly one-line error that caused the 'panic: bad pte' last time.
- Fix a couple of other silly one-line errors that should have caused more
  pain than they did.

Some more work is needed:
- pmap_{zero,copy}_page[_idle].  These can be done without IPI's if we
  have a hook in cpu_switch.
- The IPI handlers need some cleanup.  I have a bogus %ds load that can
  be avoided.
- APTD handling is rather bogus and appears to be a large source of
  global TLB IPI shootdowns for no really good reason.

I see speedups of between 1.5% and ~4% on buildworlds in a while 1 loop.
I expect to see a bigger difference when there is significant pageout
activity or the system otherwise has memory shortages.

I have backed out a few optimizations that I had been using over the last
few days in order to be a little more conservative.  I'll revisit these
again over the next few days as the dust settles.

New option:  DISABLE_PG_G - In case I missed something.
2002-07-12 07:56:11 +00:00
alfred
44bbcfec60 regen for freebsd4_sendfile(2) compat. 2002-07-12 06:52:44 +00:00
alfred
598d9de715 Create a bug-for-bug FreeBSD4 compatible version of sendfile and move the
fixed sendfile over.  This is needed to preserve binary compatibility from
4.x to 5.x.
2002-07-12 06:51:57 +00:00
alfred
482e3b64c1 Introduce syscall.master option 'COMPAT4' which allows one to wrap
syscalls for FreeBSD 4 compatibility.
Add kernel option COMPAT_FREEBSD4 to enable these syscalls.
2002-07-12 06:38:34 +00:00
peter
576e9cfb99 Unexpand a couple of 8-space indents that I added in rev 1.285. 2002-07-12 04:58:51 +00:00