Brooks Davis [Fri, 31 Oct 2003 18:32:15 +0000 (18:32 +0000)]
Replace the if_name and if_unit members of struct ifnet with new members
if_xname, if_dname, and if_dunit. if_xname is the name of the interface
and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo
device creation and configuration symantics.
Approved By: re (in principle)
Reviewed By: njl, imp
Tested On: i386, amd64, sparc64
Obtained From: NetBSD (if_xname)
Alan Cox [Fri, 31 Oct 2003 18:32:03 +0000 (18:32 +0000)]
- Take advantage of the swap pager locking: Eliminate the use of Giant
from vm_object_madvise().
- Remove excessive blank lines from vm_object_madvise().
Bruce A. Mah [Fri, 31 Oct 2003 16:58:43 +0000 (16:58 +0000)]
A grab bag of new (but overdue) release note items: dcons(4) and
friends, Pentium 4 and related workarounds, some MPSAFE network
drivers, IPv6 supports RFC 3542 (Advanced Sockets API), ifconfig(8)
staticarp, libkse default threading library for ia64.
Hajimu UMEMOTO [Fri, 31 Oct 2003 16:21:26 +0000 (16:21 +0000)]
(icmp6_rip6_input) if the received data is small enough but in an
mbuf cluster, copy the data to a separate mbuf that do not use a
cluster. this change will reduce the possiblity of packet loss
in the socket layer.
Hartmut Brandt [Fri, 31 Oct 2003 13:35:22 +0000 (13:35 +0000)]
Fix breakage on ia64: PAGE_SIZE on ia64 is large enough that more than
256 raw receive buffers (96 byte each) fit into one page. This breaks the
limit imposed by the usage of an uint8_t for the buffer number. Restrict
the allocation size for buffers to a maximum of 8192.
Tim J. Robbins [Fri, 31 Oct 2003 13:29:00 +0000 (13:29 +0000)]
Don't bother passing a freshly-zeroed mbstate to mbsrtowcs() etc.
when the current implementation won't use it, anyway. Just pass NULL.
This will need to be changed when state-dependent encodings are
supported, but there's no need to take the performance hit
in the meantime.
Ruslan Ermilov [Fri, 31 Oct 2003 13:15:07 +0000 (13:15 +0000)]
Combining "all" and "install" in one invocation is a very bad idea as
conditional evaluation is done only once in this case, and this may
not account for the fact that some conditionals would be evaluated
differently if "all" has already been run, like is the case with the
loader.help existance check in sys/boot/alpha/common/Makefile.common,
beforeinstall target. This should fix Alpha snapshot builds.
Jeff Roberson [Fri, 31 Oct 2003 11:16:04 +0000 (11:16 +0000)]
- Add static to local functions and data where it was missing.
- Add an IPI based mechanism for migrating kses. This mechanism is
broken down into several components. This is intended to reduce cache
thrashing by eliminating most cases where one cpu touches another's
run queues.
- kseq_notify() appends a kse to a lockless singly linked list and
conditionally sends an IPI to the target processor. Right now this is
protected by sched_lock but at some point I'd like to get rid of the
global lock. This is why I used something more complicated than a
standard queue.
- kseq_assign() processes our list of kses that have been assigned to us
by other processors. This simply calls sched_add() for each item on the
list after clearing the new KEF_ASSIGNED flag. This flag is used to
indicate that we have been appeneded to the assigned queue but not
added to the run queue yet.
- In sched_add(), instead of adding a KSE to another processor's queue we
use kse_notify() so that we don't touch their queue. Also in sched_add(),
if KEF_ASSIGNED is already set return immediately. This can happen if
a thread is removed and readded so that the priority is recorded properly.
- In sched_rem() return immediately if KEF_ASSIGNED is set. All callers
immediately readd simply to adjust priorites etc.
- In sched_choose(), if we're running an IDLE task or the per cpu idle thread
set our cpumask bit in 'kseq_idle' so that other processors may know that
we are idle. Before this, make a single pass through the run queues of
other processors so that we may find work more immediately if it is
available.
- In sched_runnable(), don't scan each processor's run queue, they will IPI
us if they have work for us to do.
- In sched_add(), if we're adding a thread that can be migrated and we have
plenty of work to do, try to migrate the thread to an idle kseq.
- Simplify the logic in sched_prio() and take the KEF_ASSIGNED flag into
consideration.
- No longer use kseq_choose() to steal threads, it can lose it's last
argument.
- Create a new function runq_steal() which operates like runq_choose() but
skips threads based on some criteria. Currently it will not steal
PRI_ITHD threads. In the future this will be used for CPU binding.
- Create a kseq_steal() that checks each run queue with runq_steal(), use
kseq_steal() in the places where we used kseq_choose() to steal with
before.
Marcel Moolenaar [Fri, 31 Oct 2003 07:29:28 +0000 (07:29 +0000)]
Fix two bugs introduced with the rstack functionality and specific to
the rstack functionality:
1. Fix a KASSERT that tests for the address to be above the upward
growable stack. Typically for rstack, the faulting address can be
identical to the record end of the upward growable entry, and
very likely is on ia64. The KASSERT tested for greater than, not
greater equal, so whenever the register stack had to be grown
the assertion fired.
2. When we grow the upward growable stack entry and adjust the
unlying object, don't forget to adjust the size of the VM map.
Not doing so would trigger an assert in vm_mapzdtor().
Pointy hat: marcel (for not testing with INVARIANTS).
Don Lewis [Fri, 31 Oct 2003 07:25:06 +0000 (07:25 +0000)]
Tweak the calculation of minbfree in ffs_dirpref() so that only
those cylinder groups that have at least 75% of the average free
space per cylinder group for that file system are considered as
candidates for the creation of a new directory. The previous formula
for minbfree would set it to zero if the file system was more than
75% full, which allowed cylinder groups with no free space at all
to be chosen as candidates for directory creation, which resulted
in an expensive search for free blocks for each file that was
subsequently created in that directory.
Modify the calculation of minifree in the same way.
Decrease maxcontigdirs as the file system fills to decrease the
likelyhood that a cluster of directories will overflow the available
space in a cylinder group.
Peter Wemm [Fri, 31 Oct 2003 05:42:53 +0000 (05:42 +0000)]
While not illegal, attempt to pacify gcc -Wundef. It just so happens
that libtool-using packages seem to love using this flag.
/usr/include/sys/cdefs.h:184:5: warning: "__STDC_VERSION__" is not defined
/usr/include/sys/cdefs.h:372:5: warning: "_POSIX_C_SOURCE" is not defined
/usr/include/sys/cdefs.h:378:5: warning: "_POSIX_C_SOURCE" is not defined
Sam Leffler [Thu, 30 Oct 2003 23:02:51 +0000 (23:02 +0000)]
Overhaul routing table entry cleanup by introducing a new rtexpunge
routine that takes a locked routing table reference and removes all
references to the entry in the various data structures. This
eliminates instances of recursive locking and also closes races
where the lock on the entry had to be dropped prior to calling
rtrequest(RTM_DELETE). This also cleans up confusion where the
caller held a reference to an entry that might have been reclaimed
(and in some cases used that reference).
Peter Wemm [Thu, 30 Oct 2003 22:15:22 +0000 (22:15 +0000)]
Change the pmap_invalidate_xxx() functions so they test against
pmap == kernel_pmap rather than pmap->pm_active == -1. gcc's inliner
can remove more code that way. Only kernel_pmap has a pm_active of -1.
Hajimu UMEMOTO [Thu, 30 Oct 2003 17:46:40 +0000 (17:46 +0000)]
add ip6addrctl(8) which is a command to configure address
selection policy for IPv6 and IPv4 described in RFC3484.
source address selection part of RFC3484 is not merged
from KAME, yet.
Hajimu UMEMOTO [Thu, 30 Oct 2003 17:36:53 +0000 (17:36 +0000)]
add destination address selection described in RFC3484.
in KAME implementation, even when no policy is installed
into kernel, getaddrinfo(3) sorts addresses. Since it
causes POLA violation, I modified to don't sort addresses
when no policy is installed into kernel,
Hartmut Brandt [Thu, 30 Oct 2003 16:19:50 +0000 (16:19 +0000)]
Explain why the lock-free allocation algorithm is safe in our case
while beeing not safe in the general case. Thanks to David Schultz
<das@freebsd.org> for help.
Hartmut Brandt [Thu, 30 Oct 2003 15:14:34 +0000 (15:14 +0000)]
Use (char *)NULL to terminated to argument list for execl().
Without this cast the compiler cannot know that it has to convert
the null pointer constant NULL to a null pointer.
Hartmut Brandt [Thu, 30 Oct 2003 15:04:37 +0000 (15:04 +0000)]
Use (char *)NULL to terminate the argument list for execlp().
Without this cast the compiler cannot know that it has to convert the
null pointer constant NULL to a null pointer.
Hartmut Brandt [Thu, 30 Oct 2003 10:43:52 +0000 (10:43 +0000)]
Reinvent the used-flag for external mbufs. This and the on-card flag
are now in the header of the external buffer itself which allows us
to manipulate them in the free routine without having to lock the softc
structure or the free list. To get space for these flags the chunk number
is reduced to 8 bit which amounts to a maximum of 256 chunks per allocated
page. This restriction is now enforced by a CTASSERT.
David Xu [Thu, 30 Oct 2003 02:55:43 +0000 (02:55 +0000)]
Try to fetch thread mailbox address in page fault trap, so when thread
blocks in page fault hanlder, and upcall thread can be scheduled. It is
useful if process is doing lots of mmap based I/O.
Peter Wemm [Thu, 30 Oct 2003 02:40:30 +0000 (02:40 +0000)]
Add CTASSERT()'s to check that the sizes of our replicas of the 32 bit
structures come out the right size.
Fix the ones that broke. stat32 had some missing fields from the end
and statfs32 was broken due to the strange definition of MNAMELEN
(which is dependent on sizeof(long))
I'm not sure if this fixes any actual problems or not.
Daniel Eischen [Wed, 29 Oct 2003 21:54:37 +0000 (21:54 +0000)]
Don't attempt to destroy the driver mutex when it hasn't yet
been created. This has been sitting in my local tree for
far too long; I can't believe noone else has come across this
yet.
Sam Leffler [Wed, 29 Oct 2003 19:15:00 +0000 (19:15 +0000)]
Potential fix for races shutting down callouts when unloading
the module. Previously we grabbed the mutex used by the callouts,
then stopped the callout with callout_stop, but if the callout
was already active and blocked by the mutex then it would continue
later and reference the mutex after it was destroyed. Instead
stop the callout first then lock.
Sam Leffler [Wed, 29 Oct 2003 19:03:58 +0000 (19:03 +0000)]
o add locking to protect routing table refcnt manipulations
o add some more debugging help for figuring out why folks are
getting complaints about releasing routing table entries with
a zero refcnt
o fix comment that talked about spl's
o remove duplicate define of DUMMYNET_DEBUG
Sam Leffler [Wed, 29 Oct 2003 18:37:47 +0000 (18:37 +0000)]
Always queue looped back packets (rather than potentially using
direct dispatch) to avoid extensive kernel stack usage and to
avoid directly re-entering the network stack. The latter causes
locking problems when, for example, a complete TCP handshake`
happens w/o a context switch.
Sam Leffler [Wed, 29 Oct 2003 18:29:50 +0000 (18:29 +0000)]
Add a temporary mechanism to disble INTR_MPSAFE from network interface
drivers. This is prepatory to running more parts of the network system
w/o Giant.