Jake Burkholder [Thu, 7 Mar 2002 06:01:40 +0000 (06:01 +0000)]
Implement delivery of tlb shootdown ipis. This is currently more fine grained
than the other implementations; we have complete control over the tlb, so we
only demap specific pages. We take advantage of the ranged tlb flush api
to send one ipi for a range of pages, and due to the pm_active optimization
we rarely send ipis for demaps from user pmaps.
Remove now unused routines to load the tlb; this is only done once outside
of the tlb fault handlers.
Minor cleanups to the smp startup code.
This boots multi user with both cpus active on a dual ultra 60 and on a
dual ultra 2.
Jake Burkholder [Thu, 7 Mar 2002 05:25:15 +0000 (05:25 +0000)]
Modify the tlb demap API to take a pmap instead of a tlb context number.
Due to allocating tlb contexts on the fly, we only ever need to demap the
primary context, non-primary contexts have already been implicitly flushed
by context switching. All we really need to tell is if its a kernel demap
or not, and its easier just to compare against the kernel_pmap which is a
constant.
Jake Burkholder [Thu, 7 Mar 2002 05:15:43 +0000 (05:15 +0000)]
Implement kthread context stealing. This is a bit of a misnomer because
the context is not actually stolen, as it would be for i386. Instead of
deactivating a user vmspace immediately when switching out, and recycling
its tlb context, wait until the next context switch to a different user
vmspace. In this way we can switch from a user process to any number of
kernel threads and back to the same user process again, without losing any
of its mappings in the tlb that would not already be knocked by the automatic
replacement algorithm. This is not expected to have a measurable performance
improvement on the machines we currently run on, but it sounds cool and makes
the sparc64 port SMPng buzz word compliant.
Mike Silbersack [Thu, 7 Mar 2002 04:50:36 +0000 (04:50 +0000)]
Unconditionally limit maxproc so that it is not possible
to exhaust all kmaps. The only reward for setting maxproc
to a value which will cause kmap exhaustion is a panic
during a forkbomb attack.
Matthew Dillon [Thu, 7 Mar 2002 03:54:56 +0000 (03:54 +0000)]
Fix a bug in the vm_map_clean() procedure. msync()ing an area of memory
that has just been mapped MAP_ANON|MAP_NOSYNC and has not yet been accessed
will panic the machine.
Peter Pentchev [Wed, 6 Mar 2002 16:49:02 +0000 (16:49 +0000)]
Unbreak the pam_krb5 build: cast a couple of const pointers
to normal char *. A better fix might be some const'ifying
of the Heimdal code, but this will do to fix the build
for the present.
Rename runq_find() to runq_findproc(), and hide it behind #ifdef DIAGNOSTIC,
as it can have a severe impact on performance under high load, and the bug
it was meant to catch was fixed ages ago.
Bruce Evans [Wed, 6 Mar 2002 11:25:58 +0000 (11:25 +0000)]
Support runtime specification of the history counter type by whatever
generated the gmon data. The support is currently limited to what is
easy to implement and/or needed:
signedess: signed or insigned
size: 8, 16, 32 or 64 bits
format: a binary integer in gprof's format (gprof is not a cross-tool).
High-resolution kernel profiling uses signed 64-bit counters. Normal
kernel profiling and user profiling use unsigned 16-bit counters but
should use 32-bit ones.
Bruce Evans [Wed, 6 Mar 2002 09:47:36 +0000 (09:47 +0000)]
Fixed some misspellings of 2 as sizeof(UNIT) so that they won't break
things when sizeof(UNIT) becomes a runtime parameter. The relevant 2
is the one in profil(2)'s scaling of pc's to bucket numbers:
bucket = (pc - offset) / 2 * profil_scale / 65536
gprof(1) must duplicate this scaling, bug for bug compatibly, so it
must first do an integer division by 2 although this mainly makes
scales larger than 65536 useless. sizeof(UNIT) was already wrong in
gprof4, but there were no problems because the fake profil scale is a
multiple of 2.
There are also some rounding bugs in the scaling, but these are only
problems if profil(2) is used directly to create unusual (and not
useful) scales.
Bruce Evans [Wed, 6 Mar 2002 06:33:33 +0000 (06:33 +0000)]
Fixed a printf format error again. Rev.127 was clobbered in rev.1.128
by removing parentheses. The main bug is in gcc: on machines with
64-bit longs and 64-bit long longs,
(unsigned long long)rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE))
has type plain unsigned long instead of the correctly promoted type
unsigned long long, so it can not be printfed using %llu format. Even
1ULL / 1L is mispromoted. Anyway, casting the correct operand
automatically avoids the problem. We do not want to to pessimize the
division; we just want to convert to a common maximal type for printing.
Matthew Dillon [Wed, 6 Mar 2002 02:42:56 +0000 (02:42 +0000)]
Add a sequential iteration optimization to vm_object_page_clean(). This
moderately improves msync's and VM object flushing for objects containing
randomly dirtied pages (fsync(), msync(), filesystem update daemon),
and improves cpu use for small-ranged sequential msync()s in the face of
very large mmap()ings from O(N) to O(1) as might be performed by a database.
A sysctl, vm.msync_flush_flag, has been added and defaults to 3 (the two
committed optimizations are turned on by default). 0 will turn off both
optimizations.
This code has already been tested under stable and is one in a series of
memq / vp->v_dirtyblkhd / fsync optimizations to remove O(N^2) restart
conditions that will be coming down the pipe.
Bruce A. Mah [Tue, 5 Mar 2002 22:39:51 +0000 (22:39 +0000)]
New release notes: CPU_ATHLON_SSE_HACK, ufm driver (+ MFC),
awk is BWK awk for sparc64, ctags(1) works for files with C++ comments
(+ MFC), dump(8) -s, last(1) -y, lint update/import from NetBSD.
Switch to OpenPAM. Bump library version. Modules are now versioned, so
applications linked with Linux-PAM will still work.
Remove pam_get_pass(); OpenPAM has pam_get_authtok().
Remove pam_prompt(); OpenPAM has pam_{,v}{error,info,prompt}().
Remove pam_set_item(3) man page as OpenPAM has its own.
John Baldwin [Tue, 5 Mar 2002 18:57:36 +0000 (18:57 +0000)]
- Use td_ucred for jail checks.
- Move jail checks and some other checks involving constants and stack
variables out from under Giant. This isn't perfectly safe atm because
jail_sysvipc_allowed is read w/o a lock meaning that its value could be
stale. This global variable will soon become a per-jail flag, however,
at which time it will either not need a lock or will use the prison lock.
Robert Watson [Tue, 5 Mar 2002 18:48:15 +0000 (18:48 +0000)]
Reserve a mount flag, MNT_MULTILABEL, used by the MAC subsystem and
individual filesystems to determine whether they should operate in
"file system as a single object" mode, or "file system as a set of objects
with individual labels" mode. Note: in the trustedbsd_mac branch,
this is refered to as "MNT_MULTILEVEL", but the two mean the same thing.
MNT_MULTILABEL is more suggestive of a flexible policy system than one
providing purely hierarchal policies. The need for a reserved flag will
go away once nmount() is done.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Robert Watson [Tue, 5 Mar 2002 18:44:11 +0000 (18:44 +0000)]
Merge reservation of two SI_SUB constants for the MAC policy framework
and for individual MAC policies. The framework event initializes the
access control subsystem; the policy event allows policies to register
themselves. The gap in between is for all the things we'll think of
later.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Eivind Eklund [Tue, 5 Mar 2002 18:20:58 +0000 (18:20 +0000)]
* Move bswlist declaration and initialization from kern/vfs_bio.c to
vm/vm_pager.c, which is the only place it is used.
* Make the QUEUE_* definitions and bufqueues local to vfs_bio.c.
* constify buf_wmesg.
Brian Feldman [Tue, 5 Mar 2002 17:50:35 +0000 (17:50 +0000)]
Use revoke_and_destroy_dev() instead of destroy_dev() when removing /dev/net
pseudo-devices when an interface goes away. Otherwise, an open /dev/net/foo0
when the interface is removed can cause a crash.
Tor Egge [Tue, 5 Mar 2002 17:34:37 +0000 (17:34 +0000)]
When multiple threads call atexit at the same time, some operations must
be serialized. A mutex is used to protect the critical regions.
sbrk() and brk() are not thread safe. Replace use of sbrk() with
a call to malloc to avoid race when one thread calls atexit
while another thread calls malloc.
Robert Watson [Tue, 5 Mar 2002 16:11:11 +0000 (16:11 +0000)]
Reserve system call numbers for the MAC framework. This will prevent
people working on the MAC tree from getting toasted whenever system call
numbers are allocated in the main tree (for example, for KSE :-).
Calls allocated: __mac_{get,set}_proc, __mac_{get,set}_{fd,file}().
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
Eivind Eklund [Tue, 5 Mar 2002 15:38:49 +0000 (15:38 +0000)]
Document all functions, global and static variables, and sysctls.
Includes some minor whitespace changes, and re-ordering to be able to document
properly (e.g, grouping of variables and the SYSCTL macro calls for them, where
the documentation has been added.)