Commit Graph

2798 Commits

Author SHA1 Message Date
thorpej d100f2ae43 Put back pool_prime(); the i386 mp pmap uses it. 2002-03-09 18:06:54 +00:00
bjh21 dca4ae94d6 When checking that a potentially-unsigned enum is >= 0, assign it to an int
first.  This is necessary to avoid warnings with -fshort-enums.  Casting
to an int really should be enough, but turns out not to be.

This change will be documented in doc/HACKS.
2002-03-09 13:22:52 +00:00
thorpej 59a96297ef Fix a couple of typos in simple_{,un}lock()'s. 2002-03-09 05:14:33 +00:00
thorpej c4a2ca6a3e Remove pool_prime(). Nothing uses it, and how it should be used it not
really well-defined in the absense of PR_STATIC.
2002-03-09 01:56:27 +00:00
thorpej e21319b482 Make mbpool and mclpool use the new drain hook facaility. Adjust
m_reclaim() to match the drain hook signature.  This allows us to
delete m_retry() and m_retryhdr(), as the pool allocator will now
perform the reclaimation step for us.

From art@openbsd.org.
2002-03-09 01:46:32 +00:00
thorpej 4be86fcc13 If, when a page becomes idle, the backend allocator is waiting for
resources, release the page immediately, rather than letting it sit
around cached.

From art@openbsd.org.
2002-03-09 01:37:19 +00:00
thorpej d54150e78a Remove PR_MALLOCOK and PR_STATIC. The former wasn't actually used,
and the latter, while there was some code tested the bit, was woefully
incomplete and also unused by anything.  Besides, PR_STATIC functionality
could be better handled by backend allocators anyhow.

From art@openbsd.org
2002-03-09 01:33:33 +00:00
thorpej ce635a702a Add a missing simple_unlock. 2002-03-08 21:43:54 +00:00
thorpej 8cdc6121b7 Add an optional "drain" client callback, which can be set by the new
pool_set_drain_hook().  This hook is called in three cases:
* When a pool has hit the hard limit, just before either erroring
  out or sleeping.
* When a backend allocator fails to allocate memory.
* Just before trying to reclaim pages in pool_reclaim().

This hook requests the client to try and free some items back to
the pool.

From art@openbsd.org.
2002-03-08 21:41:59 +00:00
thorpej 7c94c68f10 Remove PR_FREEHEADER; nothing uses it anymore.
From art@openbsd.org.
2002-03-08 20:51:25 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
nathanw 3f0d660168 Make the debugging printfs compile:
- printf format checking doesn't like %x for pointers; use %p like we should.
 - LP64 fixes.
2002-03-05 23:28:58 +00:00
simonb bc7301d415 nlinesw is already declared in <sys/conf.h>. 2002-03-04 02:32:58 +00:00
simonb 8ecad242b9 Use <sys/disk.h> for the prototype of disk_init() rather than declaring
our own locally.
2002-03-04 02:30:27 +00:00
simonb 9a942a34e0 Don't use local extern declarations for the mountroot variable or
declare local prototypes for nfs_mountroot() or md_root_setconf().
2002-03-04 02:25:21 +00:00
mrg d3b3f3e560 move the COMPAT_SUNOS TIOCGPGRP handling in the compat sunos code proper.
this is the final fix needed for it to run properly as an LKM.  no more
COMPAT_SUNOS hacks around the tree!
2002-03-02 12:30:43 +00:00
thorpej 92eb54d5a5 Don't assign NULL to non-pointer variables. 2002-02-28 04:43:16 +00:00
manu 89e46d8a99 Reworked the o32/n32 matching scheme. IRIX uses some e_flags in the ELF
header to distinguish between o32, n32 and n64 ABIs. We now use this.
This suppress the need of the mips_option test, which had some fake positive.
This also removes the mandatory ordering of n32 vs o32 in the exec switch
(exec_conf.c)
2002-02-21 21:53:00 +00:00
christos 8ec87caa7f ICANON is in lflags, by Neelkanth Natu 2002-02-17 19:34:42 +00:00
enami 3528e53ca0 Use sizeof correctly. Fixes PR#15613. 2002-02-16 02:11:43 +00:00
enami 233c254079 - Wrap long line.
- Remove unnecessary semi-colon.
2002-02-16 02:07:56 +00:00
simonb 14ac06f0bd Add a "show event" ddb command to show the event counters. 2002-02-15 11:18:26 +00:00
chs b744097a5f allow writing to write-only mappings. fixes PR 3493. 2002-02-14 07:08:02 +00:00
thorpej daaeb3910f const char *mclpool_warnmsg -> const char mclpool_warnmsg[]
Noted by Matt Thomas.
2002-02-12 00:52:33 +00:00
jdolecek 5798a9a710 Switch default for pipes to the faster John S. Dyson's implementation.
Old, socketpair-based ones are available with option PIPE_SOCKETPAIR.
2002-02-11 18:11:41 +00:00
chs 9784635eb6 getblk()'s "block size invariant" isn't valid for VBLK vnodes
since bounds_check_with_label() will truncate a buffer that crosses
the end of the partition.  adjust the assertion to account for this.
fixes PRs 7938, 12156, 12698, 13076, 13210 and 13288.
2002-02-10 23:14:18 +00:00
bouyer 149c671b66 extent_alloc_subregion1(): when a candidate region doesn't fit after being
rounded up to respect boundary limits, adjust newstart and last before
skiping to the next region. Otherwise we may check the same candidate
region against the start of the next region, no the one immediatly following
the hole, leading to corrupted map.

This fixes the panic seen on sparc64 with scsi drivers, and probably fixes
PR 15489.
2002-02-09 01:00:09 +00:00
christos 980af1007c Andrew Brown found that we overflowed all cases in the TTLINEDNAMELEN.
ouch.
2002-02-08 18:36:53 +00:00
thorpej 7380aa1467 Add a "ddb" command (if DDB is configured into the kernel) for
easy, convenient dropping into DDB at the "root device: " prompt.
Useful if your console can't do it w/o actually taking an interrupt
and you want to, say, look at the boot messages.
2002-02-08 00:58:58 +00:00
chs 90503a3cda add an assert (hopefully to find where we recycle vnodes without
freeing all the pages, like I've seen recently).
2002-02-05 07:50:58 +00:00
tls eeda20f137 Kick DEFAULT_MAXPTYS from 256 to 992 2002-02-02 07:18:55 +00:00
kleink 12135360cf fcntl(..., F_GETOWN, ...): fix LP64-BE bug; raised by der Mouse
on tech-kern.
2002-01-31 22:17:33 +00:00
kleink 935d56d508 Add {POSIX_MONOTONIC_CLOCK} variables. 2002-01-31 00:32:47 +00:00
simonb 346fc0519d Implement the CLOCK_MONOTONIC clock for the posix/opengroup realtime
clock_() functions.  This simply returns the kernel mono_time variable.
As discussed on tech-kern.
2002-01-31 00:13:07 +00:00
thorpej 07d023a3aa Define ELF32_EHDR_FLAGS_OK()/ELF64_EHDR_FLAGS_OK() and use it
as an added measure to make sure that we can execute a binary.
These default to (1) if elf_machdep.h does not override them.

On Sun2, ELF32_EHDR_FLAGS_OK() checks for the presense of EF_M68000,
since the 68010 cannot run binaries for the 68020-and-up.
2002-01-28 22:15:54 +00:00
simonb 4aceab2a3d Remember to update the "size copied" counter in sysctl_diskstats(). 2002-01-28 03:33:55 +00:00
simonb 9e42930807 Use TAILQ_FOREACH(). 2002-01-28 03:12:13 +00:00
simonb bfc71f3c10 Add sysctls to read tk_{nin,nout,cancc,rawcc} (under a kern.tkstat node).
"extern" those variables in <sys/dkstat.h>, and add declarations for them
in sys/tty.c
2002-01-28 02:06:02 +00:00
lukem fea75ff830 - kern.maxvnodes: only call vfs_reinit() and nchreinit() if the value
was successfully changed.  previously, successfully viewing the
  current value would flush the cache :-/
- similarly, don't change hostid and sb_max unless the value was
  successfully changed
2002-01-27 13:33:36 +00:00
simonb ed6b438e40 Implement the hw.disknames and hw.diskstats sysctl's that have been listed
in <sys/sysctl.h> since day one but never implemented.
2002-01-27 12:41:07 +00:00
christos 83990b1879 Clear the P_INEXEC flag in other labels. Pointed out by he@netbsd.org 2002-01-12 14:20:30 +00:00
christos d4e7e4c9c4 Fix a ptrace/execve race that could be used to modify the child process's
image during execve. This is a security issue because one can
do that to setuid programs... From FreeBSD.
2002-01-11 21:16:27 +00:00
manu 4398be0cfc Added code to correctly match and launch o32 and n32 IRIX binaires (note that
there is n support yet in the kernel for running n32 binaries)
2002-01-07 22:07:37 +00:00
dbj d5738f5104 add support for the `D' kgdb detach command
add comment about minimum requirement for KGDB_BUFLEN
2002-01-05 22:57:38 +00:00
thorpej 21df9c4a6e Switch ELF emulations to ELF core files (except for netbsd32 and svr4-32). 2002-01-04 06:47:46 +00:00
mrg d6328a8778 fix previous: actually remove the COMPAT_SUNOS code, not just #if 0 it. 2002-01-03 01:16:02 +00:00
mrg af640de164 move the COMPAT_SUNOS SO_BROADCAST hack out of uipc_socket.c into the
compat/sunos code.  besides being cleaner this allows the sunos LKM
to properly work without any special kernel hacks.
2002-01-03 00:59:00 +00:00
perry dc0e791802 Happy New Year! 2002-01-01 09:17:28 +00:00
ad 281fb6d209 In clalloc(), clear the quoted char bitmap (part of the ring buffer was
being cleared twice).
2001-12-27 02:27:50 +00:00
christos eebee4d7f8 PR/14795: Christos Zoulas: Fix locking problem on MP systems where
ltsleep() is calling CURSIG() which can call issignal() and issignal()
could not deal with being called from a locked context. This happens
when a process receives SIGTTIN, and issignal() calls psignal() to
post SIGCHLD to the parent.

XXX: It is really messy to have issignal() handle the job control
functionality and the whole signal interlocking protocol needs to
be re-designed. For now this fix (provided by enami) does the trick.
I've been running with this fix for weeks, and atatat has stress-tested
the kernel running ~30 make kernels...
2001-12-18 15:51:52 +00:00