Commit graph

66981 commits

Author SHA1 Message Date
Marcel Moolenaar 6bdf667b51 Remove cruft we got from Alpha, which was probably inherited
from NetBSD. I.e. make it more like a FreeBSD header.
2008-04-18 02:21:11 +00:00
David Xu 21afeb89d9 Add missing function prototype for tcgetsid(). 2008-04-18 02:02:33 +00:00
George V. Neville-Neil 0327aeb9e3 Add in check for loopback as well, which was missing from the original patch.
PR: 120958
Submitted by: James Snow <snow at teardrop.org>
MFC after: 2 weeks
2008-04-17 23:24:58 +00:00
Coleman Kane 12b6a0f87c Change the 1 in callout_init to CALLOUT_MPSAFE. I made the change in my
tree, but never committed it into git before making my patch!

Submitted by:	thompsa
MFC after:	1 month
2008-04-17 22:57:33 +00:00
Coleman Kane aba7c5b84b Change the timeout(9) usage in if_ndis to a callout(9) implementation,
as the former is becoming deprecated and exhibits some extraneous
Giant-locking. The new callout(9) is declared MPSAFE, so it may
improve concurrency.

Tested by:	matteo
Silence from:	wpaul
MFC after:	1 month
2008-04-17 22:01:38 +00:00
Robert Watson 8501a69cc9 Convert pcbinfo and inpcb mutexes to rwlocks, and modify macros to
explicitly select write locking for all use of the inpcb mutex.
Update some pcbinfo lock assertions to assert locked rather than
write-locked, although in practice almost all uses of the pcbinfo
rwlock main exclusive, and all instances of inpcb lock acquisition
are exclusive.

This change should introduce (ideally) little functional change.
However, it lays the groundwork for significantly increased
parallelism in the TCP/IP code.

MFC after:	3 months
Tested by:	kris (superset of committered patch)
2008-04-17 21:38:18 +00:00
Pawel Jakub Dawidek f55f27f862 Allow linker_search_symbol_name() to be called with KLD lock held.
The linker_search_symbol_name() function is used by stack_print()
and stack_print() can be called from kernel module unload method.

MFC after:	1 week
2008-04-17 19:19:40 +00:00
Søren Schmidt 1b164f3101 Alloc two DMA slots pr default, silly me forgot that slaves still exists. 2008-04-17 18:11:47 +00:00
George V. Neville-Neil 6b9ff6b7a7 Clean up the code that checks the types of address so that it is
done by understandable macros.

Fix the bug that prevented the system from responding on interfaces with
link local addresses assigned.

PR: 120958
Submitted by: James Snow <snow at teardrop.org>
MFC after: 2 weeks
2008-04-17 12:50:42 +00:00
Marius Strobl 9d9a12b8d1 On sparc64 machines with multiple host-PCI-bridges these bridges
have separate configuration spaces so by definition they implement
different PCI domains. Thus change psycho(4) to use PCI domains
instead of reenumerating all PCI busses so they have globally unique
bus numbers and drop support for reenumerating busses in the OFW PCI
code.
According to CVS history reenumeration was also required in order to
get some E450 to boot but given that no other open source kernel
changes the PCI bus numbers assigned by the firmware I believe the
real problem was that the old code used the bus number as the device
number for the PCI busses and unlike most of the other machines the
firmwares of the problematic ones don't use disjoint PCI bus numbers
across the host-PCI-bridges.

MFC after:	1 month
2008-04-17 12:38:00 +00:00
Søren Schmidt 104c094e06 Go back to preallocating everything possible on init.
This avoids calling busdma in the request processing path which caused a traumatic performance degradation.
Allocation has be postponed to after we know how many devices we possible can have on portmulitpliers to save some space.
2008-04-17 12:29:35 +00:00
Jeff Roberson 1690c6c1be - Add a metric to describe how busy a processor has been over the last
two ticks by counting the number of switches and the load when
   sched_clock() is called.
 - If the busy metric exceeds a threshold allow the idle thread to spin
   waiting for new work for a brief period to avoid using IPIs.  This
   reduces the cost on the sender and receiver as well as reducing wakeup
   latency considerably when it works.

Sponsored by:	Nokia
2008-04-17 09:56:01 +00:00
Jeff Roberson 8df78c41d6 - Make SCHED_STATS more generic by adding a wrapper to create the
variables and sysctl nodes.
 - In reset walk the children of kern_sched_stats and reset the counters
   via the oid_arg1 pointer.  This allows us to add arbitrary counters to
   the tree and still reset them properly.
 - Define a set of switch types to be passed with flags to mi_switch().
   These types are named SWT_*.  These types correspond to SCHED_STATS
   counters and are automatically handled in this way.
 - Make the new SWT_ types more specific than the older switch stats.
   There are now stats for idle switches, remote idle wakeups, remote
   preemption ithreads idling, etc.
 - Add switch statistics for ULE's pickcpu algorithm.  These stats include
   how much migration there is, how often affinity was successful, how
   often threads were migrated to the local cpu on wakeup, etc.

Sponsored by:	Nokia
2008-04-17 04:20:10 +00:00
Marcel Moolenaar 5b43c63ded Simplify the pmap_zero_page family of functions by making use of
the fact that we have a 1:1 mapping by virtue of the BATs.
Eliminate the now unused moea_rkva_alloc(), moea_pa_map() and
moea_pa_unmap() functions.

Pointed out by: grehan.
2008-04-17 00:37:40 +00:00
Marcel Moolenaar 014ffa990d Allocate a stack (with optional guard pages) for thread0 and
switch to it before calling mi_startup().
2008-04-16 23:28:12 +00:00
Stanislav Sedov 640bd7d7d7 - Correctly destroy assoiciated ucom device on detach.
MFC after:	2 weeks
Reported by:	Ilya Bakulin <webmaster@kibab.com>
Approved by:	imp, cognet
2008-04-16 21:15:10 +00:00
Alexander Motin 6aa6d011e4 Use separate UMA zone for data items allocation. It is a partial
rev. 1.149 rework.
It allows to save several percents of CPU time on SMP by using UMA's
internal per-CPU allocation limits instead of own global variable
each time updated with atomics.

Tested with:    Netperf cluster
2008-04-16 19:52:29 +00:00
Jung-uk Kim 01c3b1b200 Regenerate. 2008-04-16 19:27:36 +00:00
Jung-uk Kim 26833f3f9a Add stubs for syscalls introduced in Linux 2.6.17 kernel.
Some GNU libc version started using them before 2.6.17 was officially out.

MFC after:	3 days
2008-04-16 19:25:39 +00:00
Xin LI 6fda52ba75 Implement fdopendir(3) by splitting __opendir2() into two parts, the upper part
deals with the usual __opendir2() calls, and the rest part with an interface
translator to expose fdopendir(3) functionality.  Manual page was obtained from
kib@'s work for *at(2) system calls.
2008-04-16 18:59:36 +00:00
Randall Stewart 5e2c2d872b Allow SCTP to compile without INET6.
PR:		116816
Obtained from	tuexen@fh-muenster.de:
MFC after:	2 weeks
2008-04-16 17:24:18 +00:00
Kris Kennaway c637bc9203 Replace callout_init(..., 1) with callout_init(..., CALLOUT_MPSAFE) for
better grep-compliance and to standardize with the rest of the kernel.

Reviewed by:	       jhb
MFC after:	       1 week
2008-04-16 16:47:14 +00:00
Doug Rabson a365ea5fba Fix compilation with LOCKF_DEBUG. 2008-04-16 14:08:12 +00:00
Konstantin Belousov eab626f110 Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

The implementation of the lf_purgelocks() is submitted by dfr.

Reported by:	kris
Tested by:	kris, pho
Discussed with:	jeff, dfr
MFC after:	2 weeks
2008-04-16 11:33:32 +00:00
Doug Rabson 92c4ddb268 Tighten up the error-handling in nlm_get_rpc. While I'm here, fix a
couple of spelling mistakes in comments.
2008-04-16 09:09:50 +00:00
Rui Paulo 059c9e5c61 style(9).
Noticed by:	jkim
2008-04-15 22:47:01 +00:00
Alexander Motin 9852972bb5 Several changes breaking netgraph module ABI collected together:
- reorder structures fields (XX_refs) a bit to group fields modified
   same time together. According to my tests it gives up to 10%
   SMP performance benefit on real workload due to reduced inter-CPU
   cache trashing.
 - change q_flags from long to int as long is not really needed there and
   it's usage with atomics is argued by some people.
 - move NGF_WORKQ flag into the separate field q_flags2 as it protected by
   queue mutex instead of node writer protection used by the rest of flags.
 - move nd_work queue entry to ng_queue structure to which it is more
   related and make it STAILQ instead of TAILQ as now it is a classic FIFO.
 - remove q_node pointer from ng_queue structure as it is not really needed.
 - reimplement item queue using STAILQ instead of own equal implementation.
   As soon as BT subsystem has own item queues using ng_item.el_next update
   it also.
 - change depth field in ng_item from uintptr_t to u_int. It was made
   uintptr_t to keep ABI compatibility.

Reviewed by:	julian, emax
Tested with:	Netperf cluster
2008-04-15 21:15:32 +00:00
Jung-uk Kim 8cd892f752 Revert the previous commit and use M_PROMISC flag instead.
It is safer because it will never be used for outgoing packets.
2008-04-15 17:08:24 +00:00
Marcel Moolenaar 22cc9ba0f0 Use genclock for RTC handling. This eliminates the MD versions for
inittodr() and resettodr(). Have nexus double as the clock device,
because it's the firmware that provides RTC services. We could
create a special (pseudo-) device for it, but that wasn't superior
enough to actually do it. Maybe later...

Requested by: phk
2008-04-15 17:02:23 +00:00
Maksim Yevmenkin bc225cd686 Fix possible buffer overrun on 64-bit arch when generating MAC
address for tap interface.

Reported by:	Marc Lorner < marc dot loerner at hob dot de >
Reviewed by:	bms
MFC after:	3 days
2008-04-15 16:54:39 +00:00
David Xu d61f3de656 Implement POSIX function tcgetsid() which returns session id.
PR: stand/107561
2008-04-15 08:33:32 +00:00
Warner Losh 2f68261c81 This file shows signs of heavy borrowing from NetBSD's cache.c file,
so credit its authors with contributions to this file.  Remove
prototype copyright notice, although one might be warranted if someone
wanted to claim it badly enough.

Noticed by: Simon Burge.
2008-04-15 05:35:00 +00:00
Warner Losh 1e231a9a5a Add copyright notice and license to reflect origin of most of the
routines in this file.  Remove 'place holder' copyright since the
amount that's actually original is small relative to the length of the
file.  The contents of this file appear to have originated at DECWRL
by way of NetBSD.

Noticed by: Simon Burge
2008-04-15 05:31:19 +00:00
Marcel Moolenaar 495168ba8d Support and switch to the ULE scheduler:
o  Implement IPI_PREEMPT,
o  Set td_lock for the thread being switched out,
o  For ULE & SMP, loop while td_lock points to blocked_lock for
   the thread being switched in,
o  Enable ULE by default in GENERIC and SKI,
2008-04-15 05:02:42 +00:00
Warner Losh c4738b2d88 This isn't used, so remove it. It isn't relevant to most mips platforms. 2008-04-15 02:50:07 +00:00
Warner Losh b86c3f2930 Copied from amd64, where it wasn't used, into mips, where it wasn't used.
Remove it.
2008-04-15 02:11:57 +00:00
Warner Losh 917ac33d4e This file is unused on amd64. 2008-04-15 02:10:14 +00:00
Warner Losh ee37bddfd4 Remove $P4$ tag. Rumor has it that p4 importer hates it. 2008-04-15 02:09:28 +00:00
Jung-uk Kim 9a3a0f9278 Remove M_SKIP_FIREWALL abuse and add more appropriate check.
Pointyhat to:	jkim
Reported by:	Eugene Grosbein (eugen at kuzbass dot ru)
MFC after:	3 days
2008-04-15 00:50:01 +00:00
Pyun YongHyeon 339a44fb62 Don't touch MSI enable bit in RL_CFG2 register. For unknown reason
clearing MSI enable bit for MSI capable hardwares resulted in Tx
problems. MSI enable bit is set only when MSI is requested from
user.

Tested by:	remko
2008-04-15 00:46:15 +00:00
Marcel Moolenaar 23080c0bd3 Revision 1.9 changes the delivery mode from the magic constant 0
(i.e. fixed delivery) to SAPIC_DELMODE_LOWPRI. While the commit
log doesn't mention the change in behaviour, it is believed to be
deliberate. In the last 5.5 years this hasn't been a problem. Nor
do I think did it make any difference, but who knows. However, I
do know that it break SMP support for Montecito-based machines.
Switch back to fixed-CPU delivery so that SMP works again. This
gives me some time to look more closely at the problem, as well
as make sure the I-cache validation as it's implemented currently
is sufficient in SMP configurations...
2008-04-14 20:34:45 +00:00
Søren Schmidt d90a6aaeb2 Fix problem with slave devices.
Fix or rather bring ENOMEM problems back to the state it was before.
Temporarily disable PortMultipliers on AHCI devices.
2008-04-14 18:34:24 +00:00
Randall Stewart eadccaccf0 Use the pru_flush infrastructure to avoid a panic
PR:		122710
MFC after:	1 week
2008-04-14 18:13:33 +00:00
Randall Stewart 276ca5012c - Have SCTP use the new pru_flush functionality
PR:		122710
MFC after:	1 week
2008-04-14 18:12:37 +00:00
Randall Stewart cf71e4381a Add pru_flush routine so a transport can
flush itself during Shutdown

MFC after:	1 week
2008-04-14 18:06:04 +00:00
Randall Stewart c40e9cf2c1 Protection against errant sender sending a stream
seq number out of order with no missing TSN's (a
cisco box has this problem which will make a ssn
be held forever).
MFC after:	1 week
2008-04-14 14:34:29 +00:00
Randall Stewart 2a3eb019db New logging values. 2008-04-14 14:33:07 +00:00
Randall Stewart 45ccc1a635 1) adds some additional logging
2) changes to use a inqueue_bytes calculated value in max_len calc's.
MFC after:	1 week
2008-04-14 14:32:32 +00:00
Doug Rabson 18121c17f5 When calling lf_advlock to unlock a record, make sure that ap->a_fl->l_type
is F_UNLCK otherwise we trigger a LOCKF_DEBUG panic.

MFC after: 3 days
2008-04-14 09:22:48 +00:00
Poul-Henning Kamp 36bff1ebfb Convert amd64 and i386 to share the atrtc device driver. 2008-04-14 08:00:00 +00:00