Commit Graph

1411 Commits

Author SHA1 Message Date
Tor Egge 882e68c8a9 sonewconn no longer passes curproc to the protocol attach method
since that might cause in_pcballoc to call MALLOC with M_WAITOK during
a software interrupt.
Reviewed by:	Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
1997-09-04 17:39:16 +00:00
Poul-Henning Kamp 4d1122bdd6 Revert to the previous hashing, double the hashtable size instead. 1997-09-04 08:24:44 +00:00
Poul-Henning Kamp fd9d9ff13e Hmm, this is hopefully better. 1997-09-03 13:29:41 +00:00
Poul-Henning Kamp 119b6f4cf2 Use 2^N hash sizes rather than primesize, this replaces a division
with an and. (Submitted by davidg)

Preemptively record ".." values.

Reviewed by:	phk
1997-09-03 09:20:17 +00:00
Poul-Henning Kamp 7cb22688e9 Revert the v_usecount handling in relation to VOP_INACTIVE. 1997-09-03 09:18:48 +00:00
Bruce Evans e4ba6a82b0 Removed unused #includes. 1997-09-02 20:06:59 +00:00
Bruce Evans 4d1d4912ae Added used #include - don't depend on <sys/mbuf.h> including
<sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).
1997-09-02 01:19:47 +00:00
Steve Passe 7245dff0f1 Cleanup. 1997-09-01 07:31:54 +00:00
Bruce Evans e28b96049b Move closer to supporting VM86 under SMP.
LINT now compiles but doesn't link.  Other link-time breakage for LINT
is now visible (SMP is incompatible with SIMPLELOCK_DEBUG).
Submitted by:	jlemon
1997-09-01 01:54:52 +00:00
Bruce Evans 6d58e6cbc4 Fixed options SHOW_BUSYBUFS and PANIC_REBOOT_WAIT_TIME which were broken
by incomplete cutting and pasting from machdep.c to kern_shutdown.c.

PR:		3953
1997-08-31 23:08:38 +00:00
Poul-Henning Kamp a051452ae2 Change the 0xdeadb hack to a flag called VDOOMED.
Introduce VFREE which indicates that vnode is on freelist.
Rename vholdrele() to vdrop().
Create vfree() and vbusy() to add/delete vnode from freelist.
Add vfree()/vbusy() to keep (v_holdcnt != 0 || v_usecount != 0)
  vnodes off the freelist.
Generalize vhold()/v_holdcnt to mean "do not recycle".
Fix reassignbuf()s lack of use of vhold().
Use vhold() instead of checking v_cache_src list.
Remove vtouch(), the vnodes are always vget'ed soon enough
  after for it to have any measuable effect.
Add sysctl debug.freevnodes to keep track of things.
Move cache_purge() up in getnewvnodes to avoid race.
Decrement v_usecount after VOP_INACTIVE(), put a vhold() on
  it during VOP_INACTIVE()
Unmacroize vhold()/vdrop()
Print out VDOOMED and VFREE flags (XXX: should use %b)

Reviewed by:		dyson
1997-08-31 07:32:39 +00:00
Steve Passe 2645264a72 Debug version of simple_lock. This will store the CPU id of the
holding CPU along with the lock.  When a CPU fails to get the lock
it compares its own id to the holder id.  If they are the same it
panic()s, as simple locks are binary, and this would cause a deadlock.

Controlled by smptests.h: SL_DEBUG, ON by default.

Some minor cleanup.
1997-08-31 03:17:48 +00:00
Steve Passe 78292efeef Another round of lock pushdown.
Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel.
UP kernel expects that this is enough to guarantee exclusive access to
regions of code bracketed by these 2 functions.
Add a simplelock to bracket clock accesses in clock.c: clock_lock.

Help from:	Bruce Evans <bde@zeta.org.au>
1997-08-30 08:08:10 +00:00
KATO Takenori 662f9a6987 Move MACHINE_ARCH definition from <machine/param.h> to <machine/cpu.h>.
Submitted by:	Bruce Evans <bde@zeta.org.au>
1997-08-30 02:52:04 +00:00
KATO Takenori 664f85174a Added a sysctl arg, hw.machine_arch. The hw.machine_arch is "ibm-pc"
on IBM-PC box and is "pc-98" on NEC PC-98 box.  Userland program can
distinguish architecture on which the program runs.
1997-08-29 09:03:40 +00:00
Jonathan Lemon 5f07393373 Remove the vm86 support as an LKM, and link it directly into the kernel
if 'options "VM86"' is in the config file.  The LKM was really for
development, and has probably outlived its usefulness.
1997-08-28 14:36:56 +00:00
Peter Wemm 90bcb528a8 Correct some things I forgot about until it was too late with smp_active.
smp_active = 1 used to indicate that the system had frozen previously
started AP's, while smp_active = 0 was "AP's not yet started".  I have split
this into smp_started (which is set when the AP's come online), and
smp_active is left for turning on/off AP scheduling.
1997-08-26 18:36:15 +00:00
Peter Wemm 9a3b3e8bce Clean up the SMP AP bootstrap and eliminate the wretched idle procs.
- We now have enough per-cpu idle context, the real idle loop has been
revived (cpu's halt now with nothing to do).
- Some preliminary support for running some operations outside the
global lock (eg: zeroing "free but not yet zeroed pages") is present
but appears to cause problems.  Off by default.
- the smp_active sysctl now behaves differently. It's merely a 'true/false'
option.  Setting smp_active to zero causes the AP's to halt in the idle
loop and stop scheduling processes.
- bootstrap is a lot safer.  Instead of sharing a statically compiled in
stack a number of times (which has caused lots of problems) and then
abandoning it, we use the idle context to boot the AP's directly.  This
should help >2 cpu support since the bootlock stuff was in doubt.
- print physical apic id in traps.. helps identify private pages getting
out of sync.  (You don't want to know how much hair I tore out with this!)

More cleanup to follow, this is more of a checkpoint than a
'finished' thing.
1997-08-26 18:10:38 +00:00
Bruce Evans d3114049c1 Restored rev.1.92 which was clobbered by the previous commit. 1997-08-26 11:59:20 +00:00
Poul-Henning Kamp 0fa2443f0e Uncut&paste cache_lookup().
This unifies several times in theory indentical 50 lines of code.

The filesystems have a new method: vop_cachedlookup, which is the
meat of the lookup, and use vfs_cache_lookup() for their vop_lookup
method.  vfs_cache_lookup() will check the namecache and pass on
to the vop_cachedlookup method in case of a miss.

It's still the task of the individual filesystems to populate the
namecache with cache_enter().

Filesystems that do not use the namecache will just provide the
vop_lookup method as usual.
1997-08-26 07:32:51 +00:00
John Dyson a5db4bf475 Back out some incorrect changes that was worse than the original bug. 1997-08-26 04:36:27 +00:00
Bruce Evans 7d7fb492c5 Don't return EINVAL for negative timespecs in the nanosleep functions.
Negative timespecs are perfectly valid.  Just return 0 immediately
for them.  Also, return 0 immediately for zero timespecs.

Fixed some style bugs.
1997-08-26 00:40:04 +00:00
Bruce Evans 8a2d9f5076 Finished staticizing. 1997-08-26 00:31:04 +00:00
Bruce Evans 9a629c9302 Fixed some formatting and style bugs.
Fixed a gratuitous ANSIism.
1997-08-26 00:24:25 +00:00
Bruce Evans 1d9655ae4d Print more info in the "calcru: negative time" message. 1997-08-26 00:20:11 +00:00
Bruce Evans eb776aea19 Fixed some gratuitous ANSIisms. 1997-08-26 00:15:04 +00:00
Bruce Evans 32545fd108 Removed some stale comments.
Fixed a gratuitous ANSIism.
1997-08-26 00:09:44 +00:00
Bruce Evans 282ec22c77 Removed redundant test against MAXDSIZ (the rlimit test is stronger). 1997-08-26 00:02:24 +00:00
Bruce Evans 2a2968a896 Removed a bogus comment. 1997-08-25 21:28:08 +00:00
Poul-Henning Kamp c049f06469 Add a new vnode op (cachedlookup) so that filesystems can plug into
a global vfs_cache check.  The rest of this change will come when the
current zero size file problem is resolved.
1997-08-25 20:28:49 +00:00
Steve Passe 8ee0110a44 A clean fix for the spl "deadlock before smp_active" problem.
Added a new variable, 'bsp_apic_ready', which is set as soon as the bootstrap
CPU has initialized its local APIC.  Conditionalize the GENSPLR functions
to call ss_lock ONLY after bsp_apic_ready is TRUE;  This should prevent
any problems with races between the time the 1st AP becomes ready and the
time smp_active is set.
1997-08-24 20:33:32 +00:00
Peter Wemm e384a9801e Print a warning if an unsupported (under SMP) shared address space fork
is attempted rather than just failing with an errno.
1997-08-22 15:10:00 +00:00
Poul-Henning Kamp 0e61ac7b5d typo in comment. 1997-08-22 07:16:46 +00:00
John Dyson 89721f6f1a This is a trial improvement for the vnode reference count while on the vnode
free list problem.  Also, the vnode age flag is no longer used by the
vnode pager.  (It is actually incorrect to use then.)  Constructive
feedback welcome -- just be kind.
1997-08-22 03:56:37 +00:00
Bruce Evans b1037dcd53 #include <machine/limits.h> explicitly in the few places that it is required. 1997-08-21 20:33:42 +00:00
Steve Passe fbca51f50a Added a half dozen casts to eliminate annoying warnings. 1997-08-21 06:39:41 +00:00
Philippe Charnier 40d5099441 Revert my previous commit about using CS_SECURE macro.
Requested by:	Bruce.
1997-08-21 06:33:04 +00:00
Steve Passe 4a73d99f7e Made PEND_INTS default.
Made NEW_STRATEGY default.
Removed misc. old cruft.

Centralized simple locks into mp_machdep.c
Centralized simple lock macros into param.h

More cleanup in the direction of making splxx()/cpl MP-safe.
1997-08-21 05:08:25 +00:00
John Dyson 745b842305 Some corrections to the anonymous page managment.
Submitted by:	Peter Chen <pmchen@eecs.umich.edu>
1997-08-21 01:35:37 +00:00
Steve Passe 7b185ef809 Preperation for moving cpl into critical region access.
Several new fine-grained locks.
New FAST_INTR() methods:
 - separate simplelock for FAST_INTR, no more giant lock.
 - FAST_INTR()s no longer checks ipending on way out of ISR.
sio made MP-safe (I hope).
1997-08-20 05:25:48 +00:00
Steve Passe 77625cfe0b Moved splq() to isa/ipl_funcs.c for SMP only.
This is in preperation for moving all cpl accesses behind a critical region lock.
1997-08-20 05:19:49 +00:00
Peter Wemm 1a5018a043 Implement XPG/SYSV-style getpgid()/getsid() syscalls. getpgid() uses the
same syscall number as NetBSD/OpenBSD.  The getpgid() came from NetBSD
(I think) originally, but it's basically cut/paste/edit from the other
simple get*() syscalls.
1997-08-19 06:00:27 +00:00
Peter Wemm 217cb20cdc Regenerate 1997-08-19 05:57:04 +00:00
Peter Wemm 6871cc6262 SVR4/XPG-style getpgid()/getsid() syscalls. 1997-08-19 05:53:48 +00:00
John Dyson 891e0f24c4 Allow lockmgr to work without a current process. Disallowing that
was a mistake in the lockmgr rewrite.
1997-08-19 00:27:07 +00:00
Philippe Charnier 15f3549108 Use CS_SECURE macro.
Reviewed by:	John Dyson
1997-08-18 06:58:59 +00:00
Steve Passe 7cbfd031b6 Added includes of smp.h for SMP.
This eliminates a bazillion warnings about implicit s_lock & friends.
1997-08-18 03:29:21 +00:00
John Dyson 03e9c6c101 Fix kern_lock so that it will work. Additionally, clean-up some of the
VM systems usage of the kernel lock (lockmgr) code.  This is a first
pass implementation, and is expected to evolve as needed.  The API
for the lock manager code has not changed, but the underlying implementation
has changed significantly.  This change should not materially affect
our current SMP or UP code without non-standard parameters being used.
1997-08-18 02:06:35 +00:00
Julian Elischer ff36905c57 Take verbal beating by wollman into account and fix DIAGNOSTIC test.
This version.
1/ avoids garret's introduced  potential page fault. (I got one)
2/ removes compiler warnings

Also fix the tunable scheduling quantum to return a better error code when
fed a bad argument.
1997-08-18 01:34:38 +00:00
Garrett Wollman fa5cde129b Delete a bit of debugging code that mistakenly crept in, and as a consequence
revert rev. 1.28's header file additions which are no longer needed.
1997-08-17 19:47:28 +00:00