Commit Graph

115811 Commits

Author SHA1 Message Date
Xin LI
466e103c7d Constify savedir pointer, and remove an accompaning strdup() call. 2005-05-29 16:28:07 +00:00
Robert Watson
19fb720da7 Add /usr/include/bsm to mtree creation set.
Submitted by:	wsalamon
Obtained from:	TrustedBSD Project
2005-05-29 16:18:29 +00:00
Robert Watson
62fdab9284 Do install BSM include files (such as they are) when installing system
includes.

Submitted by:	wsalamon
Obtained from:	TrustedBSD Project
2005-05-29 16:17:00 +00:00
Robert Watson
38e5b60d5d For consistency with more system include files, add a trailing '_' to
the define guards in audit_kevents.h.
2005-05-29 16:11:34 +00:00
Robert Watson
8f0aaac907 Add place-holder audit.h that defines only au_event_t, which is needed
in order to modify the system call table to include event identifiers.
The full audit.h will be merged at a later date.

Obtained from:	TrustedBSD Project
2005-05-29 16:10:33 +00:00
Philippe Charnier
8a1dff0c73 Give variable an initial value. Use errx() instead of fprintf(). 2005-05-29 16:07:10 +00:00
Philippe Charnier
865059c8a8 Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
2005-05-29 16:04:46 +00:00
Philippe Charnier
ce2657c007 Even if variable is never used uninitialized by the semantic, reduce compiler
warning by giving an initial value in all cases.
2005-05-29 16:01:12 +00:00
Philippe Charnier
35a974fdb8 rscid -> __FBSDID. Mark parameter as __unused when necessary. 2005-05-29 15:57:00 +00:00
Philippe Charnier
8a9d84b4a6 Move variable initialization to reduce compiler warning. 2005-05-29 15:52:48 +00:00
Philippe Charnier
a8cf0aaf75 Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
2005-05-29 15:49:53 +00:00
Philippe Charnier
0bf92eb85e Move FreeBSD Id outside of copyright. Initialize variable. 2005-05-29 15:47:31 +00:00
Tai-hwa Liang
905ff382d1 Typo correction. 2005-05-29 14:56:51 +00:00
Robert Watson
147819cc85 Modify vmstat(8)'s domem() routine, which is responsible for extracting
malloc(9) statistics from kernel memory or a kernel coredump, to catch
up with recent changes to adopt per-CPU malloc(9) statistics.  The new
routines walk the per-CPU statistics pools and coalesce them for
presentation to the user.
2005-05-29 13:40:00 +00:00
Robert Watson
63a7e0a3f9 Kernel malloc layers malloc_type allocation over one of two underlying
allocators: a set of power-of-two UMA zones for small allocations, and the
VM page allocator for large allocations.  In order to maintain unified
statistics for specific malloc types, kernel malloc maintains a separate
per-type statistics pool, which can be monitored using vmstat -m.  Prior
to this commit, each pool of per-type statistics was protected using a
per-type mutex associated with the malloc type.

This change modifies kernel malloc to maintain per-CPU statistics pools
for each malloc type, and protects writing those statistics using critical
sections.  It also moves to unsynchronized reads of per-CPU statistics
when generating coalesced statistics.  To do this, several changes are
implemented:

- In the previous world order, the statistics memory was allocated by
  the owner of the malloc type structure, allocated statically using
  MALLOC_DEFINE().  This embedded the definition of the malloc_type
  structure into all kernel modules.  Move to a model in which a pointer
  within struct malloc_type points at a UMA-allocated
  malloc_type_internal data structure owned and maintained by
  kern_malloc.c, and not part of the exported ABI/API to the rest of
  the kernel.  For the purposes of easing a possible MFC, re-use an
  existing pointer in 'struct malloc_type', and maintain the current
  malloc_type structure size, as well as layout with respect to the
  fields reused outside of the malloc subsystem (such as ks_shortdesc).
  There are several unused fields as a result of no longer requiring
  the mutex in malloc_type.

- Struct malloc_type_internal contains an array of malloc_type_stats,
  of size MAXCPU.  The structure defined above avoids hard-coding a
  kernel compile-time value of MAXCPU into kernel modules that interact
  with malloc.

- When accessing per-cpu statistics for a malloc type, surround read -
  modify - update requests with critical_enter()/critical_exit() in
  order to avoid races during write.  The per-CPU fields are written
  only from the CPU that owns them.

- Per-CPU stats now maintained "allocated" and "freed" counters for
  number of allocations/frees and bytes allocated/freed, since there is
  no longer a coherent global notion of the totals.  When coalescing
  malloc stats, accept a slight race between reading stats across CPUs,
  and avoid showing the user a negative allocation count for the type
  in the event of a race.  The global high watermark is no longer
  maintained for a malloc type, as there is no global notion of the
  number of allocations.

- While tearing up the sysctl() path, also switch to using sbufs.  The
  current "export as text" sysctl format is retained with the same
  syntax.  We may want to change this in the future to export more
  per-CPU information, such as how allocations and frees are balanced
  across CPUs.

This change results in a substantial speedup of kernel malloc and free
paths on SMP, as critical sections (where usable) out-perform mutexes
due to avoiding atomic/bus-locked operations.  There is also a minor
improvement on UP due to the slightly lower cost of critical sections
there.  The cost of the change to this approach is the loss of a
continuous notion of total allocations that can be exploited to track
per-type high watermarks, as well as increased complexity when
monitoring statistics.

Due to carefully avoiding changing the ABI, as well as hardening the ABI
against future changes, it is not necessary to recompile kernel modules
for this change.  However, MFC'ing this change to RELENG_5 will require
also MFC'ing optimizations for soft critical sections, which may modify
exposed kernel ABIs.  The internal malloc API is changed, and
modifications to vmstat in order to restore "vmstat -m" on core dumps will
follow shortly.

Several improvements from:		bde
Statistics approach discussed with:	ups
Tested by:				scottl, others
2005-05-29 13:38:07 +00:00
Marius Strobl
80afb03ba1 Add vr_init_t member to sc_rndr_sw_t instances in order to unbreak
compilation after sys/dev/syscons/syscons.h rev. 1.83.
2005-05-29 12:47:39 +00:00
Gleb Smirnoff
bbc8878e6d Fix check for leading zero, so that it does not block two zeroes
in hook name.
2005-05-29 12:20:41 +00:00
Yoshihiro Takahashi
6fd53a4f81 Sync with syscons update (Add new member to struct sc_rndr_sw). 2005-05-29 11:53:14 +00:00
Peter Grehan
3b7b274ae1 The end values passed to rman_manage_region() for PCI i/o and mem
spaces were 1 too large. This resulted in the rman list not being
sorted correctly, and USB ports not being discovered on older
TiBooks.

Detective work by:   Andreas Tobler <toa at pop dot agri dot ch>
2005-05-29 08:51:21 +00:00
Xin LI
f112120666 Add VESA mode support for syscons, which enables the support of 15, 16,
24, and 32 bit modes.  To use that, syscons(4) must be built with
the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a.
vesa.ko) must be either loaded, or be compiled into the kernel.

Do not return EINVAL when the mouse state is changed to what it already is,
which seems to cause problems when you have two mice attached, and
applications are not likely obtain useful information through the EINVAL
caused by showing the mouse pointer twice.

Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is
the video mode number from the vidcontrol -i mode output.  Also, revert the
video mode if something fails.

Obtained from:	DragonFlyBSD
Discussed at:	current@ with patch attached [1]
PR:		kern/71142 [2]
Submitted by:	Xuefeng DENG <dsnofe at msn com> [1],
		Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2]
2005-05-29 08:43:44 +00:00
Tim J. Robbins
4129539639 Move information about exit status into a DIAGNOSTICS section. 2005-05-29 08:18:48 +00:00
Yoshihiro Takahashi
d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Pawel Jakub Dawidek
885fec3e08 Fix panic when module is compiled in and it is loaded from loader.conf.
Only panic is fixed, module will be still listed in kldstat(8) output.
Not sure what is correct fix, because adding unloading code in case of
failure to linker_init_kernel_modules() doesn't work.
2005-05-28 23:20:05 +00:00
Garance A Drosehn
0a4c254389 Provide info on the incompatible change in v1.33 of sys/kern/imgact_shell.c
Discussed with:	imp
2005-05-28 22:45:31 +00:00
Garance A Drosehn
5f49915eb2 Change the way options are parsed on the `#!'-line of a shell-script. Instead
of having the kernel parse that line and add an entry to the argument list for
each 'separate word' it finds, have it add only one entry which holds all
the words found on that line.  The old behavior is useful in some situations,
but it does not match the way any other operating system will parse that line.

This has been discussed in the thread "Bug in #! processing - One More Time"
on the freebsd-arch mailing list (starting back on Feb 24, 2005).  The first
few messages in that thread provide the background in much detail.

PR:		16393
Reviewed by:	freebsd-arch
2005-05-28 22:42:41 +00:00
Pawel Jakub Dawidek
870fba2648 Prevent loading modules with are compiled into the kernel.
PR:		kern/48759
Submitted by:	Pawe³ Ma³achowski <pawmal@unia.3lo.lublin.pl>
Patch from:	demon
MFC after:	2 weeks
2005-05-28 22:29:44 +00:00
Sam Leffler
f6f1669c0f integrate changes from libpcap-0.9.1-096
Reviewed by:	bms
2005-05-28 21:56:41 +00:00
Alan Cox
5f7679afd0 Update some comments to reflect the change from spl-based to lock-based
synchronization.
2005-05-28 17:56:18 +00:00
Alan Cox
c49e22761a pmap_enter() no longer requires Giant. Therefore, stop acquiring and
releasing it in pmap_enter_quick().

MFC after: 3 weeks
2005-05-28 17:13:36 +00:00
Pawel Jakub Dawidek
2856a282ee Document 'jid' keyword for ps(1) and '-j' option for pgrep(1)/pkill(1). 2005-05-28 16:23:29 +00:00
Robert Watson
0cc0090517 Regenerate from syscalls.master. 2005-05-28 14:35:43 +00:00
Robert Watson
d85bfefd79 Mark ntp_gettime() as MSTD, since its system call path will acquire
Giant if required.
2005-05-28 14:35:05 +00:00
Robert Watson
75b8223886 Explicitly acquire Giant around the ntp_gettime() and assert it in the
sysctl path.  While this code is close to MPSAFE, it may require some
additional locking.  Mark ntp_gettime1() as GIANT_REQUIRED for now.

Suggested by:	phk
2005-05-28 14:34:41 +00:00
Yoshihiro Takahashi
f7965374d4 Change the spkr_set_pitch() function to a macro to fix low level profiling. 2005-05-28 13:40:27 +00:00
Robert Watson
7329f580c8 Regenerate for updated syscalls.master. 2005-05-28 13:24:05 +00:00
Robert Watson
d7b9187bff Mark the following compatability system calls as MCOMPAT or MCOMPAT4 based
on the their simply wrapping MPSAFE implementations of existing MPSAFE
system calls:

  getfsstat()
  lseek()
  stat()
  lstat()
  truncate()
  ftruncate()
  statfs()
  fstatfs()

Note that ogetdirentries() is not marked MPSAFE because it does not share
the MPSAFE implementation used for getdirentries(), and requires separate
locking to be implemented.
2005-05-28 13:23:42 +00:00
Bjoern A. Zeeb
7cceedd6b5 Fix use of uninitialized variable len in ngd_send.
Note: len gets intialized to 0 for sap == NULL case only to
make compiler on amd64 happy. This has nothing todo with the
former uninitialized use of len in sap != NULL case.

Reviewed by:	glebius
Approved by:	pjd (mentor)
2005-05-28 13:15:44 +00:00
Robert Watson
958a52b82b Regenerate from syscalls.master. 2005-05-28 13:13:01 +00:00
Robert Watson
160349adb1 Mark quotactl() as MSTD. 2005-05-28 13:12:04 +00:00
Robert Watson
f8e5f64207 Acquire Giant explicitly in quotactl() so that the syscalls.master
entry can become MSTD.
2005-05-28 13:11:35 +00:00
Robert Watson
a72baeca1d Regenerate from updated syscalls.master. 2005-05-28 13:09:56 +00:00
Robert Watson
ec792a6740 Mark kenv(2) as MPSAFE, since it appears to be properly locked down. 2005-05-28 13:09:41 +00:00
Robert Watson
848c3ec33f Regenerate system call tables from syscalls.master. 2005-05-28 13:08:26 +00:00
Robert Watson
5267dc0b3a Also mark the COMPAT4 version of fhstatfs() as MPSAFE. 2005-05-28 13:07:43 +00:00
Robert Watson
2191a5d154 Mark fhopen(), fhstat(), and fhstatfs() as MSTD, since they now
acquire Giant themselves.
2005-05-28 12:59:33 +00:00
Robert Watson
f73e1f57cf Acquire Giant explicitly in fhopen(), fhstat(), and kern_fhstatfs(),
so that we can start to eliminate the presence of non-MPSAFE system
call entries in syscalls.master.
2005-05-28 12:58:54 +00:00
Yoshihiro Takahashi
20ef0ca2b3 Enable ReiserFS note on pc98. 2005-05-28 12:41:55 +00:00
Seigo Tanimura
db051dad5f Add 6300ESB, which should be treated as ICH4.
PR:		kern/81573
Submitted by:	OOTOMO Hiroyuki <ootomo@za.wakwak.com>
MFC after:	1 week
2005-05-28 09:32:43 +00:00
Seigo Tanimura
29ea671b36 Let OSPFv3 go through ipfw. Some more additional checks would be
desirable, though.
2005-05-28 07:46:44 +00:00
Brooks Davis
dbf49e18bb Update refrenced URL for SNMP list of ifTypes to refer to iana.org
instead of a dead location on ftp.isi.edu.
2005-05-28 06:11:38 +00:00