Commit Graph

1763 Commits

Author SHA1 Message Date
kleink 51be278873 Defopt COMPAT_M68K4K. 1999-03-09 21:02:38 +00:00
mycroft f3df26f6f3 This is sort of gratuitous, but...
Strip the leading path off of init's argv[0].
1999-03-05 07:26:21 +00:00
fvdl 31289a4af8 Fill in vnodecovered in the mount structure before calling VFS_MOUNT anyway,
some things (e.g. unionfs) may depend on it. It's currently ok
for vnodecovered to be set already; it's not for v_mountedhere in
the vnode, though.

From John Darrow.

XXX should probably just extend VFS_MOUNT to take the vnode pointer as
an argument.
1999-03-02 07:47:49 +00:00
ross e47e3c9f45 schedclk() -> schedclock(), for consistency with hardclock(), statclock(), ...
update comments for recent scheduler mods
1999-02-28 18:14:57 +00:00
fvdl c0fb2ab4f2 Use a SETRECURSE lock before calling VFS_MOUNT in the mount() system call,
since the lock may be taken again. This was the intention of the CANRECURSE
lock already there, but didn't work.

Only fill in the vnode<->mountpoint links (mountedhere and vnodecovered)
after VFS_MOUNT returned succesfully. It might happen that something called
from VFS_MOUNT mistook the vnode for an already successfully mounted on
one because of this.
1999-02-28 14:12:54 +00:00
fvdl 080ad305ff Recursive locks were previously only available with LK_CANRECURSE. This
could be done in one of 2 ways:

	* call lk_init with LK_CANRECURSE, resulting in a lock that
 	  always can be used recursively.
	* call lockmgr with LK_CANRECURSE, meaning that it's ok if this
	  lock is already held by us.

Sometimes we need a locking type that says: take this lock now, exclusively,
but while I am holding it, I may go through a code path which could attempt
to get the lock again, and which is unaware that the lock might already
be taken.  Implement LK_SETRECURSE for this purpose. Assume that locks and
unlocks come in matching pairs (they should), and check for this 'level'
using SETRECURSE locks.
1999-02-28 14:09:15 +00:00
wrstuden 0078fc50dc Modify VOP_CLOSE vnode op to always take a locked vnode. Change vn_close
to pass down a locked node. Modify union_copyup() to call VOP_CLOSE
locked nodes.

Also fix a bug in union_copyup() where a lock on the lower vnode would
only be released if VOP_OPEN didn't fail.
1999-02-26 23:38:55 +00:00
christos 88162a0fe9 Make this compile without EXEC_AOUT and with COMPAT_FREEBSD 1999-02-23 18:19:29 +00:00
mycroft d4955ba8a9 While I'm on a fixed point kick, improve the NTP clock factor correction to
give <.1% error in all (supported) cases.  It doesn't cost us much.
1999-02-23 17:41:48 +00:00
ross 6803dbddbb Replace the recent scheduler mods with calls to scheduler_{fork,wait}_hook(),
(inlined) so scheduler functionality can be kept in a single .h/.c set.
Also, the wait hook has changed the way it clips the scheduler history.
1999-02-23 02:57:18 +00:00
ross b4a33c4e60 Scheduler bug fixes and reorganization
* fix the ancient nice(1) bug, where nice +20 processes incorrectly
  steal 10 - 20% of the CPU, (or even more depending on load average)
* provide a new schedclk() mechanism at a new clock at schedhz, so high
  platform hz values don't cause nice +0 processes to look like they are
  niced
* change the algorithm slightly, and reorganize the code a lot
* fix percent-CPU calculation bugs, and eliminate some no-op code

=== nice bug === Correctly divide the scheduler queues between niced and
compute-bound processes. The current nice weight of two (sort of, see
`algorithm change' below) neatly divides the USRPRI queues in half; this
should have been used to clip p_estcpu, instead of UCHAR_MAX.  Besides
being the wrong amount, clipping an unsigned char to UCHAR_MAX is a no-op,
and it was done after decay_cpu() which can only _reduce_ the value.  It
has to be kept <= NICE_WEIGHT * PRIO_MAX - PPQ or processes can
scheduler-penalize themselves onto the same queue as nice +20 processes.
(Or even a higher one.)

=== New schedclk() mechansism === Some platforms should be cutting down
stathz before hitting the scheduler, since the scheduler algorithm only
works right in the vicinity of 64 Hz. Rather than prescale hz, then scale
back and forth by 4 every time p_estcpu is touched (each occurance an
abstraction violation), use p_estcpu without scaling and require schedhz
to be generated directly at the right frequency. Use a default stathz (well,
actually, profhz) / 4, so nothing changes unless a platform defines schedhz
and a new clock.  Define these for alpha, where hz==1024, and nice was
totally broke.

=== Algorithm change === The nice value used to be added to the
exponentially-decayed scheduler history value p_estcpu, in _addition_ to
be incorporated directly (with greater wieght) into the priority calculation.
At first glance, it appears to be a pointless increase of 1/8 the nice
effect (pri = p_estcpu/4 + nice*2), but it's actually at least 3x that
because it will ramp up linearly but be decayed only exponentially, thus
converging to an additional .75 nice for a loadaverage of one. I killed
this, it makes the behavior hard to control, almost impossible to analyze,
and the effect (~~nothing at for the first second, then somewhat increased
niceness after three seconds or more, depending on load average) pointless.

=== Other bugs === hz -> profhz in the p_pctcpu = f(p_cpticks) calcuation.
Collect scheduler functionality. Try to put each abstraction in just one
place.
1999-02-23 02:56:03 +00:00
drochner 220b8d9add PR kern/7033 (Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>): use
device minor to unit/partition macros from sys/disklabel.h
1999-02-22 16:00:01 +00:00
cjs d390501801 Safer use of printf. 1999-02-22 00:12:36 +00:00
mycroft bb815bda9e Fix a thinko in the previous.
Also:
* Do the boundary check when creating a new region as well.
* If we crossed the boundary, don't just throw away the region; lop off the
  beginning and see if we still fit.
SB16 is now fully functional on the Alpha.
1999-02-18 18:52:29 +00:00
mycroft ca00239fe9 Speed up the calculation of dontcross; use EXTENT_ALIGN to calculate it
directly rather than using a loop.  Also adjust so that we can allocate at
the end of the integer range.
1999-02-18 18:13:50 +00:00
christos 1aede0624c Now that shell has been fixed so that ". filename" does not look at . if .
is not in the path add ./ to the files.
1999-02-17 18:17:10 +00:00
christos ac66b8f92d Don't forget to lower the spl in the error case of sigprocmask 1999-02-13 15:25:51 +00:00
veego 8b48b6c4af Protect the COMM variable with an '.ifmake tags' to stop the long delay
while doing a make in src/sys/arch/* on slow machines.
1999-02-12 19:52:30 +00:00
cjs 1caabb110e Don't hardware /sys, use $SYSDIR if it exists. This should still be looked
at, though; should we be using relative paths instead?
1999-02-12 04:58:18 +00:00
thorpej 94962b67c7 Fix some printf format problems on Alpha. 1999-02-12 00:46:11 +00:00
christos be58edf2b6 Add compat_aout bit. 1999-02-11 09:35:21 +00:00
christos 7f718b612a Print the line that caused the error message. Unfortunately the line
numbers reported by awk are not useful, because the \$ preprocessing
by sed...
1999-02-11 09:32:01 +00:00
kleink 5dfcd3c125 Regen: socklen_t changes. 1999-02-10 18:05:24 +00:00
explorer c3167035de no need to set tailp twice. 1999-02-10 18:03:05 +00:00
kleink dfffb2f357 * Due to addition and use of socklen_t, make the socket option and address
arguments passed to accept(), bind(), connect(), getpeername(), getsockname(),
getsockopt(), recvfrom(), sendto() and sendmsg() unsigned, which also elimiates
a few casts.
* Reflect the (now) signedness of msg_iovlen, which necessiates the addition
of a few casts.
1999-02-10 18:02:28 +00:00
kleink f69591d12d Use of casts as lvalues is a GNU C extension; rearrange slightly. 1999-02-10 17:03:26 +00:00
christos fe1f028894 PR/6962: Paul Shupak: FreeBSD elf support. 1999-02-09 20:35:04 +00:00
wrstuden d0ab43c887 Oops. Need to have VOP_LOCK before calling uvm_vnp_terminate, not after
(comments and code inspection in uvm_vnp_terminate agree on this).
1999-02-09 01:57:05 +00:00
jonathan c9d036d796 defopt MEMORY_DISK_{HOOKS,SERVER,IS_ROOT}. 1999-02-07 09:34:58 +00:00
explorer 47bc7c51b7 rewrite usage of tailp slightly, to convince gcc that it really isn't used
initialized.
1999-02-06 11:57:35 +00:00
msaitoh de35d7228d fix compiler warning 1999-02-03 01:16:20 +00:00
msaitoh a01e3cd255 Implement [v]snprintf() 1999-01-28 00:05:49 +00:00
drochner 846db6691a make console_debugger() a macro - no need to waste a stackframe 1999-01-26 17:05:41 +00:00
kleink 88cb9dd89c Adapt the System V behaviour of a child process inheriting its parent's
ucontext link but still reset it on exec().
1999-01-25 16:00:06 +00:00
sommerfe 31a1ef68c7 Tweak to earlier fix to p_estcpu:
- no longer conditionalized
	- when traced, charge time to real parent, not debugger
	- make it clear for future rototillers that p_estcpu should be moved
	  to the "copy" region of struct proc.
1999-01-23 22:23:19 +00:00
sommerfe 068dd91745 Under control of "slowchild" global, make child process inherit the
scheduling penalty for being cpu-bound (p_estcpu) of its parent.
1999-01-23 17:02:35 +00:00
ross d8d8301934 Fix the recently infamous "sucky performance" problem by charging wait(2)'ing
parents for children's p_estcpu. I think this problem has always been there.
It's particularly noticable with X because the server builds up non-trivial
CPU, and hence, non-trivial p_estcpu scheduler penalty. The repeatedly
forked children were always starting from scratch and receiving a scheduler
preference.
1999-01-23 08:25:36 +00:00
kleink fe2f7c1f64 Indentation nit. 1999-01-22 20:51:04 +00:00
chs 3bd133da7d no need to do locking in extext_destroy(). 1999-01-22 07:57:59 +00:00
chs 5819a5d0f4 fix an off-by-one space-waster in hashinit() and add some description. 1999-01-22 07:57:13 +00:00
chs 254ae63e2c avoid math on void *. 1999-01-22 07:55:49 +00:00
chs 33c042b6a2 print a little more info in simple_lock_freecheck(). 1999-01-22 07:55:17 +00:00
mycroft 808496666c Do remove sockets on so_q0, since select(2) and accept(2) do not (currently?)
return them.
1999-01-21 22:09:10 +00:00
christos 198f0a3f56 Fix initialization of resource limits for number of files and number
of processes:
- Don't initialize rlim_max to RLIM_INFINITY. The limits for those should
  be maxfiles and maxproc respectively. Programs expect getrlimit to
  return reasonable values, so that they can allocate structures (for
  example jdk does this).
- Don't initialize rlim_cur to NOFILE and MAXUPRC respectively, but to
  min(NOFILE, maxfiles) and min(MAXUPRC, maxproc) respectively.
1999-01-21 14:50:41 +00:00
mycroft 0fb75f560a Oops; previous was slightly broken. 1999-01-20 20:24:12 +00:00
mycroft 430ecf369d Do not remove sockets from the accept(2) queue on close. 1999-01-20 09:15:41 +00:00
chuck 4ef779d5e5 MNN is no longer optional 1999-01-16 21:06:44 +00:00
sommerfe 324ea43975 Fix format mismatch which only turns up when building with DEBUG 1999-01-15 22:02:59 +00:00
thorpej 54cabada51 Garbage-collect some straggling netimp stuff. 1999-01-14 01:14:01 +00:00
sommerfe 114c430bbb Allow lkm's to include symbols for use by DDB. 1999-01-13 23:06:28 +00:00