]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 years agoUpdate bus_setup_intr() man page after recent newbus modification:
piso [Wed, 28 Feb 2007 23:13:41 +0000 (23:13 +0000)]
Update bus_setup_intr() man page after recent newbus modification:

o uniform the driver_intr_t parameter name to 'ithread'

o delete any reference to INTR_FAST

o document a bit the difference between the filter and ithread
  argument

Reviewed by: mdoc-police (ru)

17 years agoIncrease helpfulness in diagnostic message - ypbind running without -ypset or
jmallett [Wed, 28 Feb 2007 22:49:12 +0000 (22:49 +0000)]
Increase helpfulness in diagnostic message - ypbind running without -ypset or
-ypsetme will prevent use of ypset.  Remind the user to check that it was
started correctly.

17 years agoMore cleanup for rev. 1.56
brueffer [Wed, 28 Feb 2007 22:40:21 +0000 (22:40 +0000)]
More cleanup for rev. 1.56

Submitted by: ru

17 years agoPrepare for 802.1p:
bms [Wed, 28 Feb 2007 22:05:30 +0000 (22:05 +0000)]
Prepare for 802.1p:
 Add macro EVL_APPLY_VLID() which may be used to apply an 802.1q VLAN ID
 to the M_VLANTAG field in an mbuf packet header non-destructively.
 This will be used by net80211 to begin with.

 Add macro EVL_APPLY_PRI() which may be used to apply an 802.1p priority
 class to the M_VLANTAG field in an mbuf packet header non-destructively.

 Add other macros for manipulating tags and the CFI bit.

Submitted by: Boris Kovalenko (EVL_CFIOFTAG(), EVL_MAKETAG())

17 years agoAdd comments about common idioms for cleanup pass at a later date.
bms [Wed, 28 Feb 2007 21:58:37 +0000 (21:58 +0000)]
Add comments about common idioms for cleanup pass at a later date.

17 years agomdoc cleanup for the previous commit and touch .Dd
brueffer [Wed, 28 Feb 2007 21:36:11 +0000 (21:36 +0000)]
mdoc cleanup for the previous commit and touch .Dd

17 years agoDocument removal of addr2ascii/ascii2addr and addition of AF_LINK
bms [Wed, 28 Feb 2007 21:33:40 +0000 (21:33 +0000)]
Document removal of addr2ascii/ascii2addr and addition of AF_LINK
support for getnameinfo.

17 years agoDocument the AF_LINK extension which was imported from NetBSD.
bms [Wed, 28 Feb 2007 21:28:33 +0000 (21:28 +0000)]
Document the AF_LINK extension which was imported from NetBSD.

17 years agoNuke ascii2addr() and addr2ascii(). They have no consumers anywhere
bms [Wed, 28 Feb 2007 21:18:38 +0000 (21:18 +0000)]
Nuke ascii2addr() and addr2ascii(). They have no consumers anywhere
in FreeBSD, and originated from INRIA IPv6.

Stub out netstat reference to addr2ascii() I mistakenly introduced.
Update misleading man page sections.

Merge NetBSD's getnameinfo() AF_LINK extensions for a portable way to
print link-layer addresses given a sockaddr_dl(), minus the IEEE 1394
bits which don't map directly to our code.

Obtained from: NetBSD (getnameinfo.c)
Discussed on: current (March 2006)

17 years agoIn the SYN_SENT case, Initialize the snd_wnd before the call to tcp_mss().
mohans [Wed, 28 Feb 2007 20:48:00 +0000 (20:48 +0000)]
In the SYN_SENT case, Initialize the snd_wnd before the call to tcp_mss().
The TCP hostcache logic in tcp_mss() depends on the snd_wnd being initialized.

17 years agoRemove code which would never be used, viz a viz Quality-of-Service;
bms [Wed, 28 Feb 2007 20:32:25 +0000 (20:32 +0000)]
Remove code which would never be used, viz a viz Quality-of-Service;
the token bucket filter got killed in netinet, so it gets killed here
too. Correct comments.

17 years agoAdd a comment about a struct which needs to be global.
bms [Wed, 28 Feb 2007 20:29:20 +0000 (20:29 +0000)]
Add a comment about a struct which needs to be global.
Remove an unused global variable.
Staticize variables which do not need to be global.

17 years agoResurrect one of the patches from attic and refine the
ru [Wed, 28 Feb 2007 20:06:21 +0000 (20:06 +0000)]
Resurrect one of the patches from attic and refine the
lib32 build somewhat.  Specifically, instead of spamming
${CC} et al with -I${LIB32TMP}/usr/include which can be
harmful (as has been demonstrated by the ncursesw WIP),
use slightly different approach to achieve the same goal.
This also simplifies things a bit.

Prodded by: rafan

17 years agoStyle: Move declaration of subsystem mutex to where other
bms [Wed, 28 Feb 2007 20:02:24 +0000 (20:02 +0000)]
Style: Move declaration of subsystem mutex to where other
mutexes are in this file, and use macros for dealing with it.

17 years agoUpdate the tcp(4) manpage with the new (and some older undocumented) sysctls.
mohans [Wed, 28 Feb 2007 19:32:46 +0000 (19:32 +0000)]
Update the tcp(4) manpage with the new (and some older undocumented) sysctls.
Remove a sysctl that is no longer used.

17 years agoMinor reformatting.
thomas [Wed, 28 Feb 2007 16:51:52 +0000 (16:51 +0000)]
Minor reformatting.

17 years agoInternational code for Russian Ruble is changed from RUR to RUB
ache [Wed, 28 Feb 2007 16:28:49 +0000 (16:28 +0000)]
International code for Russian Ruble is changed from RUR to RUB
starting from 1.1.2001 (ISO 4217)

17 years agoAdd EHOSTDOWN and ENETUNREACH to the list of soft errors, that shouldn't
glebius [Wed, 28 Feb 2007 12:47:49 +0000 (12:47 +0000)]
Add EHOSTDOWN and ENETUNREACH to the list of soft errors, that shouldn't
be returned up to the caller.

PR: 100172
Submitted by: "Andrew - Supernews" <andrew supernews.net>
Reviewed by: rwatson, bms

17 years agoToss the code, that handles errors from ip_output(), to make it more
glebius [Wed, 28 Feb 2007 12:41:49 +0000 (12:41 +0000)]
Toss the code, that handles errors from ip_output(), to make it more
readable:
- Merge two embedded if() into one.
- Introduce switch() block to handle different kinds of errors.

Reviewed by: rwatson, bms

17 years agoFix markup.
ru [Wed, 28 Feb 2007 10:29:48 +0000 (10:29 +0000)]
Fix markup.

17 years agoFix a nit noticed during translation.
ru [Wed, 28 Feb 2007 10:24:34 +0000 (10:24 +0000)]
Fix a nit noticed during translation.

17 years agoBackport markup fixes from a translated version of a manpage.
ru [Wed, 28 Feb 2007 10:22:19 +0000 (10:22 +0000)]
Backport markup fixes from a translated version of a manpage.

17 years agoCheck in some insignificant fixes obtained as a result of
ru [Wed, 28 Feb 2007 10:19:25 +0000 (10:19 +0000)]
Check in some insignificant fixes obtained as a result of
the translation work.

17 years ago- Adopt the short description from POSIX as it better matches the
ru [Wed, 28 Feb 2007 10:13:32 +0000 (10:13 +0000)]
- Adopt the short description from POSIX as it better matches the
  utility name.

- Fix a bug in description: the range preceded by a dash selects
  up to the last number, not first.

17 years agoRevert previous change and take back a pointy hat.
ru [Wed, 28 Feb 2007 09:04:46 +0000 (09:04 +0000)]
Revert previous change and take back a pointy hat.

17 years agoLock unp2 after checking for a non-NULL unp2 pointer in uipc_send() on
rwatson [Wed, 28 Feb 2007 08:08:50 +0000 (08:08 +0000)]
Lock unp2 after checking for a non-NULL unp2 pointer in uipc_send() on
datagram UNIX domain sockets, not before.

17 years agoFix panic on boot caused by setting up a NULL interrupt handler.
ru [Wed, 28 Feb 2007 05:29:23 +0000 (05:29 +0000)]
Fix panic on boot caused by setting up a NULL interrupt handler.

Submitted by: Goran Gajic
Pointy hat to: piso

17 years agoAdd a comment for PRIV_NET_SETLLADDR.
pjd [Tue, 27 Feb 2007 23:38:58 +0000 (23:38 +0000)]
Add a comment for PRIV_NET_SETLLADDR.

OK'ed by: rwatson

17 years agoFurhter clarifications:
grog [Tue, 27 Feb 2007 23:09:31 +0000 (23:09 +0000)]
Furhter clarifications:

- the issues with wakeup_one are due to address space clashes between
  unrelated groups of threads.
- sleep() was removed in FreeBSD 2.2.
- date the page today, not 4 days ago.
- replace grammatically correct "woken" with "woken up" for
  consistency with the function name.

17 years agoSome USB mass storage devices return the number of sectors in response
imp [Tue, 27 Feb 2007 22:33:50 +0000 (22:33 +0000)]
Some USB mass storage devices return the number of sectors in response
to a READ_CAPACITY request rather than the maximum sector (off by one
problem).  This causes a huge cascade of errors as the geom tasting
code tries to read the last sector (which isn't really there in the
face of this error).  automated tools that manipulate disk labels and
such also have issues.

Create a new quirk READ_CAPACITY_OFFBY1 and add a quirk for the
SanDISK ImageMate that I have that suffers from this problem (the
SDDR-31).  It intercepts the READ_CAPACITY response and adjusts it
from number of sectors to max sector for devices with this quirk.

Reading the Linux source suggests that there are a host of
other devices with this issue, including iPods and some popular
cameras.  I've not added quirks for them, since I don't have the
devices in front of me to test.

17 years agoEntries sorted by id number, not name
imp [Tue, 27 Feb 2007 22:27:53 +0000 (22:27 +0000)]
Entries sorted by id number, not name

17 years agoUse pause() in vm_object_deallocate() to yield the CPU to the lock holder
jhb [Tue, 27 Feb 2007 19:40:26 +0000 (19:40 +0000)]
Use pause() in vm_object_deallocate() to yield the CPU to the lock holder
rather than a tsleep() on &proc0.  The only wakeup on &proc0 is intended
to awaken the swapper, not random threads blocked in
vm_object_deallocate().

17 years agoPrint tid's rather than thread pointers in KTR_PROC traces.
jhb [Tue, 27 Feb 2007 18:46:07 +0000 (18:46 +0000)]
Print tid's rather than thread pointers in KTR_PROC traces.

17 years agoUse taskqueue_drain() to wait for any pending tasks to complete rather
jhb [Tue, 27 Feb 2007 18:45:37 +0000 (18:45 +0000)]
Use taskqueue_drain() to wait for any pending tasks to complete rather
than just pausing for a second.

17 years agoUse pause() instead of tsleep()'s on the softc pointer that have no
jhb [Tue, 27 Feb 2007 17:27:23 +0000 (17:27 +0000)]
Use pause() instead of tsleep()'s on the softc pointer that have no
corresponding wakeups.  Also, at least some of the comments nearby indicate
that these are fixed-length I/O sleeps.

17 years agoUse pause() rather than tsleep() on stack variables and function pointers.
jhb [Tue, 27 Feb 2007 17:23:29 +0000 (17:23 +0000)]
Use pause() rather than tsleep() on stack variables and function pointers.

17 years agoUse pause() rather than tsleep() on explicit global dummy variables.
jhb [Tue, 27 Feb 2007 17:22:30 +0000 (17:22 +0000)]
Use pause() rather than tsleep() on explicit global dummy variables.

17 years agoUse pause() rather than using tsleep() on a dummy variable.
jhb [Tue, 27 Feb 2007 17:19:33 +0000 (17:19 +0000)]
Use pause() rather than using tsleep() on a dummy variable.

17 years agoAlways protect the kthread flags with the lock and close a race with
jhb [Tue, 27 Feb 2007 17:16:52 +0000 (17:16 +0000)]
Always protect the kthread flags with the lock and close a race with
module unload and kthread_exit().

MFC after: 3 days

17 years agoUse tsleep() rather than msleep() with a NULL mtx.
jhb [Tue, 27 Feb 2007 17:15:39 +0000 (17:15 +0000)]
Use tsleep() rather than msleep() with a NULL mtx.

17 years agoo consistently check strlcpy result
sam [Tue, 27 Feb 2007 17:11:18 +0000 (17:11 +0000)]
o consistently check strlcpy result
o warn when we skip an interface because it's name is too long

17 years agoDo not execute filter only handlers in ithread_execute_handlers():
piso [Tue, 27 Feb 2007 17:09:20 +0000 (17:09 +0000)]
Do not execute filter only handlers in ithread_execute_handlers():
this fixes the panics when filter only and ithread only handlers where
sharing the same irq .

17 years agocorrect type to silence const complaint
sam [Tue, 27 Feb 2007 17:03:22 +0000 (17:03 +0000)]
correct type to silence const complaint

17 years agounbreak create operation, must copy argument to global name
sam [Tue, 27 Feb 2007 17:00:59 +0000 (17:00 +0000)]
unbreak create operation, must copy argument to global name

Spotted by: des

17 years agoFix obvious typo (use long name if short name isn't provided).
flz [Tue, 27 Feb 2007 16:52:27 +0000 (16:52 +0000)]
Fix obvious typo (use long name if short name isn't provided).

Reviewed by: sam
MFC after: 3 days

17 years agoIn FreeBSD 5.x+, sleep/wakeup operate on threads, not processes.
jhb [Tue, 27 Feb 2007 16:32:55 +0000 (16:32 +0000)]
In FreeBSD 5.x+, sleep/wakeup operate on threads, not processes.

17 years agoFix markup and grammar bugs in recent revisions.
ru [Tue, 27 Feb 2007 16:21:01 +0000 (16:21 +0000)]
Fix markup and grammar bugs in recent revisions.

17 years agoRemove a (harmless) stray backslash.
ru [Tue, 27 Feb 2007 16:13:19 +0000 (16:13 +0000)]
Remove a (harmless) stray backslash.

17 years agoAdd proper return codes to zs_intr() filter, and fix accordinlgly zs_intr()
piso [Tue, 27 Feb 2007 15:31:11 +0000 (15:31 +0000)]
Add proper return codes to zs_intr() filter, and fix accordinlgly zs_intr()
prototype.

17 years agoAdd INADDR_ALLRPTS_GROUP define for 224.0.0.22 for future IGMPv3 support.
bms [Tue, 27 Feb 2007 14:45:37 +0000 (14:45 +0000)]
Add INADDR_ALLRPTS_GROUP define for 224.0.0.22 for future IGMPv3 support.

Obtained from: OpenSolaris

17 years agoMake hosts.allow point to hosts_options instead.
n_hibma [Tue, 27 Feb 2007 14:22:07 +0000 (14:22 +0000)]
Make hosts.allow point to hosts_options instead.

Requested by:  ru

17 years agoCorrect return code (int) for at91_rtc_intr() prototype.
piso [Tue, 27 Feb 2007 13:39:34 +0000 (13:39 +0000)]
Correct return code (int) for at91_rtc_intr() prototype.

Approved by: cognet

17 years agoClean the lib32 object directory with cleandir rather than rm -rf.
des [Tue, 27 Feb 2007 13:02:29 +0000 (13:02 +0000)]
Clean the lib32 object directory with cleandir rather than rm -rf.

Discussed with: ru
MFC after: 2 weeks

17 years agoFix markup.
ru [Tue, 27 Feb 2007 12:06:02 +0000 (12:06 +0000)]
Fix markup.

17 years agoAdd GEOM_MULTIPATH so LINT will build.
des [Tue, 27 Feb 2007 12:05:25 +0000 (12:05 +0000)]
Add GEOM_MULTIPATH so LINT will build.

Pointy hat to: mjacob

17 years agoFix markup.
ru [Tue, 27 Feb 2007 11:25:58 +0000 (11:25 +0000)]
Fix markup.

17 years ago(cam_rescan): Do not reference ccb->ccb_h.path in CAM_DEBUG call before
thomas [Tue, 27 Feb 2007 09:00:51 +0000 (09:00 +0000)]
(cam_rescan): Do not reference ccb->ccb_h.path in CAM_DEBUG call before
it is initialized; use path instead.

This change fixes a panic when using atapicam in conjunction with CAMDEBUG,
which has been described under kern/103602.

Thanks to Josh Carroll <josh.carroll@gmail.com> for providing the traces
that allowed identifying this problem.

PR: kern/103602
MFC after: 1 week

17 years agoCall the multipath device with its real name.
ale [Tue, 27 Feb 2007 08:56:11 +0000 (08:56 +0000)]
Call the multipath device with its real name.

17 years agoFirst cleanup pass: new sentence -> new line, typos fixed, some markup
brueffer [Tue, 27 Feb 2007 07:53:20 +0000 (07:53 +0000)]
First cleanup pass: new sentence -> new line, typos fixed, some markup
errors fixed.

17 years agoKASSERT fails when the condition is false, not when it is true.
mckusick [Tue, 27 Feb 2007 07:34:28 +0000 (07:34 +0000)]
KASSERT fails when the condition is false, not when it is true.

17 years agoAdd a man page.
mjacob [Tue, 27 Feb 2007 07:29:15 +0000 (07:29 +0000)]
Add a man page.

17 years agoFix an error in dumping large sparse files containing extended attributes.
mckusick [Tue, 27 Feb 2007 07:28:17 +0000 (07:28 +0000)]
Fix an error in dumping large sparse files containing extended attributes.

17 years agoFurther improvements to LOCK_PROFILING:
kmacy [Tue, 27 Feb 2007 06:42:05 +0000 (06:42 +0000)]
Further improvements to LOCK_PROFILING:
 - Fix missing initialization in kern_rwlock.c causing bogus times to be collected
 - Move updates to the lock hash to after the lock is released for spin mutexes,
   sleep mutexes, and sx locks
 - Add new kernel build option LOCK_PROFILE_FAST - only update lock profiling
   statistics when an acquisition is contended. This reduces the overhead of
   LOCK_PROFILING to increasing system time by 20%-25% which on
   "make -j8 kernel-toolchain" on a dual woodcrest is unmeasurable in terms
   of wall-clock time. Contrast this to enabling lock profiling without
   LOCK_PROFILE_FAST and I see a 5x-6x slowdown in wall-clock time.

17 years agoUpdate HISTORY.
grog [Tue, 27 Feb 2007 05:39:22 +0000 (05:39 +0000)]
Update HISTORY.

Reviewed by: dmr

17 years agoFixed some style bugs (whitespace lossage for removal of __P(()), and
bde [Tue, 27 Feb 2007 05:10:36 +0000 (05:10 +0000)]
Fixed some style bugs (whitespace lossage for removal of __P(()), and
lots of naming and typing errors involving `interval').

17 years agoUse a periodic itimer instead of repeated calls to alarm() in
bde [Tue, 27 Feb 2007 04:54:33 +0000 (04:54 +0000)]
Use a periodic itimer instead of repeated calls to alarm() in
sidewaysintpr().  This increases the accuracy of the per-interval
counts when they are interpreted as rates.  Repeated calls to alarm(n)
give an average interval that is about 2 ticks larger than n and has
a large variance.  Periodic itimers normally get the average almost
right but have similarly large variance (due to scheduling delays).

Statistics utilities should use clock_gettime() to determine the
actual interval, but it is still useful to maximize the accuracy of
the interval, especially for cases like netstat -w where counts are
displayed so the program cannot hide the inaccuracy in a rate
conversion.

17 years agoFirst cut at GEOM based multipath. This is an active/passive{/passive...}
mjacob [Tue, 27 Feb 2007 04:01:58 +0000 (04:01 +0000)]
First cut at GEOM based multipath. This is an active/passive{/passive...}
arrangement that has no intrinsic internal knowledge of whether devices
it is given are truly multipath devices. As such, this is a simplistic
approach, but still a useful one.

The basic approach is to (at present- this will change soon) use camcontrol
to find likely identical devices and and label the trailing sector of the
first one. This label contains both a full UUID and a name. The name is
what is presented in /dev/multipath, but the UUID is used as a true
distinguishor at g_taste time, thus making sure we don't have chaos
on a shared SAN where everyone names their data multipath as "Fred".

The first of N identical devices (and N *may* be 1!) becomes the active
path until a BIO request is failed with EIO or ENXIO. When this occurs,
the active disk is ripped away and the next in a list is picked to
(retry and) continue with.

During g_taste events new disks that meet the match criteria for existing
multipath geoms get added to the tail end of the list.

Thus, this active/passive setup actually does work for devices which
go away and come back, as do (now) mpt(4) and isp(4) SAN based disks.

There is still a lot to do to improve this- like about 5 of the 12
recommendations I've received about it,  but it's been functional enough
for a while that it deserves a broader test base.

Reviewed by: pjd
Sponsored by: IronPort Systems
MFC: 2 months

17 years agoAdd warning about deadlocks created by use of wakeup_one.
grog [Tue, 27 Feb 2007 02:51:41 +0000 (02:51 +0000)]
Add warning about deadlocks created by use of wakeup_one.

17 years agoMFP4: 115094
jkim [Tue, 27 Feb 2007 02:08:01 +0000 (02:08 +0000)]
MFP4: 115094

Linux does not check file descriptor when MAP_ANONYMOUS is set.
This should fix recent LTP test regressions.

Reported by: Scot Hetzel (swhetzel at gmail dot com)
netchild

17 years agoReplace spaces with tabs in some places.
pjd [Tue, 27 Feb 2007 01:48:58 +0000 (01:48 +0000)]
Replace spaces with tabs in some places.

17 years agoRework EC I/O approach. Implement burst mode, including proper handling of
njl [Tue, 27 Feb 2007 00:14:20 +0000 (00:14 +0000)]
Rework EC I/O approach.  Implement burst mode, including proper handling of
case where it asynchronously exits burst mode on its own.  Handle different
values of hz in sleep loop.  Provide more debugging options to tune EC
behavior.  These tunables/sysctls may be temporary and are not for user
access if the EC is working properly.  Burst mode is now on by default for
testing and the poll interval has been increased from 100 to 500 us and
total timeout from 100 to 500 ms.

Hopefully this should be the first step of addressing reports of timeout
errors during battery or thermal access, especially on HP/Compaq laptops.
It is reasonably stable and should not cause a loss of functionality or
performance on systems that were previously working.  Testing shows an
increase of responsiveness by ~75% on one system.

PR: kern/98171

17 years agoReap FIN_WAIT_2 connections marked SOCANTRCVMORE faster. This mitigate
mohans [Mon, 26 Feb 2007 22:25:21 +0000 (22:25 +0000)]
Reap FIN_WAIT_2 connections marked SOCANTRCVMORE faster. This mitigate
potential issues where the peer does not close, potentially leaving
thousands of connections in FIN_WAIT_2. This is controlled by a new sysctl
fast_finwait2_recycle, which is disabled by default.

Reviewed by: gnn, silby.

17 years agoAdd three new ioctl(2) commands for bpf(4).
jkim [Mon, 26 Feb 2007 22:24:14 +0000 (22:24 +0000)]
Add three new ioctl(2) commands for bpf(4).

- BIOCGDIRECTION and BIOCSDIRECTION get or set the setting determining
whether incoming, outgoing, or all packets on the interface should be
returned by BPF.  Set to BPF_D_IN to see only incoming packets on the
interface.  Set to BPF_D_INOUT to see packets originating locally and
remotely on the interface.  Set to BPF_D_OUT to see only outgoing
packets on the interface.  This setting is initialized to BPF_D_INOUT
by default.  BIOCGSEESENT and BIOCSSEESENT are obsoleted by these but
kept for backward compatibility.

- BIOCFEEDBACK sets packet feedback mode.  This allows injected packets
to be fed back as input to the interface when output via the interface is
successful.  When BPF_D_INOUT direction is set, injected outgoing packet
is not returned by BPF to avoid duplication.  This flag is initialized to
zero by default.

Note that libpcap has been modified to support BPF_D_OUT direction for
pcap_setdirection(3) and PCAP_D_OUT direction is functional now.

Reviewed by: rwatson

17 years agoRevise locking strategy used for UNIX domain sockets in order to improve
rwatson [Mon, 26 Feb 2007 20:47:52 +0000 (20:47 +0000)]
Revise locking strategy used for UNIX domain sockets in order to improve
concurrency:

- Add per-unpcb mutexes protecting unpcb connection state, fields, etc.

- Replace global UNP mutex with a global UNP rwlock, which will protect the
  UNIX domain socket connection topology, v_socket, and be acquired
  exclusively before acquiring more than per-unpcb at a time in order to
  avoid lock order issues.

In performance measurements involving MySQL, this change has little or no
overhead on UP (+/- 1%), but leads to a significant (5%-30%) improvement in
multi-processor measurements using the sysbench and supersmack benchmarks.

Much testing by: kris
Approved by: re (kensmith)

17 years agoUse NULL rather than 0 for various pointer constants.
jhb [Mon, 26 Feb 2007 19:28:18 +0000 (19:28 +0000)]
Use NULL rather than 0 for various pointer constants.

17 years agoAdd rw_wowned(9) symlink.
rwatson [Mon, 26 Feb 2007 19:09:36 +0000 (19:09 +0000)]
Add rw_wowned(9) symlink.

17 years agoUpdate rwlock(9) for rw_wowned().
rwatson [Mon, 26 Feb 2007 19:07:41 +0000 (19:07 +0000)]
Update rwlock(9) for rw_wowned().

17 years agoAdd rw_wowned() interface to rwlock(9), allowing a kernel thread to
rwatson [Mon, 26 Feb 2007 19:05:13 +0000 (19:05 +0000)]
Add rw_wowned() interface to rwlock(9), allowing a kernel thread to
determine if it holds an exclusive rwlock reference or not.  This is
non-ideal, but recursion scenarios in the network stack currently
require it.

Approved by: jhb

17 years agoMark the kernel linker file as linked so that it is visible to the various
jhb [Mon, 26 Feb 2007 16:48:14 +0000 (16:48 +0000)]
Mark the kernel linker file as linked so that it is visible to the various
kld*() syscalls.

Tested by: piso

17 years agoFix a comment.
jhb [Mon, 26 Feb 2007 16:36:48 +0000 (16:36 +0000)]
Fix a comment.

17 years agoDocument m_pulldown().
bms [Mon, 26 Feb 2007 15:17:19 +0000 (15:17 +0000)]
Document m_pulldown().

Obtained from: MBUF issues in 4.4BSD IPv6/IPsec support (itojun)

17 years agoFix include declaration it was sys/sctp.h should be netinet/sctp.h,
rrs [Mon, 26 Feb 2007 12:23:32 +0000 (12:23 +0000)]
Fix include declaration it was sys/sctp.h should be netinet/sctp.h,
reported by pluknet@gmail.com.

17 years agoMark data structures used on the wire with IPX SAP as __packed so that
rwatson [Mon, 26 Feb 2007 12:07:08 +0000 (12:07 +0000)]
Mark data structures used on the wire with IPX SAP as __packed so that
they are not inappropriately padded as a result of compiler changes.

PR: kern/74105
Submitted by: Bob Johnson <bob89 at eng dot ufl dot edu>

17 years agoBuild ipx_ip.c only if options IPXIP is defined. No functional change.
rwatson [Mon, 26 Feb 2007 11:55:34 +0000 (11:55 +0000)]
Build ipx_ip.c only if options IPXIP is defined.  No functional change.

17 years agoDon't block on the socket zone limit during the socket()
ru [Mon, 26 Feb 2007 10:45:21 +0000 (10:45 +0000)]
Don't block on the socket zone limit during the socket()
call which can easily lock up a system otherwise; instead,
return ENOBUFS as documented in a manpage, thus reverting
us to the FreeBSD 4.x behavior.

Reviewed by: rwatson
MFC after: 2 weeks

17 years agoFix a likely bug by adding what appears to be a missing break statement
rwatson [Mon, 26 Feb 2007 10:16:53 +0000 (10:16 +0000)]
Fix a likely bug by adding what appears to be a missing break statement
in the IPX over IP configuration ioctl: when changing the flags on a
tunnel interface, return the generated error rather than always EINVAL.

17 years agogeneral LOCK_PROFILING cleanup
kmacy [Mon, 26 Feb 2007 08:26:44 +0000 (08:26 +0000)]
general LOCK_PROFILING cleanup

- only collect timestamps when a lock is contested - this reduces the overhead
  of collecting profiles from 20x to 5x

- remove unused function from subr_lock.c

- generalize cnt_hold and cnt_lock statistics to be kept for all locks

- NOTE: rwlock profiling generates invalid statistics (and most likely always has)
  someone familiar with that should review

17 years agoUpdate the dump program to save extended attributes. Update
mckusick [Mon, 26 Feb 2007 08:15:56 +0000 (08:15 +0000)]
Update the dump program to save extended attributes. Update
the restore program to restore all dumped extended attributes.

If the restore is running as root, it will always be able
to restore all extended attributes. If it is not running
as root, it makes a best effort to set them. Using the -v
command line flag or the `verbose' command in interactive
mode will display all the extended attributes being set on
files (and at the end on directories) that are being restored.
It will note any extended attributes that could not be set.

The extended attributes are placed on the dump image immediately
following each file's data. Older versions of restore can work
with the newer dump images. Old versions of restore will
correctly restore the file data and then (silently) skip
over the extended attribute data and proceed to the next file.

This resolves PR 93085 which will be closed once the code
has been MFC'ed.

Note that this code will not compile until these header
files have been updated: <protocols/dumprestore.h> and
<sys/extattr.h>.

PR: bin/93085
Comments from: Poul-Henning Kamp and Robert Watson
MFC after: 3 weeks

17 years agoDeclare a `struct extattr' that defines the format of an extended
mckusick [Mon, 26 Feb 2007 06:18:53 +0000 (06:18 +0000)]
Declare a `struct extattr' that defines the format of an extended
attribute. Also define some macros to manipulate one of these
structures. Explain their use in the extattr.9 manual page.

The next step will be to make a sweep through the kernel replacing
the old pointer manipulation code. To get an idea of how they would
be used, the ffs_findextattr() function in ufs/ffs/ffs_vnops.c is
currently written as follows:

/*
 * Vnode operating to retrieve a named extended attribute.
 *
 * Locate a particular EA (nspace:name) in the area (ptr:length), and return
 * the length of the EA, and possibly the pointer to the entry and to the data.
 */
static int
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
    u_char **eap, u_char **eac)
{
u_char *p, *pe, *pn, *p0;
int eapad1, eapad2, ealength, ealen, nlen;
uint32_t ul;

pe = ptr + length;
nlen = strlen(name);

for (p = ptr; p < pe; p = pn) {
p0 = p;
bcopy(p, &ul, sizeof(ul));
pn = p + ul;
/* make sure this entry is complete */
if (pn > pe)
break;
p += sizeof(uint32_t);
if (*p != nspace)
continue;
p++;
eapad2 = *p++;
if (*p != nlen)
continue;
p++;
if (bcmp(p, name, nlen))
continue;
ealength = sizeof(uint32_t) + 3 + nlen;
eapad1 = 8 - (ealength % 8);
if (eapad1 == 8)
eapad1 = 0;
ealength += eapad1;
ealen = ul - ealength - eapad2;
p += nlen + eapad1;
if (eap != NULL)
*eap = p0;
if (eac != NULL)
*eac = p;
return (ealen);
}
return(-1);
}

After applying the structure and macros, it would look like this:

/*
 * Vnode operating to retrieve a named extended attribute.
 *
 * Locate a particular EA (nspace:name) in the area (ptr:length), and return
 * the length of the EA, and possibly the pointer to the entry and to the data.
 */
static int
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
    u_char **eapp, u_char **eac)
{
struct extattr *eap, *eaend;

eaend = (struct extattr *)(ptr + length);
for (eap = (struct extattr *)ptr; eap < eaend; eap = EXTATTR_NEXT(eap)){
/* make sure this entry is complete */
if (EXTATTR_NEXT(eap) > eaend)
break;
if (eap->ea_namespace != nspace ||
    eap->ea_namelength != length ||
    bcmp(eap->ea_name, name, length))
continue;
if (eapp != NULL)
*eapp = eap;
if (eac != NULL)
*eac = EXTATTR_CONTENT(eap);
return (EXTATTR_CONTENT_SIZE(eap));
}
return(-1);
}

Not only is it considerably shorter, but it hopefully more readable :-)

17 years agoRemove unused header file <machine/katelib.h>
kevlo [Mon, 26 Feb 2007 05:17:47 +0000 (05:17 +0000)]
Remove unused header file <machine/katelib.h>

17 years agomii_phy_dev_probe returns its third argument on match, not 0, so pass 0
imp [Mon, 26 Feb 2007 04:48:24 +0000 (04:48 +0000)]
mii_phy_dev_probe returns its third argument on match, not 0, so pass 0
in if we're going to test against 0.

Noticed by: marius@

17 years agoClose race conditions between fork() and [sg]etpriority()'s
delphij [Mon, 26 Feb 2007 03:38:09 +0000 (03:38 +0000)]
Close race conditions between fork() and [sg]etpriority()'s
PRIO_USER case, possibly also other places that deferences
p_ucred.

In the past, we insert a new process into the allproc list right
after PID allocation, and release the allproc_lock sx.  Because
most content in new proc's structure is not yet initialized,
this could lead to undefined result if we do not handle PRS_NEW
with care.

The problem with PRS_NEW state is that it does not provide fine
grained information about how much initialization is done for a
new process.  By defination, after PRIO_USER setpriority(), all
processes that belongs to given user should have their nice value
set to the specified value.  Therefore, if p_{start,end}copy
section was done for a PRS_NEW process, we can not safely ignore
it because p_nice is in this area.  On the other hand, we should
be careful on PRS_NEW processes because we do not allow non-root
users to lower their nice values, and without a successful copy
of the copy section, we can get stale values that is inherted
from the uninitialized area of the process structure.

This commit tries to close the race condition by grabbing proc
mutex *before* we release allproc_lock xlock, and do copy as
well as zero immediately after the allproc_lock xunlock.  This
guarantees that the new process would have its p_copy and p_zero
sections, as well as user credential informaion initialized.  In
getpriority() case, instead of grabbing PROC_LOCK for a PRS_NEW
process, we just skip the process in question, because it does
not affect the final result of the call, as the p_nice value
would be copied from its parent, and we will see it during
allproc traverse.

Other potential solutions are still under evaluation.

Discussed with: davidxu, jhb, rwatson
PR: kern/108071
MFC after: 2 weeks

17 years agoMove _posix1e_acl_name_to_id out of acl_support.c and into
kientzle [Mon, 26 Feb 2007 02:07:02 +0000 (02:07 +0000)]
Move _posix1e_acl_name_to_id out of acl_support.c and into
acl_from_text.c.  Since acl_from_text.c is the only place it
is used, we can now make this internal utility function "static."

As a bonus, acl_set_fd() no longer pulls in getpwuid() for no reason.

MFC after: 7 days

17 years agoDefine FLASHADDR and LOADERRAMADDR for the Avila, so that we can boot a
cognet [Mon, 26 Feb 2007 02:04:24 +0000 (02:04 +0000)]
Define FLASHADDR and LOADERRAMADDR for the Avila, so that we can boot a
kernel from the onboard flash.

17 years agoErm we can't change the value of arm_memcpy if we're running from flash.
cognet [Mon, 26 Feb 2007 02:03:48 +0000 (02:03 +0000)]
Erm we can't change the value of arm_memcpy if we're running from flash.
Instead, make memcpy() check if we're running from flash, and avoid
using arm_memcpy if we're doing so.

17 years agoImplement the -h flag (set an ACL on a symbolic link).
mckusick [Mon, 26 Feb 2007 00:42:17 +0000 (00:42 +0000)]
Implement the -h flag (set an ACL on a symbolic link).
Before this fix the -h flag was ignored (i.e. setfacl
always set the ACL on the file pointed to by the symbolic
link even when the -h flag requested that the ACL be set
on the symbolic link itself).

17 years agoUpdate for the new prototype of bus_setup_intr().
cognet [Sun, 25 Feb 2007 22:17:54 +0000 (22:17 +0000)]
Update for the new prototype of bus_setup_intr().

17 years agoDon't assert() the TLS allocation requested is big enough; just
kientzle [Sun, 25 Feb 2007 21:23:50 +0000 (21:23 +0000)]
Don't assert() the TLS allocation requested is big enough; just
fix the argument.

In particular, this is a step towards breaking crt1's dependence on stdio.

17 years agoMark the vm_page_unmanage(9) manpage as obsolete.
ru [Sun, 25 Feb 2007 17:34:16 +0000 (17:34 +0000)]
Mark the vm_page_unmanage(9) manpage as obsolete.

Reminded by: maxim

17 years agoCatch up with bus_setup_intr() modification and garbage collect a
piso [Sun, 25 Feb 2007 15:04:08 +0000 (15:04 +0000)]
Catch up with bus_setup_intr() modification and garbage collect a
reference to INTR_FAST.