Commit Graph

2319 Commits

Author SHA1 Message Date
enami 08810e4e74 Make this file compile again. 2000-11-02 06:57:01 +00:00
eeh d85adca51f Make line disciplines modular so they can be added or removed dynamically. 2000-11-01 23:51:38 +00:00
he a08889417a Use an rlim_t to store "available memory", so we don't needlessly
overflow and/or sign extend.
2000-10-29 18:38:47 +00:00
christos 0628f0a87e knf [from charles] 2000-10-17 23:38:55 +00:00
christos 23c15f1578 Don't set P_SUGID if the calls to set{e,}{u,g}id(), setreuid(),
setgroups() did not result in actual changes. This has the nice
side effect that we don't needlesly allocate new credential and
resource limit data structures.

This is so that non setuid programs that call seteuid(getuid()),
don't end up setting P_SUGID, resulting in broken behavior [i.e.
non setuid ssh, doesn't read ~/.hostaliases...].

This is a good candidate for a pullup, if someone reviews it.
2000-10-17 20:53:45 +00:00
itojun da566268df attach ARP domain only if INET is compiled into the kernel. 2000-10-02 04:27:21 +00:00
ad 50cf734d26 (*minphys)() musn't return zero. 2000-09-29 13:27:12 +00:00
eeh 1ecf6779be Add support for variable end of user stacks needed to support COMPAT_NETBSD32:
`struct vmspace' has a new field `vm_minsaddr' which is the user TOS.

	PS_STRINGS is deprecated in favor of curproc->p_pstr which is derived
	from `vm_minsaddr'.

	Bump the kernel version number.
2000-09-28 19:05:06 +00:00
enami 656bf989ab Factor out common code to manupilate file flags into separate function
like others do.
2000-09-28 06:43:20 +00:00
thorpej 69d28474b7 PHOLD/PRELE around uvm_io() to user address space is unnecessary. There
is nothing in the U-area that we need.
2000-09-26 23:59:23 +00:00
erh 3392996d23 Prevent ptrace on system processes. Avoids panic when attempting to ptrace pid 0, which has no parent. 2000-09-24 07:31:28 +00:00
bjh21 cf9703617a Conditionalise the declaration of sysctl_pty() so that we don't get a
compiler warning in the NPTY==0 case.
2000-09-23 11:33:05 +00:00
enami 6cf8248614 Stop runnable but swapped out user processes also in suspendsched(). 2000-09-23 01:00:35 +00:00
enami 25ea453471 Pathname of length 1023 (MAXPATHLEN - 1) should be valid as corename. 2000-09-23 00:48:29 +00:00
eeh ef06aa4d68 Fix unbalanced #endif. 2000-09-22 01:37:27 +00:00
eeh 3ec2906321 The files "kbd.h" and "ms.h" are defined in sys/dev/sun/files.sun. Only
include them for ports that are likely to use the Sun line disciplines.
2000-09-22 01:24:07 +00:00
eeh 9220a0cf6b Sun Keyboard/Mouse line discipline support. 2000-09-21 23:31:14 +00:00
bjh21 1f4240a461 Extend NFS_V2_ONLY to remove NQNFS lease support as well. Saves another 10k. 2000-09-19 23:26:25 +00:00
fvdl a6a5e6cca7 Adapt for VOP_FSYNC parameter change.
Small optimization to shutdown code: only take the syncer lock if
the FS actually used it.
2000-09-19 22:01:41 +00:00
fvdl 8c28d7e864 Adapt for VOP_FSYNC parameter change. 2000-09-19 22:00:01 +00:00
fvdl 9d8dbdad9a Regen. 2000-09-19 21:58:01 +00:00
fvdl bf60f8be2e Add start and end parameters to the fsync VOP, giving a range of the
file to write out. If both are 0, the whole file is synced. A filesystem
that is not able to sync out a range of a file may elect to sync
the whole file anyway.
2000-09-19 21:57:14 +00:00
enami 48b7bc7f16 The struct prochd isn't a proc. Start scaning from prochd.ph_link instead
of &prochd.
2000-09-15 06:36:25 +00:00
thorpej 03810b147f Make sure to lock the proclist when we're traversing allproc. 2000-09-14 19:13:29 +00:00
thorpej e3d2277d32 Regen: VNODE_OP_NOINLINE vs. LKM. 2000-09-13 16:09:52 +00:00
thorpej 7f3e4b0331 If building an LKM, always cause it to use the non-inline version
of the vnode ops, and if LKM support is included in the kernel,
always include the non-inline stubs regardless of whether or not
they're being used in the static kernel iamge.
2000-09-13 16:09:27 +00:00
thorpej 5d879e9012 Regen for VNODE_OP_NOINLINE. 2000-09-13 15:51:19 +00:00
thorpej 9d482308b1 Allow the VOP_*() calls to be un-inlined with the VNODE_OP_NOINLINE
kernel option.  Saves 36k of kernel text on an i386 GENERIC.  Useful
for install media kernels, small memory systems, embedded systems.
2000-09-13 15:50:26 +00:00
thorpej 72a24b4eae Add an align argument to uvm_map() and some callers of that
routine.  Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
2000-09-13 15:00:15 +00:00
thorpej e0797e1775 Fix 0 vs. NULL confusion. 2000-09-11 18:45:29 +00:00
pk 13275642e0 make compile #if LOCKDEBUG is on. 2000-09-11 13:51:29 +00:00
jdolecek ae3a3247bb handle KERN_MAXPTYS via new sysctl_pty(), which uses pty_maxptys() provided
by tty_pty.c
2000-09-10 17:29:50 +00:00
jdolecek 9bdbbbc834 change DEFAULT_MAXPTYS to 256
make all local variables static
use simplelocks - we really need only mutexes, full locks are not necessary
update couple of comments to be more accurate

add function pty_maxptys(), which provides a safe way to get&set maxptys - this
	also supports setting maxptys to lower than current value, if the
	value is lower or equal current number of ptys
2000-09-10 17:26:45 +00:00
jdolecek 1ef0c139f9 allocate pty kernel structures on demand at run-time - this allows
to support arbitrary number of ptys without need of kernel recompile
(the extra device special files in /dev/ still need to be created, of course)

upper limit of supported ptys is controlled via new sysctl variable
kern.maxptys (KERN_MAXPTYS), which is raise-only and defaults to 512.
2000-09-09 16:42:04 +00:00
sommerfeld c9febd72cb Lock scheduler before putting new proc on run queues. 2000-09-06 14:06:42 +00:00
bouyer ca5824ec3b Implement suspendsched() by putting all sleeping and runnable processes
in SSTOP state, execpt P_SYSTEM and curproc processes. We have to way to
find the original state of the process so we can't restart scheduling,
so this can only be used at shutdown time.

XXX suspendsched() should also deal with processes running on other CPUs.
I don't know how to do that, and as long as we have a kernel big lock,
this shouldn't be a problem.
2000-09-05 16:27:51 +00:00
bouyer aacf1f7a6a Back out the suspendsched()/resumesched() thing, per request of Jason Thorpe &
Bill Sommerfeld. suspendsched() will be implemented in a different way.
2000-09-05 16:20:27 +00:00
enami 445cbcb8c1 Accquire vnode interlock while playing with flags to see if there
is someone waiting this vnode.
2000-09-05 05:13:43 +00:00
bouyer 6720d310ef wakeup()->sched_wakeup() 2000-09-01 17:14:04 +00:00
bouyer efc4435cb3 in vfs_shutdown(), use sched_suspend() to suspend scheduling, and use
tsleep() instead of DELAY. Also, keep trying flushing buffers when the
number of dirty buffers decreases (20 rounds may not be enouth for a
very large buffer cache).

Using tsleep instead of delay gives a chance to others kernel threads to run,
which is needed for raidframe. With this change I've not been able to
reproduce the 'dirty buffer not flushed' problem with raidframe.
2000-08-31 14:41:35 +00:00
bouyer 629150f864 Add the sched_suspend/sched_resume functions, as discussed on tech-kern,
with the following modifications to the initial patch:
- rename SHOLD and P_HOST to SSUSPEND and P_SUSPEND to avoid confusion with
  PHOLD()
- don't deal with SSUSPEND/P_SUSPEND in fork1(), if we come here while
  scheduler is suspended we're forking proc0, which can't have P_SUSPEND set.

sched_suspend() suspends the scheduling of users process, by removing all
processes from the run queues and changing their state from SRUN to
SSUSPEND. Also mark all user process but curproc P_SUSPEND.
When a process has to be put in SRUN and is marked P_SUSPEND, it's placed in
the SSUSPEND state instead.
sched_resume() places all SSUSPEND processes back in SRUN, clear the P_SUSPEND
flag.
2000-08-31 14:36:19 +00:00
jhawk a022cf9d37 Use
${MAKE}
instead of
  make
2000-08-30 23:51:46 +00:00
sommerfeld 1cbfb08951 Fix !LOCKDEBUG && !DIAGNOSTIC case 2000-08-28 21:07:52 +00:00
sommerfeld bdc30aed03 Since the spinlock count is per-cpu, we don't need atomic operations
to update it, so don't bother with <machine/atomic.h>

Flush kernel_lock_release_all() and kernel_lock_acquire_count() (which
didn't do spinlock accounting correctly), and replace them with
spinlock_release_all() and spinlock_acquire_count().
2000-08-26 19:26:43 +00:00
thorpej fe036cae9a Fix a printf format (for Alpha). 2000-08-26 17:02:16 +00:00
sommerfeld 340951f9d1 On second thought.. pass cpu_info * to roundrobin() explicitly. 2000-08-26 04:01:16 +00:00
sommerfeld ec08310fab More MP clock/scheduler changes:
- Periodically invoke roundrobin() from hardclock() on all cpu's rather
than from a timer callout; this allows time-slicing on non-primary cpu's.
 - Make pscnt per-cpu.
 - Notice psdiv changes on each cpu, and adjust pscnt at that point.
Also, invoke setstatclockrate() from the clock interrupt when each cpu
notices the divisor change, rather than when starting/stopping the
profiling clock.
2000-08-26 03:34:36 +00:00
sommerfeld 392f867be8 MULTIPROCESSOR: Initialize new proc's p_cpu pointer to NULL, so
anything which looks at it before it runs won't explode.
2000-08-25 02:55:49 +00:00
thorpej 4db6fc7542 Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity.  Its use in
roundrobin() still needs some work.
2000-08-25 01:04:06 +00:00
thorpej 4f944290a2 Correct a comment. 2000-08-24 06:14:34 +00:00