Commit Graph

4105 Commits

Author SHA1 Message Date
christos be3704c73f pass the flag to fdclone. 2005-02-12 23:14:03 +00:00
fvdl 7b10f1cabc Don't panic when lwp_suspend finds an LWP on another CPU, just return
EINVAL for now.
2005-02-12 21:39:00 +00:00
jmc 02a4880993 vm_map_max needs a struct pointer, so add a missing deref here 2005-02-12 09:38:25 +00:00
chs 467487d274 use vm_map_{min,max}() instead of dereferencing the vm_map pointer directly.
define and use vm_map_set{min,max}() for modifying these values.
remove the {min,max}_offset aliases for these vm_map fields to be more
namespace-friendly.  PR 26475.
2005-02-11 02:12:03 +00:00
christos 7651651a23 Don't de-reference a NULL ktd on error. Fix from enami, thanks. 2005-02-09 16:15:16 +00:00
fvdl af5309b07c Change the 'sz' variable in bounds_check_* to int64_t to avoid overflows
when a very large blocknumber is passed in.
2005-02-08 08:56:21 +00:00
christos a9fed9480a Allow 32K instead of 1K of section headers. Solaris opera binary has 15K
section headers. We only allocate memory for those headers on compat_linux
and compat_ibcs2 while we probe, and although 32K is not such a big number,
we could fix the code in those two places to read section-by-section instead
of all the sections at once as it does now, if we really felt like it.
2005-02-07 00:12:49 +00:00
christos 4cf9bb2fc2 Change an if/panic statement to a KASSERT and disable a chatty printf. 2005-02-06 23:57:29 +00:00
chs 9a3f782ac4 define a new LWP flag which indicates that we're in the process of
doing a context switch.  use this on sparc and sparc64 to avoid trying
to access user memory (writing the register windows back to the stack)
in this case (since it's both unnecessary and wrong).
2005-01-30 16:56:26 +00:00
christos 8633e293d5 make sure that bss size > 0 before we add a vmcmd for it. 2005-01-29 20:14:04 +00:00
wrstuden e384a44e9d Extend fsync_range(2) to support the FDISKSYNC flag, which requests
that the sync be propogated out through the disk drive caches.
2005-01-25 23:55:20 +00:00
dbj 208b0b3a89 clear p->p_cwdi of exiting processes and
avoid dereferencing invalid p_cwdi in checkdirs
this fixes a race condition between exiting processes and mount
see discussion on tech-kern:
 http://mail-index.netbsd.org/tech-kern/2004/10/04/0006.html
 http://mail-index.netbsd.org/tech-kern/2004/10/08/0005.html
2005-01-24 21:27:02 +00:00
matt 027c11539b Add IFNET_FOREACH and IFADDR_FOREACH macros and start using them. 2005-01-24 21:25:09 +00:00
chs ad79fc3015 move the call to link_pool_init() to the end of uvm_init(). needed for sun3. 2005-01-23 19:02:02 +00:00
matt d341be30f4 Change initialzie of domains to use link sets. Switch to using STAILQ.
Add a convenience macro DOMAIN_FOREACH to interate through the domain.
2005-01-23 18:41:56 +00:00
yamt f6e639255b lkmunreserve: free memory to the correct vm_map when kernel_map != lkm_map. 2005-01-23 08:41:02 +00:00
yamt c3b17808da cc_microset: #if 0 out a diagnositc printf.
this functions is called from ipi handler.
2005-01-23 08:39:51 +00:00
christos 201de1bdd0 Cast nkmempages to vsize_t before shifting to avoid overflow. Requested
by soda.
XXX: should be pulled up to 2.0.
2005-01-14 17:03:58 +00:00
cube fade05f67f As fd_lastfile might be negative, we can't use the (u_int) cast trick to
compare fd and fdp->fd_lastfile in fdrelease(), so change the test to a
more explicit one.  Spotted by Matt Thomas.

Should fix the panic reported by Matthias Scheler.
2005-01-14 00:25:12 +00:00
yamt 48355cdf13 kmeminit_nkmempages: don't limit the size of kmem_map to physmem/4
because, while there's little benefit to do so, it easily causes
"out of space in kmem_map" panic on machines with small memory.
2005-01-13 11:49:09 +00:00
christos 53aa30e2eb s/vp->v_uobj.vmobjlock/vp->v_interlock/. This is the last instance in kern/*.c 2005-01-12 21:51:52 +00:00
cube 8ec7c6764b fd_lastfile should be -1 when there are no opened file descriptors.
Hence, make find_last_set return -1 in such situation, and initialize it
such.  Otherwise, with 0 meaning two things, it confused the F_CLOSEM
fcntl which could end up looping indifintely (PR#28929 by Brian Marcotte).

However, this change enlightens another bug in fdcopy(), where more entries
than needed were cleared in the new file descriptor table, so the memset()
call there is fixed too.

Analyzed with the help of Greg Oster.
2005-01-12 20:41:45 +00:00
tls abcbeb46d9 Users have observed that the amount of memory used by the metadata cache
can in some situations exceed the high-water mark, and stay there once it
gets there.  Adjust the canrelease function so that it will immediately
bring us back down to the high-water mark in this situation.

How can this happen at all?  Consider a machine with two filesystems, one
with a much larger blocksize than the other.  If the small-block filesystem
is very busy, growing the cache up to the high-water mark, and then the
large-block filesystem becomes busy, buffers will be recycled (since we
are at the high-water mark) but _grow each time they're recycled_.  Once
we're above the high-water mark, the canrelease call in allocbuf (without
this change) doesn't shrink us back down below it; so things get worse and
worse.
2005-01-10 15:29:50 +00:00
christos 4bfe82cbac Flip the order of two lines I mixed. Thanks to wiz for noticing. 2005-01-09 20:25:26 +00:00
christos 82ee9647b8 Allow PT_DUMPCORE to specify the core filename. 2005-01-09 19:22:55 +00:00
mycroft 0461b30ac3 Rework the mountroot interface so that vfs_mountroot() opens the root device
and just passes it on to the file system functions.  This avoids opening and
closing the device several times.

Mentioned on tech-kern some time ago, IIRC.  I've been running this for a
long time.
2005-01-09 03:11:48 +00:00
mycroft 13495aa242 If sa_upcall() fails (which is always going to be due to resource exhaustion),
do not leak siginfo structures.

Note that in the cases of trap signals and timer events, losing this
information could be very bad; right now it will cause us to spin until the
process is SIGKILLed.

"Needs work."
2005-01-06 19:26:41 +00:00
thorpej 4dfb0d5670 Regen for extended attribute system calls. 2005-01-02 17:47:29 +00:00
thorpej aee687701e Regen for extended attribute VOPs. 2005-01-02 17:46:41 +00:00
thorpej 1c95472d01 Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
2005-01-02 16:08:28 +00:00
yamt 097f0ea734 PR_NOTOUCH:
- use uint8_t instead of uint16_t for freelist index.
- set ph_off only if PR_NOTOUCH.
- comment.
2005-01-01 21:09:56 +00:00
yamt a880e5e2b5 in the case of !PMAP_MAP_POOLPAGE, gather pool backend allocations to
large chunks for kernel_map and kmem_map to ease kva fragmentation.
2005-01-01 21:08:02 +00:00
yamt aa64686bba introduce a new flag for pool_init, PR_NOTOUCH.
if it's specified, don't use free items as storage for internal state.
so that we can use pools for non memory backed objects.
inspired from solaris's KMC_NOTOUCH.
2005-01-01 21:04:39 +00:00
yamt 95c82bfee4 introduce vm_map_kernel, a subclass of vm_map, and
move some kernel-only members of vm_map to it.
2005-01-01 21:02:12 +00:00
simonb 60e6b50deb Spell "available" correctly. 2005-01-01 03:24:43 +00:00
jdolecek f201f239e3 #ifdef DDB rdyfail label, too 2004-12-30 12:12:16 +00:00
jdolecek aca74c5304 only do the temporary symbol table load #ifdef DDB and add comment for
the code block, so that the purpose is more clear

avoid NULL pointer dereference in lkmunreserve() called on lkm device
close when ksym_addsymtab() fails for the temporary symbol table
(sanity change only, this can never happen at the moment)
2004-12-30 11:47:02 +00:00
jdolecek b90395b379 fix two issues regarding handling of ksyms (modload -s):
* only add the symbol table for the current module if the LKM_E_LOAD
  hook returns success; otherwise we overwrite the LKM_E_LOAD error,
  which may ultimately lead to (incorrectly) allowing the module load
* only delete the sumbol table for current module if we actually added
  the symbol table; avoids deleting symbol table of previously loaded
  module when the same module is loaded twice, when the second load
  fails with EEXIST

fixes PR kern/28803 by Jens Kessmeier
2004-12-30 11:35:41 +00:00
dbj b2c6a6a4ea also define bioops if FFS is not defined. 2004-12-23 20:11:28 +00:00
christos 91a90a7c68 - Move string array definitions and bitmap array definitions to the appropriate
header files, so that they don't become out of sync (again).
- Use bitmask_snprintf() instead of hand-rolled code.
- Always check array bounds before dereferencing print arrays.
- Order arguments in the vnode printing functions consistently.
2004-12-18 03:07:40 +00:00
yamt 819738713e sys_acct: use VOP_SETATTR instead of VOP_TRUNCATE as the latter's
filesystem internal.  while i'm here, fix vnode locking.

XXX vn_start_write
2004-12-13 08:46:43 +00:00
yamt 3290f3a078 vn_lock: #if 0 out an assertion for now. (until PR/27021 is fixed) 2004-12-12 04:46:46 +00:00
matt 108f8fbc51 Add some debug code to validate the runqueues if RQDEBUG is defined. 2004-12-09 21:52:24 +00:00
jrf ac053b9ef0 Fix previous commit, got bufcache and bufmem messages reversed. 2004-12-05 06:12:54 +00:00
jrf cd5b5ced44 Change sysctl -d vm.bufcache to say percent of physical memory not
kernel memory. Addresses PR misc/27233. Approved by atatat@netbsd.org.
2004-12-05 06:00:20 +00:00
christos 31c81b28f5 Cloning cleanup:
1. make fileops const
2. add 2 new negative errno's to `officially' support the cloning hack:
    - EDUPFD (used to overload ENODEV)
    - EMOVEFD (used to overload ENXIO)
3. Created an fdclone() function to encapsulate the operations needed for
   EMOVEFD, and made all cloners use it.
4. Centralize the local noop/badop fileops functions to:
   fnullop_fcntl, fnullop_poll, fnullop_kqfilter, fbadop_stat
2004-11-30 04:25:43 +00:00
thorpej 29671d6616 Fix the fcntl entry points; cmd is a command, not the flags themselves.
Pointed out by Christos (he wrote the broken code originally, and I copied
it to another file later :-)
2004-11-28 07:44:05 +00:00
yamt eb54e7db24 lookup bufq using link_set rather than a switch statement. 2004-11-25 04:52:23 +00:00
christos 96832589f8 Limit the hard-coding of things to tty_bsdpty.c. 2004-11-24 22:19:27 +00:00
yamt 548e34d26e pipe_direct_write: fallback to non-loan write in the case of
any errors from uvm_loan(), rather than only for ENOMEM, which is
never returned by uvm_loan().
2004-11-21 04:30:33 +00:00