Since it is not possible for curthread to be NULL in this context,
drop the check+initialization for a straight initialization. Also
assert that curthread will never be NULL just to be sure.
Joseph Koshy [Sun, 1 May 2005 14:11:49 +0000 (14:11 +0000)]
Add convenience APIs pmc_width() and pmc_capabilities() to -lpmc.
Have pmcstat(8) and pmccontrol(8) use these APIs.
Return PMC class-related constants (PMC widths and capabilities)
with the OP GETCPUINFO call leaving OP PMCINFO to return only the
dynamic information associated with a PMC (i.e., whether enabled,
owner pid, reload count etc.).
Allow pmc_read() (i.e., OPS PMCRW) on active self-attached PMCs to
get upto-date values from hardware since we can guarantee that the
hardware is running the correct PMC at the time of the call.
Bug fixes:
- (x86 class processors) Fix a bug that prevented an RDPMC
instruction from being recognized as permitted till after the
attached process had context switched out and back in again after
a pmc_start() call.
Tighten the rules for using RDPMC class instructions: a GETMSR
OP is now allowed only after an OP ATTACH has been done by the
PMC's owner to itself. OP GETMSR is not allowed for PMCs that
track descendants, for PMCs attached to processes other than
their owner processes.
- (P4/HTT processors only) Fix a bug that caused the MI and MD
layers to get out of sync. Add a new MD operation 'get_config()'
as part of this fix.
- Allow multiple system-mode PMCs at the same row-index but on
different CPUs to be allocated.
- Reject allocation of an administratively disabled PMC.
Misc. code cleanups and refactoring. Improve a few comments.
Søren Schmidt [Sun, 1 May 2005 12:24:45 +0000 (12:24 +0000)]
Update on the last commit, the dma* funciton needs to be called with
a channel device, not an ata device, or we'll be out of luck in
reset/timeout where we dont have a device.
Jeff Roberson [Sun, 1 May 2005 12:00:36 +0000 (12:00 +0000)]
- All buffers should either be clean or dirty. If neither of these flags
are set when we attempt to remove a buffer from a queue we should panic.
Hopefully this will catch the source of the wrong bufobj panics.
Robert Watson [Sun, 1 May 2005 11:11:38 +0000 (11:11 +0000)]
Slide unlocking of the tcbinfo lock earlier in tcp_usr_send(), as it's
needed only for implicit connect cases. Under load, especially on SMP,
this can greatly reduce contention on the tcbinfo lock.
NB: Ambiguities about the state of so_pcb need to be resolved so that
all use of the tcbinfo lock in non-implicit connection cases can be
eliminated.
Submited by: Kazuaki Oda <kaakun at highway dot ne dot jp>
Jeff Roberson [Sun, 1 May 2005 00:56:34 +0000 (00:56 +0000)]
- In devfs_open() and devfs_close() grab Giant if the driver sets NEEDGIANT.
We still have to DROP_GIANT and PICKUP_GIANT when NEEDGIANT is not set
because vfs is still sometime entered with Giant held.
Sam Leffler [Sun, 1 May 2005 00:38:11 +0000 (00:38 +0000)]
o enable shutdown of taskqueue threads; the thread servicing the queue checks
a new entry in the taskqueue struct each time it wakes up to see if it
should terminate
o adjust TASKQUEUE_DEFINE_THREAD & co. to record the thread/proc identity for
the shutdown rendezvous
o replace wakeup after adding a task to a queue with wakeup_one; this helps
queues where multiple threads are used to service tasks (e.g. acpi)
o remove NULL check of tq_enqueue method; it should never be NULL
Doug White [Sat, 30 Apr 2005 20:01:00 +0000 (20:01 +0000)]
Implement an alternate method to stop CPUs when entering DDB. Normally we use
a regular IPI vector, but this vector is blocked when interrupts are disabled.
With "options KDB_STOP_NMI" and debug.kdb.stop_cpus_with_nmi set, KDB will
send an NMI to each CPU instead. The code also has a context-stuffing
feature which helps ddb extract the state of processes running on the
stopped CPUs.
KDB_STOP_NMI is only useful with SMP and complains if SMP is not defined.
This feature only applies to i386 and amd64 at the moment, but could be
used on other architectures with the appropriate MD bits.
Take newbusification one step further, ie use the device_t more consequently
all way through the code down the layers, instead of the mix'n'match that
resulted from the conversion done earlier.
Warner Losh [Sat, 30 Apr 2005 16:09:23 +0000 (16:09 +0000)]
Add some subversive code to cleandir: remove the sbin/ipf tree
entirely to fix the tinderbox machine. This change will be reverted
once the tinderboxen are tindering again.
Jeff Roberson [Sat, 30 Apr 2005 11:22:40 +0000 (11:22 +0000)]
- In vnlru_free() remove the vnode from the free list before we call
vtryrecycle(). We could sometimes get into situations where two threads
could try to recycle the same vnode before this.
- vtryrecycle() is now responsible for returning the vnode to the free list
if it fails and someone else hasn't done it.
- Make a new function vfreehead() which moves a vnode to the head of the
free list and use it in vgone() to clean up that code a bit.
Sponsored by: Isilon Systems, Inc.
Reported by: pho, kkenn
Do not unconditionally mount devfs to ${jail_devdir}/dev. First check
to see if a prior devfs has been mounted. If no devfs is mounted on
${jail_devdir}/dev then proceed. This will prevent the stack up of
multiple devfs mounts on the same mount point.
Brooks Davis [Fri, 29 Apr 2005 23:02:56 +0000 (23:02 +0000)]
To allow /etc to be as minimal as possible in a diskless setup, we need
to run initdiskless before we run rcorder on /etc/rc.d. To allow this,
move /etc/rc.d/initdiskless to /etc/rc.initdiskless and run it directly
from /etc/rc.
Remove /etc/rc.d/preseedrandom as it is no longer necessicary (we start
with entropy unblocked) and was only used by initdiskless when it
was needed.
Colin Percival [Fri, 29 Apr 2005 22:38:02 +0000 (22:38 +0000)]
Add PROC_UNLOCK(p) to PTRACESTOP_SC(p, td, flag). This is necessary
due to a change made in revision 1.284 of sys/kern/kern_sig.c in August
2004 which made ptracestop() return with the process still locked.
- do validation check and IPv4-mapped IPv6 address handling before
any query.
- don't query against IPv6 link-local address.
- use IN6_IS_ADDR_V4{MAPPED,COMPAT} macros.
- use memcpy() instead of bcopy().
Robert Watson [Fri, 29 Apr 2005 18:56:36 +0000 (18:56 +0000)]
Modify UMA to use critical sections to protect per-CPU caches, rather than
mutexes, which offers lower overhead on both UP and SMP. When allocating
from or freeing to the per-cpu cache, without INVARIANTS enabled, we now
no longer perform any mutex operations, which offers a 1%-3% performance
improvement in a variety of micro-benchmarks. We rely on critical
sections to prevent (a) preemption resulting in reentrant access to UMA on
a single CPU, and (b) migration of the thread during access. In the event
we need to go back to the zone for a new bucket, we release the critical
section to acquire the global zone mutex, and must re-acquire the critical
section and re-evaluate which cache we are accessing in case migration has
occured, or circumstances have changed in the current cache.
Per-CPU cache statistics are now gathered lock-free by the sysctl, which
can result in small races in statistics reporting for caches.
Reviewed by: bmilekic, jeff (somewhat)
Tested by: rwatson, kris, gnn, scottl, mike at sentex dot net, others
Rename the directive_hash.[ch] files to hash_tables.[ch] now
that there are more than one hash table in them. There is no
history to preserve here, so go without a repo-copy.
Brooks Davis [Fri, 29 Apr 2005 15:07:44 +0000 (15:07 +0000)]
Remove the Netgear WG311 from the list. The v1 card is supported, but
the v2 card is a TI. Since we're not attempting to keep this list
complete, removing this is best.
Reported by: Brian Candler <B dot Candler at pobox dot com>
Evan Dower <evantd at hotmail dot com>
MFC After: 1 day
Toggle on warnings. This resolves the problem with building old releases
(getting zillions of warnings). Building an old release uses that release's
sys.mk which does not switch on these warnings, so make will be silent.
They can be switch on on the command line with the -x option to make.
This has been tested by building RELENG_5_4 on CURRENT.
Implement a pseudo-target .WARN that allows toggeling the warning flags
for the current make. This does not override flags specified on the
command line and these settings are not passed to sub-makes.
Now that probing is working in the new fashion, we need to go back to
having ata_getparm issue an ata_request and not fool around with the HW
on its own.
Needed for new HW support.
Vendor patch: fix a bug that was introduced when moving from libisc to
libbegemot: the rpoll_start_timer function needs the timeout value in
milli-seconds, not the absolute time when the timer should tick.
Robert Drehmel [Fri, 29 Apr 2005 10:11:18 +0000 (10:11 +0000)]
Add flag to choose whether to use getgrouplist(3) or getgroups(2)
to the id_print() function.
Use getgrouplist(3) for the case when an user was specified,
and getgroups(2) when no user was given.
That reverts to the expected behaviour and makes it easy to
implement an option later to force using getgrouplist(3).
Warner Losh [Fri, 29 Apr 2005 06:22:41 +0000 (06:22 +0000)]
Add a detach for pci bridge and pci bus drivers. This allows one to
theoretically unload pci bridges or pci drivers. It will also allow
detach to work if one needed to detach a subtree.
This is inspired by looking at the p4 commits from bms to his 5.4
tree, but I didn't look at the final results.
Ruslan Ermilov [Fri, 29 Apr 2005 05:57:17 +0000 (05:57 +0000)]
Fix the following warnings on amd64:
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_newfrag':
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:397: warning: cast to pointer from integer of different size
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c: In function `fr_ipid_knownfrag':
/usr/src/sbin/ipf/ipftest/../../../sys/contrib/ipfilter/netinet/ip_frag.c:582: warning: cast from pointer to integer of different size