jilles [Sun, 14 Mar 2010 13:07:40 +0000 (13:07 +0000)]
MFC r204410: Include terminated threads in ps's process cpu time field.
When a kinfo_proc is filled, first fill_kinfo_proc_only() fills in
ki_runtime using p->p_rux.rux_runtime (all cpu time used by the process
including terminated threads). If information for a specific thread is
requested, fill_kinfo_thread() then overwrites this with the thread's
td->td_runtime (good). If not, fill_kinfo_aggregate() overwrote it with
the sum of all threads' td->td_runtime which does not include terminated
threads.
This affects ps(1)'s TIME field, not its %CPU field nor anything in
top(1).
jh [Fri, 12 Mar 2010 06:56:51 +0000 (06:56 +0000)]
MFC r204447:
In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.
delphij [Fri, 12 Mar 2010 00:51:13 +0000 (00:51 +0000)]
MFC r203760: Improve time precision for grdc(6):
Traditionally, grdc would obtain time through time(3) which in turn gets
only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
each screen refresh.
This approach would have two problems. First, we are not guaranteed to
be waken up at the beginning of a whole second, which will typically
exhibit as a "lag" on second number. Second, because we sleep for whole
second, and the refresh process would take some time, the error would
accumulate from time to time, making the lag variable.
Make grdc(6) to use time(3) to get time only at the beginning, and sample
time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
nanosecond part to caculate how much time we want to sleep.
fabient [Thu, 11 Mar 2010 07:36:45 +0000 (07:36 +0000)]
MFC r204878:
Change the way shutdown is handled for log file.
pmc_flush_logfile is now non-blocking and just ask the kernel
to shutdown the file. From that point, no more data is
accepted by the log thread and when the last buffer is flushed
the file is closed.
This will remove a deadlock between pmcstat asking for
flush while it cannot flush the pipe itself.
fabient [Thu, 11 Mar 2010 07:35:30 +0000 (07:35 +0000)]
MFC r204878:
Change the way shutdown is handled for log file.
pmc_flush_logfile is now non-blocking and just ask the kernel
to shutdown the file. From that point, no more data is
accepted by the log thread and when the last buffer is flushed
the file is closed.
This will remove a deadlock between pmcstat asking for
flush while it cannot flush the pipe itself.
yongari [Wed, 10 Mar 2010 22:21:07 +0000 (22:21 +0000)]
MFC r204647:
Remove programming LED register and enable 25MHz TX clock for 88E1149 PHY. This will fix intermittent watchdog timeouts as well
as very slow network performance on 88E8072 Yukon Extreme.
jhb [Mon, 8 Mar 2010 21:36:20 +0000 (21:36 +0000)]
MFC 204518:
Print the contents of the miscellaneous (MISC) register to the console if
it is valid along with the other register values when a machine check is
encountered.
qingli [Mon, 8 Mar 2010 21:30:12 +0000 (21:30 +0000)]
MFC 204402
Use reference counting instead of locking to secure an address while
that address is being used to generate temporary IPv6 address. This
approach is sufficient and avoids recursive locking.
edwin [Mon, 8 Mar 2010 21:29:00 +0000 (21:29 +0000)]
MFC of tzdata2010e, r204887
- Adjust beginning / end of DST in Bangladesh (minimal impact)
- Fiji ends DST one month earlier to last Sunday of March
- Samoa changes
- Chile extends DST until 3 April this year.
mav [Mon, 8 Mar 2010 16:53:58 +0000 (16:53 +0000)]
MFC r204648:
Several changes to fix livelock under high load, introduced by r203489:
- change the way in which command queue overflow is handled;
- do not expose to CAM two command slots, used for driver's internal purposes;
- allow driver to use up to 1024 command slots, instead of 256 before.
fabient [Mon, 8 Mar 2010 07:53:44 +0000 (07:53 +0000)]
MFC r204783:
Bug fixed:
- no display on serial terminal in top mode.
- display alignment for continuation string.
- correct invalid value used for display limit.
luigi [Sun, 7 Mar 2010 14:29:12 +0000 (14:29 +0000)]
MFC r197137 and r200510, which fixes a problem in 8.0
with callouts firing one tick too late. See the logs for
the original patch for details.
RELENG_7 is not affected by the problem.
gshapiro [Sun, 7 Mar 2010 02:02:07 +0000 (02:02 +0000)]
MFC: Enable the use of nanosleep() instead of using pause() and signals.
This Makefile change can be removed when the next version of sendmail
is imported as it will have this built in to the FreeBSD conf.h section.
marcel [Sun, 7 Mar 2010 00:05:44 +0000 (00:05 +0000)]
MFC revs 203696, 203708, 203783 and 203788:
Add PT_VM_TIMESTAMP and PT_VM_ENTRY so that the tracing process can
obtain the memory map of the traced process.
kib [Sat, 6 Mar 2010 12:35:33 +0000 (12:35 +0000)]
MFC r204413:
For kinfo_proc in kp->ki_siglist, return the set of the signals pending
in the process queue when gathering information for the process, and set
of signals pending for the thread, when gathering information for the
thread.
fabient [Fri, 5 Mar 2010 22:40:31 +0000 (22:40 +0000)]
MFC 203790:
- Reorganize code in 'plugin' to share log processing.
- Kcachegrind (calltree) support with assembly/source
code mapping and call count estimator (-F).
- Top mode for calltree and callgraph plugin (-T).
kib [Thu, 4 Mar 2010 07:12:44 +0000 (07:12 +0000)]
MFC r204307:
Make pause(3) implementation not depended on the legacy sigcompat.c
interfaces. Do not block rt signals during and after pause(3) calls.
Use private libc namespace to call proper methods.
kib [Thu, 4 Mar 2010 07:08:01 +0000 (07:08 +0000)]
MFC r204308:
Do not restrict the allowed signals that can be specified by number
to the list of signals that has symbolic name. It was impossible to
send rt signals with kill(1) due to the check.
alc [Tue, 2 Mar 2010 16:29:08 +0000 (16:29 +0000)]
MFC r204420
When running as a guest operating system, the FreeBSD kernel must assume
that the virtual machine monitor has enabled machine check exceptions.
Unfortunately, on AMD Family 10h processors the machine check hardware
has a bug (Erratum 383) that can result in a false machine check exception
when a superpage promotion occurs. Thus, I am disabling superpage
promotion when the FreeBSD kernel is running as a guest operating system
on an AMD Family 10h processor.
delphij [Tue, 2 Mar 2010 01:56:55 +0000 (01:56 +0000)]
MFC x86emu/x86bios emulator and make previously i386 only dpms and vesa
framebuffer driver, etc. work on FreeBSD/amd64.
A significant amount of improvements were done by jkim@ during the recent
months to make vesa(4) work better, over the initial code import. This
work is based on OpenBSD's x86emu implementation and contributed by
paradox <ddkprog yahoo com> and swell.k at gmail com.
Hopefully I have stolen all their work to 8-STABLE :)
mav [Mon, 1 Mar 2010 19:43:26 +0000 (19:43 +0000)]
MFC r204351:
Fix bug in headphones audio redirection using separate DAC. It was exposed
by removing channel duplication during multichannel audio implementation.
nwhitehorn [Mon, 1 Mar 2010 00:38:20 +0000 (00:38 +0000)]
MFC r204197:
Allow user programs to execute mfpvr instructions. Linux allows this, and
some math-related software like GMP expects to be able to use it to pick
a target appropriately.
Reported by: Jakob van Santen <vansanten at wisc dot edu>
joerg [Sun, 28 Feb 2010 22:25:39 +0000 (22:25 +0000)]
MFC r203360
GPIB overhaul, part #2: make the tnt4882 driver work with the newer
TNT5004 IC. This involved a major rewrite of a number of things, as
this chip no longer supports the NAT7210 legacy mode but requires the
host to use the (more modern) FIFO mode.
In theory, this also ought to work on the older TNT4882C chip. I'll
probably add this as optional support (perhaps by a device.hints flag)
later on. By now, FIFO mode is *only* activates iff a TNT5004 chip
has been detected (where the old code didn't work at all), while
everything else is supposed to use the old code.
jh [Sun, 28 Feb 2010 14:04:20 +0000 (14:04 +0000)]
MFC r203665:
Make sure that FTS_COMFOLLOW is not set when the -P option is in effect.
Otherwise the -i option will show the inode number of the referenced file
for symbolic links given on the command line. Similarly, the file color
was printed according to the link target in colorized output.
ume [Sat, 27 Feb 2010 18:27:32 +0000 (18:27 +0000)]
MFC r203490: Introduce '[ipaddr]:path' notation.
Since the existing implementation searches ':' backward, a path which
includes ':' could not be mounted. You can now mount such path by
enclosing an IP address by '[]'.
Though we should change to search ':' forward, it will break
'ipv6addr:path' which is currently working. So, it still searches ':'
backward, at least for now.
ume [Sat, 27 Feb 2010 18:19:13 +0000 (18:19 +0000)]
MFC r203433:
Add rc.d script for the rtsold(8) daemon.
The rtsol(8) handles just one RA then exit. So, the OtherConfig flag
may not be handled well by rtsol(8) in the environment where there are
multiple RA servers on the segment. In such case, rtsold(8) will be
your friend.
kib [Sat, 27 Feb 2010 16:51:23 +0000 (16:51 +0000)]
MFC r203827:
- Add idempotency guards so the structures can be used in other utilities.
- Update bpb structs with reserved fields.
- In direntry struct join deName with deExtension. Although a
fix was attempted in the past, these fields were being overflowed,
Now this is consistent with the spec, and we can now share the
WinChksum code with NetBSD.
mckusick [Fri, 26 Feb 2010 21:49:11 +0000 (21:49 +0000)]
MFC of 203763, 203764, 203768, 203769, 203770, 203782, and 203784.
These fixes correct a problem in the file system that treats large
inode numbers as negative rather than unsigned. For a default
(16K block) file system, this bug began to show up at a file system
size above about 16Tb.
These fixes also update newfs to ensure that it will never create a
filesystem with more than 2^32 inodes.
They also update libufs, tunefs, and growfs so that they properly
handle inode numbers as unsigned.
Reported by: Scott Burns, John Kilburg, and Bruce Evans
Followup by: Jeff Roberson
PR: 133980
delphij [Thu, 25 Feb 2010 00:46:51 +0000 (00:46 +0000)]
MFC r202964:
On FreeBSD, time_t is 64-bit for all platforms except i386 and powerpc,
where the type is 32-bit. ZFS can handle 64-bit timestamp internally
but zfs_setattr() would check if the time value can fit, we change the
checking macros to match 64-bit timestamp if the platform supports it.
This change has some downsides like, while you can import zfs on 32-bit
platforms, the timestamp would overflow if they are out of the range.
This fixes the Y2.038K issue on platforms using 64-bit timestamps.
brooks [Wed, 24 Feb 2010 22:16:16 +0000 (22:16 +0000)]
MFC r202143,202163,202341,202342,204278
Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic
kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to
somewhere in the neighborhood of INT_MAX/4 one a system with sufficent
RAM and memory bandwidth. Given that the Windows group limit is
1024, this range should be sufficient for most applications
r202342:
Only allocate the space we need before calling kern_getgroups instead
of allocating what ever the user asks for up to "ngroups_max + 1". On
systems with large values of kern.ngroups this will be more efficient.
The now redundant check that the array is large enough in
kern_getgroups() is deliberate to allow this change to be merged to
stable/8 without breaking potential third party consumers of the API.
jhb [Wed, 24 Feb 2010 21:29:18 +0000 (21:29 +0000)]
MFC 204090:
Fix mptutil's method for locating disk devices attached to a specific
mpt(4) controller. Previously, the code assumed that multiple match
patterns provided to an XPT_DEV_MATCH request were ANDed together.
Instead, they are ORed. Instead, to match peripherals for a specific bus,
one query needs to be performed to lookup the path ID of the bus. A second
query can then be performed matching peripherals attached to that path.
This approach also makes the code a bit cleaner as the returned match
results do not mix buses and perphierals.
jhb [Wed, 24 Feb 2010 21:20:25 +0000 (21:20 +0000)]
MFC 204086:
- Don't emit a warning in 'show adapter' if the IOC2 or IOC6 pages are not
present. mpt(4) controllers that do not support RAID do not have an IOC6
page, for example.
- Correct a check for a missing page error in a debug function.