Commit Graph

117106 Commits

Author SHA1 Message Date
rwatson
db6e7961b9 Merge kern_malloc.c:1.143,1.144 malloc.h:1.81 from HEAD to RELENG_6:
Introduce a new sysctl, kern.malloc_stats, which exports kernel malloc
  statistics via a binary structure stream:

  - Add structure 'malloc_type_stream_header', which defines a stream
    version, definition of MAXCPUS used in the stream, and a number of
    malloc_type records in the stream.

  - Add structure 'malloc_type_header', which defines the name of the
    malloc type being reported on.

  - When the sysctl is queried, return a stream header, followed by a
    series of type descriptions, each consisting of a type header
    followed by a series of MAXCPUS malloc_type_stats structures holding
    per-CPU allocation information.  Typical values of MAXCPUS will be 1
    (UP compiled kernel) and 16 (SMP compiled kernel).

  This query mechanism allows user space monitoring tools to extract
  memory allocation statistics in a machine-readable form, and to do so
  at a per-CPU granularity, allowing monitoring of allocation patterns
  across CPUs in order to better understand the distribution of work and
  memory flow over multiple CPUs.

  While here:

  - Bump statistics width to uint64_t, and hard code using fixed-width
    type in order to be more sure about structure layout in the stream.
    We allocate and free a lot of memory.

  - Add kmemcount, a counter of the number of registered malloc types,
    in order to avoid excessive manual counting of types.  Export via a
    new sysctl to allow user-space code to better size buffers.

  - De-XXX comment on no longer maintaining the high watermark in old
    sysctl monitoring code.

  A follow-up commit of libmemstat(3), a library to monitor kernel memory
  allocation, will occur in the next few days.  Likewise, similar changes
  to UMA.

kern_malloc.c:1.144:

  Correct build on 64-bit: cast u_int64_t to (unsigned long long) before
  printfing as (unsigned long long).  32-bit build on i386 didn't notice
  this.  Whoops.

  Reported by:    arved
  Tested by:      sledge

Approved by:	re (kensmith)
2005-07-23 17:11:33 +00:00
mlaier
6b5cea57ef MFC: -sp pfsync
Print newly exported pfsync statistics with netstat(8).

  Requested by:   glebius

Approved by:	re (kensmith)
2005-07-23 17:03:59 +00:00
mlaier
e678c5edd8 MFC: if_pfsync.c, 1.20 in_proto.c, 1.78
Export pfsyncstats via sysctl "net.inet.pfsync" in order to print them
  with netstat (seperate commit).

  Requested by:   glebius

Approved by:	re (kensmith)
2005-07-23 17:02:10 +00:00
imura
99200c85ff MFC 1.45: Fix looking up files having invalid short name.
PR:		77074
Approved by:	re (kensmith)
2005-07-23 17:02:04 +00:00
mlaier
54b3d10896 MFC: if.c, 1.236
Move eventhandler for 'ifnet_departure_event' at the end of the progress.
  Some of the (IPv6) cleanup functions send packets to inform peers of the
  departure.  These packets confused users of ifnet_departure_event (pf at
  the moment).

  PR:             kern/80627
  Tested by:      Divacky Roman

Approved by:	re (kensmith)
2005-07-23 17:00:07 +00:00
rwatson
45ebd5c0a6 Merge uma_core.c:1.128 from HEAD to RELENG_6:
Further UMA statistics related changes:

    - Add a new uma_zfree_internal() flag, ZFREE_STATFREE, which causes it to
      to update the zone's uz_frees statistic.  Previously, the statistic was
      updated unconditionally.

    - Use the flag in situations where a "real" free occurs: i.e., one where
      the caller is freeing an allocated item, to be differentiated from
      situations where uma_zfree_internal() is used to tear down the item
      during slab teardown in order to invoke its fini() method.  Also use
      the flag when UMA is freeing its internal objects.

    - When exchanging a bucket with the zone from the per-CPU cache when
      freeing an item, flush cache statistics back to the zone (since the
      zone lock and critical section are both held) to match the allocation
      case.

Approved by:	re (kensmith)
2005-07-23 15:11:13 +00:00
rwatson
5562de6958 Merge uma_core.c:1.127 from HEAD to RELENG_6:
Use mp_maxid in preference to MAXCPU when creating exports of UMA
  per-CPU cache statistics.  UMA sizes the cache array based on the
  number of CPUs at boot (mp_maxid + 1), and iterating based on MAXCPU
  could read off the end of the array (into the next zone).

  Reported by:    yongari

Approved by:	re (kensmith)
2005-07-23 15:10:29 +00:00
rwatson
3fddaeea0e Merge uma.h:1.26, uma_int.h:1.36, uma_core.c:1.126 from HEAD to
RELENG_6:

  Improve canonicalization of copyrights.  Order copyrights by order of
  assertion (jeff, bmilekic, rwatson).

  Suggested ages ago by:  bde

Approved by:	re (kensmith)
2005-07-23 15:10:00 +00:00
rwatson
834f5ace40 Merge uma_core.c:1.125 from HEAD to RELENG_5:
Move the unlocking of the zone mutex in sysctl_vm_zone_stats() so that
  it covers the following of the uc_alloc/freebucket cache pointers.
  Originally, I felt that the race wasn't helped by holding the mutex,
  hence a comment in the code and not holding it across the cache access.
  However, it does improve consistency, as while it doesn't prevent
  bucket exchange, it does prevent bucket pointer invalidation.  So a
  race in gathering cache free space statistics still can occur, but not
  one that follows an invalid bucket pointer, if the mutex is held.

  Submitted by:   yongari

Approved by:	re (kensmith)
2005-07-23 15:08:53 +00:00
rwatson
5123f5ca4b Merge uma.h:1.25, uma_int.h:1.35, uma_core.c:1.124 from HEAD to
RELENG_6:

  Increase the flags field for kegs from a 16 to a 32 bit value;
  we have exhausted all 16 flags.

Approved by:	re (kensmith)
2005-07-23 15:08:12 +00:00
rwatson
383e61944d Merge uma.h:1.24, uma_int.h:1.34, uma_core.c:1.123 from HEAD to
RELENG_6:

  Track UMA(9) allocation failures by zone, and export via sysctl.

  Requested by:   victor cruceru <victor dot cruceru at gmail dot com>

Approved by:	re (kensmith)
2005-07-23 15:06:54 +00:00
rwatson
adabb7b041 Merge uma.h:1.23, uma_int.h:1.33, uma_core.c:1.122 from HEAD to
RELENG_6:

  Introduce a new sysctl, vm.zone_stats, which exports UMA(9) allocator
  statistics via a binary structure stream:

  - Add structure 'uma_stream_header', which defines a stream version,
    definition of MAXCPUs used in the stream, and the number of zone
    records in the stream.

  - Add structure 'uma_type_header', which defines the name, alignment,
    size, resource allocation limits, current pages allocated, preferred
    bucket size, and central zone + keg statistics.

  - Add structure 'uma_percpu_stat', which, for each per-CPU cache,
    includes the number of allocations and frees, as well as the number
    of free items in the cache.

  - When the sysctl is queried, return a stream header, followed by a
    series of type descriptions, each consisting of a type header
    followed by a series of MAXCPUs uma_percpu_stat structures holding
    per-CPU allocation information.  Typical values of MAXCPU will be
    1 (UP compiled kernel) and 16 (SMP compiled kernel).

  This query mechanism allows user space monitoring tools to extract
  memory allocation statistics in a machine-readable form, and to do so
  at a per-CPU granularity, allowing monitoring of allocation patterns
  across CPUs in order to better understand the distribution of work and
  memory flow over multiple CPUs.

  While here, also export the number of UMA zones as a sysctl
  vm.uma_count, in order to assist in sizing user swpace buffers to
  receive the stream.

  A follow-up commit of libmemstat(3), a library to monitor kernel memory
  allocation, will occur in the next few days.  This change directly
  supports converting netstat(1)'s "-mb" mode to using UMA-sourced stats
  rather than separately maintained mbuf allocator statistics.

Approved by:	re (kensmith)
2005-07-23 15:05:24 +00:00
rwatson
0788375698 Merge uma_int.h:1.32, uma_core.c:1.121 from HEAD to RELENG_6:
In addition to tracking allocs in the zone, also track frees.  Add
  a zone free counter, as well as a cache free counter.

Approved by:	re (kensmith)
2005-07-23 15:03:49 +00:00
rwatson
8093747980 Merge uma_core.c:1.20 from HEAD to RELENG_6:
In an earlier world order, UMA would flush per-CPU statistics to the
  zone whenever it was moving buckets between the zone and the cache,
  or when coalescing statistics across the CPU.  Remove flushing of
  statistics to the zone when coalescing statistics as part of sysctl,
  as we won't be running on the right CPU to write to the cache
  statistics.

  Add a missed gathering of statistics: when uma_zalloc_internal()
  does a special case allocation of a single item, make sure to update
  the zone statistics to represent this.  Previously this case wasn't
  accounted for in user-visible statistics.

Approved by:	re (kensmith)
2005-07-23 15:01:48 +00:00
ume
c4a65195b2 MFC 1.418: mention getaddrinfo(3) ABI breakage on 64 bit arch.
Approved by:	re (kensmith)
2005-07-22 20:21:50 +00:00
ume
34d108ce3b MFC: Remove padding for ABI compatibility of ai_addrlen member
from struct addrinfo.  This change break ABI compatibility on
64 bit arch.

	include/netdb.h:		1.39
	lib/libc/net/getaddrinfo.c:	1.70

Approved by:	re (kensmith)
2005-07-22 20:17:30 +00:00
kensmith
1f1979ea2c Insta-MFC of the shared library version bump. All shared libraries
whose version has not already been bumped since RELENG_5 are being
bumped.

Revisions of files being MFC-ed:

> Path						Revision
> src/gnu/lib/libdialog/Makefile		1.43
> src/gnu/lib/libg2c/Makefile			1.16
> src/gnu/lib/libobjc/Makefile			1.27
> src/gnu/lib/libreadline/Makefile.inc		1.12
> src/gnu/lib/libregex/Makefile			1.32
> src/gnu/lib/libstdc++/Makefile		1.56
> src/kerberos5/lib/Makefile.inc		1.7
> src/lib/Makefile.inc				1.3
> src/lib/libalias/Makefile			1.31
> src/lib/libarchive/Makefile			1.37
> src/lib/libbegemot/Makefile			1.3
> src/lib/libbluetooth/Makefile			1.2
> src/lib/libbsnmp/Makefile.inc			1.6
> src/lib/libbz2/Makefile			1.6
> src/lib/libc_r/Makefile			1.42
> src/lib/libcrypt/Makefile			1.36
> src/lib/libdevstat/Makefile			1.15
> src/lib/libdevstat/devstat.h			1.11
> src/lib/libedit/Makefile			1.29
> src/lib/libexpat/Makefile			1.5
> src/lib/libfetch/Makefile			1.45
> src/lib/libftpio/Makefile			1.14
> src/lib/libgpib/Makefile			1.2
> src/lib/libipsec/Makefile			1.17
> src/lib/libkiconv/Makefile			1.3
> src/lib/libmagic/Makefile			1.7
> src/lib/libmp/Makefile			1.10
> src/lib/libncp/Makefile			1.6
> src/lib/libncurses/Makefile			1.79
> src/lib/libnetgraph/Makefile			1.11
> src/lib/libngatm/Makefile			1.6
> src/lib/libopie/Makefile			1.21
> src/lib/libpam/Makefile.inc			1.17
> src/lib/libpthread/Makefile			1.54
> src/lib/libradius/Makefile			1.12
> src/lib/libsdp/Makefile			1.4
> src/lib/libsmb/Makefile			1.8
> src/lib/libtacplus/Makefile			1.7
> src/lib/libthr/Makefile			1.14
> src/lib/libthread_db/Makefile			1.6
> src/lib/libugidfw/Makefile			1.7
> src/lib/libusbhid/Makefile			1.10
> src/lib/libutil/Makefile			1.57
> src/lib/libvgl/Makefile			1.11
> src/lib/libwrap/Makefile			1.17
> src/lib/libypclnt/Makefile			1.13
> src/lib/msun/Makefile				1.72
> src/secure/lib/libcrypto/Makefile		1.74
> src/secure/lib/libssh/Makefile		1.35
> src/secure/lib/libssl/Makefile		1.22
> src/usr.sbin/bsnmpd/modules/Makefile.inc	1.10

Reviewed by:	ru
Approved by:	re (scottl)
2005-07-22 17:29:10 +00:00
scottl
7ecd401320 MFC rev 1.55: Check the correct IDs for the Dell PERC3/S/Di filter driver.
Approved by: re
2005-07-22 16:29:51 +00:00
emax
4704967d22 MFC to RELENG_6
kbdmux(4) keyboard multiplexer integration

o Hook up kbdmux(4) to the build.

Approved by:	re (kensmith)
2005-07-21 17:47:27 +00:00
kensmith
ed85a2330d Forced commit to note the RELENG_6 branch tag was added to this file so
it can be part of the 6.0 release.

Requested by:	emax
Approved by:	re (implicit)
2005-07-21 17:09:24 +00:00
emax
9ed76b0a6f MFC to RELENG_6
kbdmux(4) keyboard multiplexer integration

o Teach kbdcontrol(1) how to attach/detach keyboards to/from the keyboard
  multiplexor;

o Update kbdcontrol(1) man page and document new functionality.

To attach/detach keyboard to/from keyboard multiplexor one needs to use
keyboard device name (i.e. ukbd0).

Approved by:	re (kensmith)
2005-07-21 17:04:02 +00:00
kensmith
cb9646d870 Forced commit to note the RELENG_6 branch tag was added so this file
can be part of the 6.0 release.

Requested by:	emax
Approved by:	re (implicit)
2005-07-21 16:41:18 +00:00
kensmith
c957355a4a Forced commit to note the RELENG_6 branch tag was added to this file
so it can be part of the 6.0 release.

Requested by:	emax
Approved by:	re (implicit)
2005-07-21 16:40:07 +00:00
ps
21b8a6b2f6 MFC: rev 1.127
Fix for a NFS soft mounts bug where if the number of retries exceeds
the max rexmits, the request was not being bounced back with a
ETIMEDOUT error.

Approved by:	re
2005-07-21 16:19:02 +00:00
rwatson
6ef35a9033 Merge ifconfig.8:1.98, ifconfig.c:1.115, ifconfig.h:1.17,
ifieee80211.c:1.19 from HEAD to RELENG_6:

  Add a new flag '-k' to ifconfig(8), indicating that it is alright to
  print potentially sensitive keying material to stdout.  With the new
  802.11 support, ifconfig(8) is now capable of printing 802.11 keys,
  and did by default for the root user, which is undesirable in some
  environments.  Now it will not print keying material unless requested
  (and available to the user).

Approved by:	re (kensmith)
2005-07-21 12:25:40 +00:00
cvs2svn
b63ff29afc This commit was manufactured by cvs2svn to create branch 'RELENG_6'. 2005-07-20 21:10:58 +00:00
harti
44e27bfe20 MFC to RELENG_6.
Fix the "..." special command. If this command is found all further
commands for this target are appended to the .END target instead
of beeing executed now. They are executed when the graph is finished.
There was a bug with executing the .END target which came in when
doing conversion to LST_FOREACH() which caused make to dump core.

PR:		bin/83698
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
Approved by:	re
2005-07-20 19:05:23 +00:00
emax
339c3c8a5d MFC to RELENG_6
kbdmux(4) keyboard multiplexer integration

o Add two new ioctl's KBADDKBD and KBRELKBD. These are used to add and remove
  keyboard to (and from) kbdmux(4) keyboard multiplexer;

o Introduce new kbd_find_keyboard2() function. It does exactly the same job
  as kbd_find_keyboard() function except it allows to specify starting index.
  This function can be used to iterate over keyboards array;

o Re-implement kbd_find_keyboard() as call to kbd_find_keyboard2() with starting
  index of zero;

o Make sure syscons(4) passed KBADDKBD and KBRELKBD ioctl's onto currently
  active keyboard.

These changes should not have any visible effect.

Approved by:	re (kensmith)
2005-07-20 18:56:21 +00:00
jhb
0bceb288b2 Regenerate.
Approved by:	re (kensmith) (implicit)
2005-07-20 17:43:53 +00:00
jhb
b4aa604964 MFC: Sync up the MP safe flags of the compat ABIs with the master list and
mark known-safe ABI syscall wrappers as MP safe.

Approved by:	re (kensmith)
2005-07-20 17:42:15 +00:00
simon
777ee0c901 MFC rev 1.116 of src/sys/fs/devfs/devfs_vnops.c:
Correct devfs ruleset bypass.

Submitted by:	csjp
Reviewed by:	phk
Security:	FreeBSD-SA-05:17.devfs
Approved by:	re (scottl)
2005-07-20 13:35:07 +00:00
pjd
07c78f2e9f MFC: g_concat.c 1.25
g_stripe.c	1.26

Before calling g_orphan_provider(), add G_PF_WITHER flag, so GEOM will know
to destroy it.

PR:		kern/81758
Submitted by:	trasz <trasz@buziaczek.pl>
Approved by:	re (kensmith)
2005-07-20 13:12:20 +00:00
rwatson
3495e52d0b Merge ip_input.c:1.302 from HEAD to RELENG_6:
Remove spl() calls from ip_slowtimo(), as IP fragment queue locking was
  merged several years ago.

Approved by:	re (kensmith)
2005-07-20 12:03:38 +00:00
rwatson
d558a17887 Merge if_sbsh.c:1.13 from HEAD to RELENG_6:
Mark if_sbsh as IFF_NEEDSGIANT, because it does.

Approved by:	re (kensmith)
2005-07-20 09:41:52 +00:00
rwatson
a1a683e30e Merge if_cnw.c:1.19 from HEAD to RELENG_6:
Mark if_cnw as IFF_NEEDSGIANT, because it does.

Approved by:	re (kensmith)
2005-07-20 09:41:08 +00:00
thompsa
3ff75fd38d MFC: Allow interfaces with MTU != 1500 to be bridged
> 1.6       +3 -0      src/share/man/man4/if_bridge.4
> 1.12      +6 -1      src/sys/net/if_bridge.c

Approved by:	re (kensmith), mlaier (mentor)
2005-07-19 23:25:39 +00:00
jhb
8d4a9d75bf MFC: Add 'sysent' target.
Approved by:	re (kensmith)
2005-07-18 19:54:49 +00:00
jhb
288ca48d6c MFC: Fix instant panics when booting with debug.mpsafevm=0 by fixing up
an old test.

Approved by:	re (kensmith)
2005-07-18 19:53:21 +00:00
jhb
94b28a8c46 MFC: Set timer0_max_count to a correct value in the lapic timer case and
fix i8254_restore() so that it actually works in the non-lapic timer case
thus unbreaking suspend/resume for several people.

Approved by:	re (kensmith)
2005-07-18 19:52:05 +00:00
jhb
ecaea625bd MFC: Wrap freebsd32_mmap_partial() with Giant.
Approved by:	re (kensmith)
2005-07-18 19:49:48 +00:00
jhb
2241d53b9e Regenerate after IPC syscall addition.
Approved by:	re (kensmith) (implicit)
2005-07-18 19:48:44 +00:00
jhb
2266f8e080 MFC: Stop hardcoding #define's and hook up the IPC syscalls.
Approved by:	re (kensmith)
2005-07-18 19:48:13 +00:00
jhb
654d629916 MFC: Don't provide an acpi attachment for the non-pnp mss(4) driver.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:46:38 +00:00
jhb
04c5a7e3eb MFC: Ignore BIOS IRQs > 15.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:45:21 +00:00
jhb
030929c001 MFC: Don't probe PnP ISA devices.
Approved by:	re (kensmith)
MFC after:	1 week
2005-07-18 19:43:45 +00:00
pjd
c3cd72bdc6 MFC: geom_raid3.c 1.12
Don't forget to initialize 'id' field.

Approved by:	re (kensmith)
2005-07-18 16:14:21 +00:00
yar
9718a6e4b2 MFC 1.114: Add missing symbolic names of new interface flags.
Approved by:	re (kensmith)
2005-07-18 14:02:19 +00:00
kensmith
b347cb6eac MFC addition of the COMPAT_FREEBSD5 option. Specific versions
being MFCed:

> Path                          Revision
> src/sys/alpha/conf/GENERIC    1.187
> src/sys/amd64/conf/GENERIC    1.440
> src/sys/i386/conf/GENERIC     1.430
> src/sys/ia64/conf/GENERIC     1.73
> src/sys/pc98/conf/GENERIC     1.270
> src/sys/powerpc/conf/GENERIC  1.49
> src/sys/sparc64/conf/GENERIC  1.97

Approved by:    re (scottl)
2005-07-18 12:23:42 +00:00
grehan
d1f6ac895f MFC: r1.22
Remove obsolete ttya/ttyb entries and replace with ttyy0/1.
Mark origin of ofw_console(4) and zs(4) devices.

Approved by:	re (Ken Smith)
2005-07-18 12:06:38 +00:00
sheldonh
098bd257ce MFC rev 1.34: regen
Approved by:	re (kensmith)
2005-07-18 07:45:17 +00:00