Commit Graph

10222 Commits

Author SHA1 Message Date
kan
b1ec908186 Remove extra slash from pty slave device name returned by ptsname. 2006-02-13 00:04:04 +00:00
rwatson
cea51dc68c Update copyright for 2006.
MFC after:	3 days
2006-02-11 19:21:39 +00:00
rwatson
f2e35917b9 The uma_zone data structure defines the size of its uz_cpu[] array as 1,
but then sizes the containing data structure at run-time to make room
for per-cpu cache data.  Modify libmemstat to separately allocate a
buffer to hold per-cpu cache data, sized based on the run-time mp_maxid
variable when using libkvm to access UMA data.  This avoids reading
invalid cache data from beyond the end of the uma_zone data structure
on the stack, which can result in invalid statistics and/or reads from
invalid kernel addresses.

Foot target practice by:	ps
MFC after:			3 days
2006-02-11 19:19:29 +00:00
rwatson
c1cbeeaeb1 When reporting an error reading from UMA per-cpu cache pointers using KVM,
return a KVM error rather than an out of memory error, so that the caller
reports the KVM error state.  This replaces a misleading error message
with a more accurate although equally confusing one.

MFC after:	3 days
2006-02-11 18:55:03 +00:00
rwatson
35f263ed80 Read all_cpus variable out of kmem, and validate CPUs against the all_cpus
cpu mask before looking at the cache entries for the CPU.  For systems
with sparse CPU id arrays, this skips otherwise uninitialized cache
structures.

MFC after:	3 days
2006-02-11 18:44:37 +00:00
rwatson
244cb93d72 Correct a typo in the extraction of zone information from UMA using kmem:
bytes = allocated - freed, not bytes = allocated = freed.

MFC after:	3 days
2006-02-11 16:54:00 +00:00
davidxu
b9945d52e2 Use ps_linfo to retrieve LWP info, current it is used to retrieve
signal mask and pending signals.
2006-02-07 02:55:34 +00:00
davidxu
6cfb2f2fce Use ps_linfo to retrieve LWP info. 2006-02-07 02:51:25 +00:00
davidxu
879ea1a11b Replace ptrace syscall with ps_lgetgregs to check a LWP's existence. 2006-02-07 02:12:33 +00:00
davidxu
f9048c6816 Always clear thread info buffer to zero. 2006-02-06 11:54:19 +00:00
davidxu
08b1c5c928 Now, thread name is stored in kernel, userland no longer has to keep it. 2006-02-05 03:04:54 +00:00
davidxu
118990614c use syscall thr_set_name to implement pthread_set_name_np. 2006-02-05 02:26:17 +00:00
phk
f8e9593b7e Remove spurious "union arg" from printf.h
Make sure to always print something in the alternate time format.
2006-02-04 14:35:01 +00:00
dfr
a943b1ff7a The function isspace does not take a string argument. I have no idea how
this compiled before; it only worked by accident.
2006-02-04 09:40:21 +00:00
jasone
c3550ff9ae Fix calculation of the number of arenas to use on multi-processor systems. 2006-02-04 01:11:30 +00:00
rwatson
8c4a42a14f Add libbsm to the library build.
Obtained from:	TrustedBSD Project
2006-02-02 10:05:39 +00:00
joel
87dcb0582d Expand contractions. 2006-02-01 14:33:14 +00:00
phk
8920c8cd74 Add missing 's' suffix on alternate rendition of time. 2006-01-31 08:09:37 +00:00
harti
02a28f2514 Instead of printing several pieces with .Sy just enclose the 'Note' block
into a .Bf/.Ef pair.

Submitted by:	ru
2006-01-30 08:26:59 +00:00
glebius
e8ec4c3a0a - In pipe() return the error returned by pipe_create(), rather then
hardcoded ENFILES, which is incorrect. pipe_create() can fail due
  to ENOMEM.
- Update manual page, describing ENOMEM return code.

Reviewed by:	arch
2006-01-30 08:25:04 +00:00
cognet
80e1881f9b If the sysctl kern.pts.enable doesn't exist, check that /dev/ptmx is there,
and if so, use the pts system.

Suggested by:	rwatson
2006-01-29 00:02:57 +00:00
pjd
b5f41824ae - Add a note that passing NULL to pidfile_write(), pidfile_remove() and
pidfile_close() functions is safe. This possibility is used in example code.
- Cast pid_t to int.

Requested by:	yar
2006-01-28 14:13:15 +00:00
harti
9bf5db07ee The .Nm macro prints Open_Disk() instead of libdisk, so use an explicite
argument to get 'libdisk'. Also bump the date of the man page.
2006-01-27 16:38:05 +00:00
harti
8c7768240b Revert 1.45 now that snmp_hostres uses libgeom. 2006-01-27 16:32:13 +00:00
jasone
4018cc9c9b Remove unwarranted uses of 'goto'. 2006-01-27 07:46:22 +00:00
jasone
7d53fc1d66 Add NO_MALLOC_EXTRAS, so that various extra features that can cause
performance degradation can be disabled via something like the following
in /etc/malloc.conf:

	CFLAGS+=-DNO_MALLOC_EXTRAS

Suggested by:	deischen
2006-01-27 04:42:10 +00:00
jasone
94601bfc12 Fix the type of a statistics counter (unsigned --> unsigned long). 2006-01-27 04:36:39 +00:00
jasone
efa3cf2bb3 Clean up statistics gathering and printing. 2006-01-27 02:36:44 +00:00
pjd
be52ac2832 Remove debug printf. 2006-01-26 11:15:08 +00:00
jasone
6f41342041 Optimize arena_bin_pop() to reduce the number of separator operations.
Remove the block of code that tries to use delayed regions in LIFO order,
since from a policy perspective, it conflicts with LRU caching of newly
coalesced regions in arena_undelay().  There are numerous policy
alternatives, and it isn't readily obvious which (if any) is superior;
this change at least has the virtue of being consistent with policy.
2006-01-26 08:11:23 +00:00
kientzle
4a61fe30d0 Fix an aliasing error in the new TP support and reenable it in the build. 2006-01-26 05:28:56 +00:00
cognet
ee802bd791 Make getttyent() report what the pts ptys as well. 2006-01-26 01:34:26 +00:00
cognet
fcd65bac76 ptsname() bits for pts. 2006-01-26 01:33:55 +00:00
cognet
b7565a36f0 Teach openpty() how to deal with pts. 2006-01-26 01:33:26 +00:00
phk
a6d0508dd8 Make the %V{is} extension handle a NULL pointer like %s does: output "(null)"
Add %M{essage} extension which prints an errno value as the
corresponding string if possible or numerically otherwise.

It is not currently possible to do the syslog(3) like %m extension
because errno would need to get capatured on entry to the first
function in the printf family, so %M requires you to supply errno
as an argument.

Add %Q{uote} extension which will print a string in double quotes with
appropriate back-slash escapes (only) if necessary.
2006-01-25 12:45:24 +00:00
cognet
b52efc57be Add a dummy arm Write_Disk() function, and compile libdisk on arm. 2006-01-25 11:24:37 +00:00
dfr
7d855a2e46 Move the Internet Society copyright message so that it appears in the
formatted page as well as the source.
2006-01-25 10:06:28 +00:00
jasone
f7b6cf045e Remove a redundant variable assignment in arena_reg_frag_alloc(). 2006-01-25 05:41:02 +00:00
jasone
30e6373190 If no coalesced exact-fit small regions are available, but delayed exact-
fit regions are available, use the delayed regions in LIFO order, in order
to increase locality of reference.  We might expect this to cause delayed
regions to be removed from the delay ring buffer more often (since we're
now re-using more recently buffered regions), but numerous tests indicate
that the overall impact on memory usage tends to be good (reduced
fragmentation).

Re-work arena_frag_reg_alloc() so that when large free regions are
exhausted, it uses small regions in a way that favors contiguous allocation
of sequentially allocated small regions.  Use arena_frag_reg_alloc() in
this capacity, rather than directly attempting over-fitting of small
requests when no large regions are available.

Remove the bin overfit statistic, since it is no longer relevant due to
the arena_frag_reg_alloc() changes.

Do not specify arena_frag_reg_alloc() as an inline function.  It is too
large to benefit much from being inlined, and it is also called in two
places, only one of which is in the critical path (the other call bloated
arena_reg_alloc()).

Call arena_coalesce() for a region before caching it with
arena_mru_cache().

Add assertions that detect the attempted caching of adjacent free regions,
so that we notice this problem when it is first created, rather than in
arena_coalesce(), when it's too late to know how the problem arose.

Reported by:    Hans Blancke
2006-01-25 04:21:22 +00:00
davidxu
3172ccca0f Add missing symbol pthread_set_name_np. 2006-01-23 06:11:23 +00:00
jasone
f26da23003 Make the 'C' and 'c' malloc options consistent with other options; 'C'
doubles the cache size, and 'c' halves the cache size.
2006-01-23 03:32:38 +00:00
jasone
cd2c530a43 In arena_chunk_reg_alloc(), try to avoid touching the last page in the
chunk during initialization, in order to avoid physically backing the
page unless data are allocated there.
2006-01-23 03:19:01 +00:00
truckman
bfe1f15bac Back out the previous change to rename.2. The previous rename()
behaviour of returning EINVAL when ".." is passed as either argument
has been restored.

rmdir("..") now returns EINVAL instead of EPERM.  Document the
previously undocumented behaviour of rmdir(".") returning EINVAL
as required by POSIX and SUSv3.  Bump the man page change date.

undelete("..") now returns EINVAL instead of EPERM.  Bump the man
page change date.

MFC after:	3 days
2006-01-22 19:49:37 +00:00
truckman
0c5f09bf3c rename(), rmdir(), and undelete() fail with EPERM if the last component
of the path is "..".

MFC after:	3 days
2006-01-21 20:45:45 +00:00
jasone
cc036a2601 Use uintptr_t rather than size_t when casting pointers to integers. Also,
fix the few remaining casting style(9) errors that remained after the
functional change.

Reported by:	jmallett
2006-01-20 03:11:11 +00:00
jasone
92d4e46d35 Revert addtion of assertions in revision 1.99. These assertions cause
problems in cases where regions are faked up for the purposes of red-black
tree searches, since those faked region headers reside on the stack, rather
than in a malloc chunk.
2006-01-19 19:20:42 +00:00
jasone
583abbb79b Add assertions that detect some forms of region separator corruption. 2006-01-19 19:08:11 +00:00
jasone
0d0573f36b Remove loops in arena_coalesce(). They are no longer necessary, now that
internal allocation does not rely on recursive arena use (base_arena was
removed in revision 1.95).
2006-01-19 18:37:30 +00:00
des
fe60356e67 In order to maintain interoperability with certain broken FTP servers,
ignore a MODE failure if and only if the mode we attempted to set was S
(which is supposed to be the default).

PR:		bin/91973
2006-01-19 08:31:47 +00:00
jasone
4634244628 Make all internal variables and functions static.
Reported by:	ache
2006-01-19 07:23:13 +00:00