]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
16 years agoClean up coda_pathconf() slightly while debugging a problem there.
Robert Watson [Mon, 11 Feb 2008 00:01:45 +0000 (00:01 +0000)]
Clean up coda_pathconf() slightly while debugging a problem there.

MFC after: 1 month

16 years agoGive traceroute6 the ability to traceroute with packets with no
David Malone [Sun, 10 Feb 2008 21:06:38 +0000 (21:06 +0000)]
Give traceroute6 the ability to traceroute with packets with no
upper layer header (IP PROTO = 59). Useful for testing firewalls.

MFC after: 2 months

16 years agoAdd support for PC Engines ALIX boards.
Poul-Henning Kamp [Sun, 10 Feb 2008 19:14:42 +0000 (19:14 +0000)]
Add support for PC Engines ALIX boards.

Style cleanup.

Hide some messages behind bootverbose.

16 years ago- Revert last ehci.c change
Attilio Rao [Sun, 10 Feb 2008 15:50:21 +0000 (15:50 +0000)]
- Revert last ehci.c change
- Include lock.h in lockmgr.h as nested header in order to safely use
  LOCK_FILE and LOCK_LINE.  As long as this code will be replaced soon
  we can tollerate for a while this namespace pollution even if the real
  fix would be to let lockmgr() depend by lock.h as a separate header.

16 years agoSince we're now actively maintaining the Coda module in the FreeBSD source
Robert Watson [Sun, 10 Feb 2008 11:18:12 +0000 (11:18 +0000)]
Since we're now actively maintaining the Coda module in the FreeBSD source
tree, restyle everything but coda.h (which is more explicitly shared
across systems) into a closer approximation to style(9).

Remove a few more unused function prototypes.

Add or clarify some comments.

MFC after: 1 month

16 years agoAfter rev. 1.60 of sys/lockmgr.h, the header requires inclusion of the
Konstantin Belousov [Sun, 10 Feb 2008 07:34:16 +0000 (07:34 +0000)]
After rev. 1.60 of sys/lockmgr.h, the header requires inclusion of the
sys/lock.h.

16 years agoAdd `hw.ciss.nop_message_heartbeat' tunable (default disabled) for
Mitsuru IWASAKI [Sun, 10 Feb 2008 06:21:52 +0000 (06:21 +0000)]
Add `hw.ciss.nop_message_heartbeat' tunable (default disabled) for
NOP-message polling in ciss_periodic().
Note that setting the tunable to non-zero can be workaround only for
`ADAPTER HEARTBEAT FAILED' problem, and may freeze the system w/o
the problem.

Reviewed by: scottl
Reported by: Attila Nagy
MFC after: 3 days

16 years agoUse LOCK_FILE and LOCK_LINE where necessary instead than __FILE__ and
Attilio Rao [Sat, 9 Feb 2008 21:37:54 +0000 (21:37 +0000)]
Use LOCK_FILE and LOCK_LINE where necessary instead than __FILE__ and
__LINE__ with lockmgr.

16 years agonamei() can call underlying nfs_readlink() passing a struct uio pointer
Attilio Rao [Sat, 9 Feb 2008 20:13:19 +0000 (20:13 +0000)]
namei() can call underlying nfs_readlink() passing a struct uio pointer
owned by a NULL owner. This will lead consequent VOP_ISLOCKED() present
into nfs_upgrade_vnlock() to panic as it only acquire curthread now.
Fix nfs_upgrade_vnlock() and nfs_downgrade_vnlock() in order to not use
more the struct thread pointer passed as argument (as it is really nomore
required there as vn_lock() and VOP_UNLOCK doesn't get the lock more).
Using curthread, in place, doesn't get ambiguity as LK_EXCLOTHER should
be handled as a "not locked" request by both functions.

Reported by: kris
Tested by: kris
Reviewed by: ups

16 years agoFix a few obvious errors in the znew(1) script.
Yaroslav Tykhiy [Sat, 9 Feb 2008 13:04:01 +0000 (13:04 +0000)]
Fix a few obvious errors in the znew(1) script.

PR: bin/120249
Submitted by: Jaakko Heinonen <see the PR for email>

16 years agoAs usual, use a minimax polynomial that is specialized for float
Bruce Evans [Sat, 9 Feb 2008 12:53:15 +0000 (12:53 +0000)]
As usual, use a minimax polynomial that is specialized for float
precision.  The new polynomial has degree 4 instead of 10, and a maximum
error of 2**-30.04 ulps instead of 2**-33.15.  This doesn't affect the
final error significantly; the maximum error was and is about 0.5015
ulps on i386 -O1, and the number of cases with an error of > 0.5 ulps
is increased from 13851 to 14407.

Note that the error is only this close to 0.5 ulps due to excessive
extra precision caused by compiler bugs on i386.  The extra precision
could be obtained intentionally, and is useful for keeping the error
of the hyperbolic float functions below 1 ulp, since these functions
are implemented using expm1f.  My recent change for scaling by 2**k
had the unintentional side effect of retaining extra precision for
longer, so callers of expm1f see errors of more like 0.0015 ulps than
0.5015 ulps, and for the hyperbolic functions this reduces the maximum
error from nearly about 2 ulps to about 0.75 ulps.

This is about 10% faster on i386 (A64).  expm1* is still very slow,
but now the float version is actually significantly faster.  The
algorithm is very sophisticated but not very good except on machines
with fast division.

16 years agoVarious further non-functional cleanups to coda:
Robert Watson [Sat, 9 Feb 2008 12:49:18 +0000 (12:49 +0000)]
Various further non-functional cleanups to coda:

- Rename print_vattr to coda_print_vattr and make static, rename
  print_cred to coda_print_cred.
- Remove unused coda_vop_nop.
- Add XXX comment because coda_readdir forwards to the cache vnode's
  readdir rather than venus_readdir, and annotate venus_readdir as
  unused.
- Rename vc_nb_* to vc_*.
- Use d_open_t, d_close_t, d_read_t, d_write_t, d_ioctl_t and d_poll_t
  for prototyping vc_* as that is the intent, don't use our own
  definitions.
- Rename coda_nb_statfs to coda_statfs, rename NB_SFS_SIZ to
  CODA_SFS_SIZ.
- Replace one more OBE reference to NetBSD with a reference to FreeBSD.
- Tidy up a little vertical whitespace here and there.
- Annotate coda_nc_zapvnode as unused.
- Remove unused vcodattach.
- Annotate VM_INTR as unused.
- Annotate that coda_fhtovp is unused and doesn't match the FreeBSD
  prototype, so isn't hooked up to vfs_fhtovp.  If we want NFS export of
  Coda to work someday, this needs to be fixed.
- Remove unused getNewVnode.
- Remove unused coda_vget, coda_init, coda_quotactl prototypes.

MFC after: 1 month

16 years agoNo reason not to maintain stats on statfs in Coda, as it's done for
Robert Watson [Sat, 9 Feb 2008 11:40:49 +0000 (11:40 +0000)]
No reason not to maintain stats on statfs in Coda, as it's done for
other VFS operations, so uncomment the existing statistics gathering.

MFC after: 1 month

16 years agoRemove unused devtomp(), which exploited UFS-specific knowledge to find
Robert Watson [Sat, 9 Feb 2008 11:12:18 +0000 (11:12 +0000)]
Remove unused devtomp(), which exploited UFS-specific knowledge to find
the mountpoint for a specific device.  This was implemented incorrectly,
a bad idea in a fundamental sense, and also never used, so presumably
a long-idle debugging function.

MFC after: 1 month

16 years agoFix a comment about coefficients and expand a related one.
Bruce Evans [Sat, 9 Feb 2008 10:36:07 +0000 (10:36 +0000)]
Fix a comment about coefficients and expand a related one.

16 years agoSince Coda is effectively a stacked file system, use VOP_EOPNOTSUPP
Robert Watson [Sat, 9 Feb 2008 09:33:19 +0000 (09:33 +0000)]
Since Coda is effectively a stacked file system, use VOP_EOPNOTSUPP
for vop_bmap; delete the existing stub that returned either EINVAL
or EOPNOTSUPP, and had unreachable calls to VOP_BMAP on the cache
vnode.

MFC after: 1 month

16 years agoWARNS fixes:
David Malone [Sat, 9 Feb 2008 09:12:02 +0000 (09:12 +0000)]
WARNS fixes:
1) Add missing parens around assignment that is compared to zero.
2) Make some variables that only take non-negative values unsigned.
3) Some casts/type changes to fix other constness warnings.
4) Make one variable a const char *.
5) Make sure termwidth is positive, it doesn't make sense for it to be negative.

Approved by: dds

16 years agoAdd support for displaying a process' current working directory, root
Joe Marcus Clarke [Sat, 9 Feb 2008 05:16:26 +0000 (05:16 +0000)]
Add support for displaying a process' current working directory, root
directory, and jail directory within procstat.  While this functionality
is available already in fstat, encapsulating it in the kern.proc.filedesc
sysctl makes it accessible without using kvm and thus without needing
elevated permissions.

The new procstat output looks like:

  PID COMM               FD T V FLAGS    REF  OFFSET PRO NAME
  76792 tcsh              cwd v d --------   -       - -   /usr/src
  76792 tcsh             root v d --------   -       - -   /
  76792 tcsh               15 v c rw------  16    9130 -   -
  76792 tcsh               16 v c rw------  16    9130 -   -
  76792 tcsh               17 v c rw------  16    9130 -   -
  76792 tcsh               18 v c rw------  16    9130 -   -
  76792 tcsh               19 v c rw------  16    9130 -   -

I am also bumping __FreeBSD_version for this as this new feature will be
used in at least one port.

Reviewed by: rwatson
Approved by: rwatson

16 years agoLock cache vnode when VOP_FSYNC() is called on a Coda vnode.
Robert Watson [Sat, 9 Feb 2008 00:12:22 +0000 (00:12 +0000)]
Lock cache vnode when VOP_FSYNC() is called on a Coda vnode.

MFC after: 1 month

16 years agoMake all calls to vn_lock() in Coda, including recently added ones,
Robert Watson [Sat, 9 Feb 2008 00:03:22 +0000 (00:03 +0000)]
Make all calls to vn_lock() in Coda, including recently added ones,
use LK_RETRY, since failure is undesirable (and not handled).

MFC after: 1 month
Pointed out by: kib

16 years agoThe Coda module was originally ported to NetBSD from Mach by rvb, and
Robert Watson [Fri, 8 Feb 2008 23:15:36 +0000 (23:15 +0000)]
The Coda module was originally ported to NetBSD from Mach by rvb, and
then later to FreeBSD.  Update various NetBSD-related comments: in some
cases delete them because they don't appply, in others update to say
FreeBSD as they still apply but in FreeBSD (and might for that matter
no longer apply on NetBSD), and flag one case where I'm not sure
whether it applies.

MFC after: 1 month

16 years agoFix truncation of lines at LINE_MAX characters by dynamically
Guy Helmer [Fri, 8 Feb 2008 23:04:13 +0000 (23:04 +0000)]
Fix truncation of lines at LINE_MAX characters by dynamically
extending line buffers.

PR: bin/76578

16 years agoBefore invoking vnode operations on cache vnodes, acquire the vnode
Robert Watson [Fri, 8 Feb 2008 23:01:40 +0000 (23:01 +0000)]
Before invoking vnode operations on cache vnodes, acquire the vnode
locks of those vnodes.  Probably, Coda should do the same lock sharing/
pass-through that is done for nullfs, but in the mean time this ensures
that locks are adequately held to prevent corruption of data structures
in the cache file system.

Assuming most operations came from the top layer of Coda and weren't
performed directly on the cache vnodes, in practice this corruption was
relatively unlikely as the Coda vnode locks were ensuring exclusive
access for most consumers.

This causes WITNESS to squeal like a pig immediately when Coda is used,
rather than waiting until file close; I noticed these problems because
of the lack of said squealing.

MFC after: 1 month

16 years agoRemove undefined coda excluded by #if 1 #else, which previously protected
Robert Watson [Fri, 8 Feb 2008 22:37:15 +0000 (22:37 +0000)]
Remove undefined coda excluded by #if 1 #else, which previously protected
vget() calls using inode numbers to query the root of /coda, which is not
needed since we now cache the root vnode with the mountpoint.

MFC after: 1 month

16 years agoConver all explicit instances to VOP_ISLOCKED(arg, NULL) into
Attilio Rao [Fri, 8 Feb 2008 21:45:47 +0000 (21:45 +0000)]
Conver all explicit instances to VOP_ISLOCKED(arg, NULL) into
VOP_ISLOCKED(arg, curthread). Now, VOP_ISLOCKED() and lockstatus() should
only acquire curthread as argument; this will lead in axing the additional
argument from both functions, making the code cleaner.

Reviewed by: jeff, kib

16 years agoNote m_collapse addition.
Sam Leffler [Fri, 8 Feb 2008 21:24:58 +0000 (21:24 +0000)]
Note m_collapse addition.

16 years agobelated bump for the addition of m_collapse
Sam Leffler [Fri, 8 Feb 2008 21:23:36 +0000 (21:23 +0000)]
belated bump for the addition of m_collapse

16 years agoIntroduce -i to SYNOPSIS, forgotten by krion@.
Ruslan Ermilov [Fri, 8 Feb 2008 14:00:01 +0000 (14:00 +0000)]
Introduce -i to SYNOPSIS, forgotten by krion@.

16 years agoWARNS fixes: mainly constness and avoid comparing signed with
David Malone [Fri, 8 Feb 2008 11:03:05 +0000 (11:03 +0000)]
WARNS fixes: mainly constness and avoid comparing signed with
unsigned by making array indicies unsigned. Also note one or two
unused parameters.

16 years agoWARNS fixes: remove two unused variables and add some constness.
David Malone [Fri, 8 Feb 2008 10:58:50 +0000 (10:58 +0000)]
WARNS fixes: remove two unused variables and add some constness.

16 years agoUse memcpy(3) instead of the BSD-specific bcopy(3).
Dag-Erling Smørgrav [Fri, 8 Feb 2008 09:48:48 +0000 (09:48 +0000)]
Use memcpy(3) instead of the BSD-specific bcopy(3).

Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
MFC after: 2 weeks

16 years agos/MAXPATHLEN/PATH_MAX/ to reflect five-year old change to the code :)
Dag-Erling Smørgrav [Fri, 8 Feb 2008 09:44:34 +0000 (09:44 +0000)]
s/MAXPATHLEN/PATH_MAX/ to reflect five-year old change to the code :)

Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
MFC after: 2 weeks

16 years agoFix a bug in lazy deallocation that was introduced when
Jason Evans [Fri, 8 Feb 2008 08:02:34 +0000 (08:02 +0000)]
Fix a bug in lazy deallocation that was introduced when
arena_dalloc_lazy_hard() was split out of arena_dalloc_lazy() in revision
1.162.

Reduce thundering herd problems in lazy deallocation by randomly varying
how many probes a thread does before taking the slow path.

16 years agoFix truncl() when the result should be -0.0L. When the result is +-0.0L,
Bruce Evans [Fri, 8 Feb 2008 01:45:52 +0000 (01:45 +0000)]
Fix truncl() when the result should be -0.0L.  When the result is +-0.0L,
it must have the same sign as the arg in all rounding modes, but it was
always +0.0L.

16 years agoOops, fix the fix in rev.1.10. logb() and logbf() were broken on
Bruce Evans [Fri, 8 Feb 2008 01:22:13 +0000 (01:22 +0000)]
Oops, fix the fix in rev.1.10.  logb() and logbf() were broken on
denormals, and logb() remained broken after 1.10 because the fix for
logbf() was incompletely translated.

Convert to __FBSDID().

16 years agoClean up manipulation of chunk page map elements to remove some tenuous
Jason Evans [Fri, 8 Feb 2008 00:35:56 +0000 (00:35 +0000)]
Clean up manipulation of chunk page map elements to remove some tenuous
assumptions about whether bits are set at various times.  This makes
adding other flags safe.

Reorganize functions in order to inline i{m,c,p,s,re}alloc().  This
allows the entire fast-path call chains for malloc() and free() to be
inlined. [1]

Suggested by: [1] Stuart Parmenter <stuart@mozilla.com>

16 years agoFix netname() [1] and routename() on big-endian LP64 archs.
Marius Strobl [Thu, 7 Feb 2008 23:00:40 +0000 (23:00 +0000)]
Fix netname() [1] and routename() on big-endian LP64 archs.

Submitted by: Yuri Pankov [1]
MFC after: 3 days

16 years agoThe previous commit message was wrong. It should have read:
Rink Springer [Thu, 7 Feb 2008 19:00:00 +0000 (19:00 +0000)]
The previous commit message was wrong. It should have read:

"Fix bootparamd on 64 bit platforms - at least amd64 was broken due to the
 code believing long == 32 bits and using it to store/compare IPv4 addresses."

Note the "== 32 bits" - the previous commit message stated 64 bits, which is
plain wrong.

PR: bin/112163
Pointed out by: obrien
Approved by: imp (mentor, implicit)

16 years agostyle(9) (verifed no-change in .o's)
David E. O'Brien [Thu, 7 Feb 2008 18:10:24 +0000 (18:10 +0000)]
style(9) (verifed no-change in .o's)

16 years agoDon't reset DST computed by strptime() (when e.g. setting the
Ruslan Ermilov [Thu, 7 Feb 2008 16:04:24 +0000 (16:04 +0000)]
Don't reset DST computed by strptime() (when e.g. setting the
date via -f %s).

Reported by: Eugene Grosbein
Diagnosed by: Miguel Lopes Santos Ramos

16 years agoIf the vhid already present, return EEXIST instead of
Gleb Smirnoff [Thu, 7 Feb 2008 13:18:59 +0000 (13:18 +0000)]
If the vhid already present, return EEXIST instead of
non-informative EINVAL.

16 years agoRemove unused structure member from struct in_ifadown_arg.
Gleb Smirnoff [Thu, 7 Feb 2008 11:26:52 +0000 (11:26 +0000)]
Remove unused structure member from struct in_ifadown_arg.

16 years agoUse rtalloc1() instead of rtalloc_ign(). It returns a locked
Gleb Smirnoff [Thu, 7 Feb 2008 11:10:17 +0000 (11:10 +0000)]
Use rtalloc1() instead of rtalloc_ign(). It returns a locked
rtentry. We quickly copy the fields of interest, and then
RTFREE_LOCKED(). This should be faster then lock & unlock the
rtentry twice.

16 years agoAdd a note that ipfw states do not implicitly match ICMP error messages.
Yaroslav Tykhiy [Thu, 7 Feb 2008 11:00:42 +0000 (11:00 +0000)]
Add a note that ipfw states do not implicitly match ICMP error messages.

16 years agoUse a better method of scaling by 2**k. Instead of adding to the
Bruce Evans [Thu, 7 Feb 2008 09:42:19 +0000 (09:42 +0000)]
Use a better method of scaling by 2**k.  Instead of adding to the
exponent bits of the reduced result, construct 2**k (hopefully in
parallel with the construction of the reduced result) and multiply by
it.  This tends to be much faster if the construction of 2**k is
actually in parallel, and might be faster even with no parallelism
since adjustment of the exponent requires a read-modify-wrtite at an
unfortunate time for pipelines.

In some cases involving exp2* on amd64 (A64), this change saves about
40 cycles or 30%.  I think it is inherently only about 12 cycles faster
in these cases and the rest of the speedup is from partly-accidentally
avoiding compiler pessimizations (the construction of 2**k is now
manually scheduled for good results, and -O2 doesn't always mess this
up).  In most cases on amd64 (A64) and i386 (A64) the speedup is about
20 cycles.  The worst case that I found is expf on ia64 where this
change is a pessimization of about 10 cycles or 5%.  The manual
scheduling for plain exp[f] is harder and not as tuned.

Details specific to expm1*:
- the saving is closer to 12 cycles than to 40 for expm1* on i386 (A64).
  For some reason it is much larger for negative args.
- also convert to __FBSDID().

16 years ago - Add THREAD_LOCKPTR_ASSERT() to assert that the thread's lock points at
Jeff Roberson [Thu, 7 Feb 2008 06:55:38 +0000 (06:55 +0000)]
 - Add THREAD_LOCKPTR_ASSERT() to assert that the thread's lock points at
   the provided lock or &blocked_lock.  The thread may be temporarily
   assigned to the blocked_lock by the scheduler so a direct comparison
   can not always be made.
 - Use THREAD_LOCKPTR_ASSERT() in the primary consumers of the scheduling
   interfaces.  The schedulers themselves still use more explicit asserts.

Sponsored by: Nokia

16 years agoFrom the 4 February 2008 update:
Doug Barton [Thu, 7 Feb 2008 06:28:02 +0000 (06:28 +0000)]
From the 4 February 2008 update:
IPv6 addresses for 6 of the root name servers!

16 years ago - In rw_wunlock_hard prefer to wakeup writers if there are both readers
Jeff Roberson [Thu, 7 Feb 2008 06:16:54 +0000 (06:16 +0000)]
 - In rw_wunlock_hard prefer to wakeup writers if there are both readers
   and writers available.  Doing otherwise can cause deadlocks as no
   read locks can proceed while there are write waiters.

Sponsored by: Nokia

16 years agoChange shm_dotruncate() so that it correctly handles cached pages that span
Alan Cox [Thu, 7 Feb 2008 05:55:16 +0000 (05:55 +0000)]
Change shm_dotruncate() so that it correctly handles cached pages that span
the end of the object.  (This change is analogous to revision 1.237 of
vm/vnode_pager.c.)

Discussed with: jhb

16 years agoUse a better method of scaling by 2**k. Instead of adding to the
Bruce Evans [Thu, 7 Feb 2008 03:17:05 +0000 (03:17 +0000)]
Use a better method of scaling by 2**k.  Instead of adding to the
exponent bits of the reduced result, construct 2**k (hopefully in
parallel with the construction of the reduced result) and multiply by
it.  This tends to be much faster if the construction of 2**k is
actually in parallel, and might be faster even with no parallelism
since adjustment of the exponent requires a read-modify-wrtite at an
unfortunate time for pipelines.

In some cases involving exp2* on amd64 (A64), this change saves about
40 cycles or 30%.  I think it is inherently only about 12 cycles faster
in these cases and the rest of the speedup is from partly-accidentally
avoiding compiler pessimizations (the construction of 2**k is now
manually scheduled for good results, and -O2 doesn't always mess this
up).  In most cases on amd64 (A64) and i386 (A64) the speedup is about
20 cycles.  The worst case that I found is expf on ia64 where this
change is a pessimization of about 10 cycles or 5%.  The manual
scheduling for plain exp[f] is harder and not as tuned.

This change ld128/s_exp2l.c has not been tested.

16 years agoAdd missing #include
Dag-Erling Smørgrav [Wed, 6 Feb 2008 23:25:29 +0000 (23:25 +0000)]
Add missing #include

Spotted by: tinderbox
Submitted by: Pietro Cerutti <gahr@gahr.ch>
Pointy hat to: des

16 years agoFix the Xlist so it actually works with 'tar -X', and update the upgrade
Dag-Erling Smørgrav [Wed, 6 Feb 2008 23:14:24 +0000 (23:14 +0000)]
Fix the Xlist so it actually works with 'tar -X', and update the upgrade
instructions accordingly.

16 years agoAs per discussion, commit experimental metadata for my contrib packages.
Dag-Erling Smørgrav [Wed, 6 Feb 2008 23:06:24 +0000 (23:06 +0000)]
As per discussion, commit experimental metadata for my contrib packages.
The idea is to have a FREEBSD-vendor file for every third-party package
in the tree.

16 years agoMake the openfirmware getchar entry point non-blocking. This catches up
Peter Grehan [Wed, 6 Feb 2008 22:04:28 +0000 (22:04 +0000)]
Make the openfirmware getchar entry point non-blocking. This catches up
with jhb's 2005/05/27 loader multiple-console change.

Tested by: marius/sparc64, grehan/ofwppc

16 years agoYet another pointy hat: when I zapped FBSDprivate_1.1, I forgot to move
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:45:46 +0000 (20:45 +0000)]
Yet another pointy hat: when I zapped FBSDprivate_1.1, I forgot to move
its contents to FBSDprivate_1.0.

16 years agoAdd pthread_mutex_isowned_np() here as well; libthr and libkse are supposed
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:44:29 +0000 (20:44 +0000)]
Add pthread_mutex_isowned_np() here as well; libthr and libkse are supposed
to have identical functionality.

MFC after: 2 weeks

16 years agoRemove unnecessary prototype.
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:43:19 +0000 (20:43 +0000)]
Remove unnecessary prototype.

16 years agoAdd pthread_mutex_isowned_np() so there is no need for an additional
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:42:35 +0000 (20:42 +0000)]
Add pthread_mutex_isowned_np() so there is no need for an additional
prototype next to the implementation.

MFC after: 2 weeks

16 years agoDo not use bcmp() to compare two bytes with constants.
Alexander Motin [Wed, 6 Feb 2008 20:37:34 +0000 (20:37 +0000)]
Do not use bcmp() to compare two bytes with constants.

16 years agoPrevious commit had a typo that resulted in symbol versioning being
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:33:59 +0000 (20:33 +0000)]
Previous commit had a typo that resulted in symbol versioning being
(silently) disabled for libkse...

Pointy hat to: des

16 years agoGive libkse the same treatment as libthr re. symbol versioning.
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:30:48 +0000 (20:30 +0000)]
Give libkse the same treatment as libthr re. symbol versioning.

MFC after: 2 weeks

16 years agoConvert pthread.map to the format expected by version_gen.awk, and modify
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:25:00 +0000 (20:25 +0000)]
Convert pthread.map to the format expected by version_gen.awk, and modify
the Makefile accordingly; libthr now explicitly uses libc's Versions.def.

MFC after: 2 weeks

16 years agoRemove incorrectly added FBSDprivate_1.1 namespace, and move symbols which
Dag-Erling Smørgrav [Wed, 6 Feb 2008 20:20:29 +0000 (20:20 +0000)]
Remove incorrectly added FBSDprivate_1.1 namespace, and move symbols which
are new in FreeBSD 8 to the appropriate namespace.

16 years agoRevert rev. 1.128, we have a hard link generated from new
Xin LI [Wed, 6 Feb 2008 19:45:45 +0000 (19:45 +0000)]
Revert rev. 1.128, we have a hard link generated from new
hptrr(4) to rr232x.

Pointed out by: bruffer
Pointy hat to: delphij

16 years agomutex_islocked_np -> mutex_isowned_np
Dag-Erling Smørgrav [Wed, 6 Feb 2008 19:41:05 +0000 (19:41 +0000)]
mutex_islocked_np -> mutex_isowned_np

16 years agoPer discussion on -threads, rename _islocked_np() to _isowned_np().
Dag-Erling Smørgrav [Wed, 6 Feb 2008 19:34:31 +0000 (19:34 +0000)]
Per discussion on -threads, rename _islocked_np() to _isowned_np().

16 years agoThe man page of ofwdump(8) is installed as usr/share/man/man8/ofwdump.8.gz
Marcel Moolenaar [Wed, 6 Feb 2008 19:03:14 +0000 (19:03 +0000)]
The man page of ofwdump(8) is installed as usr/share/man/man8/ofwdump.8.gz
again on powerpc and sparc64. Un-obsolete it for these two so that we
don't remove it right after installing it.

16 years agoCleanup and tune ng_snd_item() function as it is one of the
Alexander Motin [Wed, 6 Feb 2008 18:50:40 +0000 (18:50 +0000)]
Cleanup and tune ng_snd_item() function as it is one of the
most busy netgraph functions.
Tune stack protection constants to avoid division operation.

16 years agoReflect rr232x(4) manpage removal
Xin LI [Wed, 6 Feb 2008 18:43:47 +0000 (18:43 +0000)]
Reflect rr232x(4) manpage removal

16 years agoThis is a regression test to verify the proper behavior of IP ID generation
Mike Silbersack [Wed, 6 Feb 2008 15:48:43 +0000 (15:48 +0000)]
This is a regression test to verify the proper behavior of IP ID generation
code.  It will push 200000 packets, then report back what the min and max
periods it saw for different IDs were.

16 years agoReplace the random IP ID generation code we
Mike Silbersack [Wed, 6 Feb 2008 15:40:30 +0000 (15:40 +0000)]
Replace the random IP ID generation code we
obtained from OpenBSD with an algorithm suggested
by Amit Klein.  The OpenBSD algorithm has a few
flaws; see Amit's paper for more information.

For a description of how this algorithm works,
please see the comments within the code.

Note that this commit does not yet enable random IP ID
generation by default.  There are still some concerns
that doing so will adversely affect performance.

Reviewed by:  rwatson
MFC After: 2 weeks

16 years agoRemove an errant definition for AMR_CONFIG_ENQ3_SOLICITED NOTIFY that was
Scott Long [Wed, 6 Feb 2008 14:26:31 +0000 (14:26 +0000)]
Remove an errant definition for AMR_CONFIG_ENQ3_SOLICITED NOTIFY that was
accidently reverted in the previous commit.

16 years agotd cannot be NULL in that place, so just axe out the check.
Attilio Rao [Wed, 6 Feb 2008 13:26:01 +0000 (13:26 +0000)]
td cannot be NULL in that place, so just axe out the check.

16 years agoAdd necessary cast for tolower() argument.
Dag-Erling Smørgrav [Wed, 6 Feb 2008 11:39:55 +0000 (11:39 +0000)]
Add necessary cast for tolower() argument.

Submitted by: Joerg Sonnenberger <joerg@britannica.bec.de>
MFC after: 1 week

16 years agoFix typo.
Pierre Beyssac [Wed, 6 Feb 2008 08:03:27 +0000 (08:03 +0000)]
Fix typo.

Submitted by: danny at cs.huji.ac.il (author)

16 years agoUpdate fix from rev 1.2.
Pierre Beyssac [Wed, 6 Feb 2008 08:02:55 +0000 (08:02 +0000)]
Update fix from rev 1.2.

Submitted by: danny at cs.huji.ac.il (author)
MFC after: 1 week

16 years agoAs for the float trig functions and logf, use a minimax polynomial
Bruce Evans [Wed, 6 Feb 2008 06:35:21 +0000 (06:35 +0000)]
As for the float trig functions and logf, use a minimax polynomial
that is specialized for float precision.  The new polynomial has degree
5 instead of 11, and a maximum error of 2**-27.74 ulps instead
of 2**-30.64.  This doesn't affect the final error significantly; the
maximum error was and is about 0.9101 ulps on amd64 -01 and the number
of cases with an error of > 0.5 ulps is actually reduced by epsilon
despite the larger error in the polynomial.

This is about 15% faster on amd64 (A64), i386 (A64) and ia64.  The asm
version is still used instead of this on i386 since it is faster and
more accurate.

16 years agoFix a symbol conflict between hptrr and hptmv
Scott Long [Wed, 6 Feb 2008 05:33:17 +0000 (05:33 +0000)]
Fix a symbol conflict between hptrr and hptmv

16 years agoAdd a note that the hptrr driver supersedes the rr232x driver.
Scott Long [Wed, 6 Feb 2008 03:30:13 +0000 (03:30 +0000)]
Add a note that the hptrr driver supersedes the rr232x driver.

16 years agoTrack dirty unused pages so that they can be purged if they exceed a
Jason Evans [Wed, 6 Feb 2008 02:59:54 +0000 (02:59 +0000)]
Track dirty unused pages so that they can be purged if they exceed a
threshold, according to the 'F' MALLOC_OPTIONS flag.  This obsoletes the
'H' flag.

Try to realloc() large objects in place.  This substantially speeds up
incremental large reallocations in the common case.

Fix a bug in arena_ralloc() that caused relocation of sub-page objects
even if the old and new sizes were in the same size class.

Maintain trees of runs and simplify the per-chunk page map.  This allows
logarithmic-time searching for sufficiently large runs in
arena_run_alloc(), whereas the previous algorithm required linear time
in the worst case.

Break various large functions into smaller sub-functions, and inline
only the functions that are in the fast path for small object
allocation/deallocation.

Remove an unnecessary check in base_pages_alloc_mmap().

Avoid integer division in choose_arena() for the NO_TLS case on
single-CPU systems.

16 years agoUpdate the hptrr driver to version 1.2. This adds port multiplier support
Scott Long [Wed, 6 Feb 2008 01:02:20 +0000 (01:02 +0000)]
Update the hptrr driver to version 1.2.  This adds port multiplier support
for several cards.  See the Highpoint website for more information.  Again,
many thanks to Highpoint for their continued support of FreeBSD.

16 years agoAdaptive spinning in write path with readers and writer starvation avoidance.
Jeff Roberson [Wed, 6 Feb 2008 01:02:13 +0000 (01:02 +0000)]
Adaptive spinning in write path with readers and writer starvation avoidance.
 - Move recursion checking into rwlock inlines to free a bit for use with
   adaptive spinners.
 - Clear the RW_LOCK_WRITE_SPINNERS flag whenever the lock state changes
   causing write spinners to restart their loop.
 - Write spinners are limited by a count while readers hold the lock as
   there is no way to know for certain whether readers are running still.
 - In the read path block if there are write waiters or spinners to avoid
   starving writers.  Use a new per-thread count, td_rw_rlocks, to skip
   starvation avoidance if it might cause a deadlock.
 - Remove or change invalid assertions in turnstiles.

Reviewed by:    attilio (developed parts of the patch as well)
Sponsored by:   Nokia

16 years agoUpdate manpage in order to reflect LK_NODUP and LK_NOWITNESS options
Attilio Rao [Wed, 6 Feb 2008 00:50:51 +0000 (00:50 +0000)]
Update manpage in order to reflect LK_NODUP and LK_NOWITNESS options
introduction.

16 years agoBump __FreeBSD_version in order to reflect introduction of LK_NODUP and
Attilio Rao [Wed, 6 Feb 2008 00:42:26 +0000 (00:42 +0000)]
Bump __FreeBSD_version in order to reflect introduction of LK_NODUP and
LK_NOWITNESS options in the lockmgr namespace.

16 years agoAdd WITNESS support to lockmgr locking primitive.
Attilio Rao [Wed, 6 Feb 2008 00:37:14 +0000 (00:37 +0000)]
Add WITNESS support to lockmgr locking primitive.
This support tries to be as parallel as possible with other locking
primitives, but there are differences; more specifically:
- The base witness support is alredy equipped for allowing lock
  duplication acquisition as lockmgr rely on this.
- In the case of lockmgr_disown() the lock result unlocked by witness
  even if it is still held by the "kernel context"
- In the case of upgrading we can have 3 different situations:
  * Total unlocking of the shared lock and nothing else
  * Real witness upgrade if the owner is the first upgrader
  * Shared unlocking and exclusive locking if the owner is not the first
    upgrade but it is still allowed to upgrade
- LK_DRAIN is basically handled like an exclusive acquisition

Additively new options LK_NODUP and LK_NOWITNESS can now be used with
lockinit(): LK_NOWITNESS disables WITNESS for the specified lock while
LK_NODUP enable duplicated locks tracking. This will require manpages
update and a __FreeBSD_version bumping (addressed by further commits).

This patch also fixes a problem occurring if a lockmgr is held in
exclusive mode and the same owner try to acquire it in shared mode:
currently there is a spourious shared locking acquisition while what
we really want is a lock downgrade. Probabilly, this situation can be
better served with a EDEADLK failing errno return.

Side note: first testing on this patch alredy reveleated several LORs
reported, so please expect LORs cascades until resolved. NTFS also is
reported broken by WITNESS introduction. BTW, NTFS is exposing a lock
leak which needs to be fixed, and this patch can help it out if
rightly tweaked.

Tested by: kris, yar, Scot Hetzel <swhetzel at gmail dot com>

16 years agoReally, no explicit checks against against lock_class_* object should be
Attilio Rao [Wed, 6 Feb 2008 00:04:09 +0000 (00:04 +0000)]
Really, no explicit checks against against lock_class_* object should be
done in consumers code: using locks properties is much more appropriate.
Fix current code doing these bogus checks.

Note: Really, callout are not usable by all !(LC_SPINLOCK | LC_SLEEPABLE)
primitives like rmlocks doesn't implement the generic lock layer
functions, but they can be equipped for this, so the check is still
valid.

Tested by: matteo, kris (earlier version)
Reviewed by: jhb

16 years agoFix a bug in hexadecimal formatting of the CHAP digest: bytes >= 0x80
Pierre Beyssac [Tue, 5 Feb 2008 23:42:38 +0000 (23:42 +0000)]
Fix a bug in hexadecimal formatting of the CHAP digest: bytes >= 0x80
were formatted as 0xff, causing the authentication to fail.

Reviewed by: scottl
MFC after: 1 week

16 years agoBump .Dd for r1.19; use consistent whitespace.
Ceri Davies [Tue, 5 Feb 2008 23:42:37 +0000 (23:42 +0000)]
Bump .Dd for r1.19; use consistent whitespace.

16 years agoAdd ZFS support.
John Baldwin [Tue, 5 Feb 2008 23:37:42 +0000 (23:37 +0000)]
Add ZFS support.

MFC after: 1 week
PR: bin/119976
Submitted by: Simun Mikecin  numisemis of yahoo.com

16 years agoset WARNS to 1: with WARNS=2 an aliasing error in a file generated by
Matteo Riondato [Tue, 5 Feb 2008 20:03:45 +0000 (20:03 +0000)]
set WARNS to 1: with WARNS=2 an aliasing error in a file generated by
rpcgen from include/rpcsvc/rex.x is exposed and I really don't know
how to fix it.

MFC after: 1 week

16 years agoAdd my birthday.
Antoine Brodin [Tue, 5 Feb 2008 19:34:54 +0000 (19:34 +0000)]
Add my birthday.

Approved by: rwatson (mentor)

16 years agoAdd myself.
Antoine Brodin [Tue, 5 Feb 2008 19:23:22 +0000 (19:23 +0000)]
Add myself.

Approved by: rwatson (mentor)

16 years agoMinor style(9) nit.
David E. O'Brien [Tue, 5 Feb 2008 17:34:44 +0000 (17:34 +0000)]
Minor style(9) nit.

16 years ago- Forced commit to note that revision 1.20 log was misspelled and that comma
Ulf Lilleengen [Tue, 5 Feb 2008 15:53:24 +0000 (15:53 +0000)]
- Forced commit to note that revision 1.20 log was misspelled and that comma
  should be spelled as colon.
Approved by: kib (mentor)

16 years agoSatisfy a particularly obstinate nit-picker :)
Dag-Erling Smørgrav [Tue, 5 Feb 2008 15:41:58 +0000 (15:41 +0000)]
Satisfy a particularly obstinate nit-picker :)

16 years ago- Add extra paths for GEOM_LIBRARY_PATH to the fixit environment to enable all
Ulf Lilleengen [Tue, 5 Feb 2008 14:06:15 +0000 (14:06 +0000)]
- Add extra paths for GEOM_LIBRARY_PATH to the fixit environment to enable all
  geom commands in a chrooted environment on the livefs cd.

PR: misc/120169
Approved by: pjd (mentor)
MFC after: 2 days

16 years ago- Update geom(8) to explain that GEOM_LIBRARY_PATH can take a comma-separated
Ulf Lilleengen [Tue, 5 Feb 2008 14:02:55 +0000 (14:02 +0000)]
- Update geom(8) to explain that GEOM_LIBRARY_PATH can take a comma-separated
  list of paths.

Approved by: pjd (mentor)
MFC after: 2 days

16 years agoIntroduce a standalone shell script for embedding MFS image.
Rafal Jaworowski [Tue, 5 Feb 2008 10:46:30 +0000 (10:46 +0000)]
Introduce a standalone shell script for embedding MFS image.

This allows to fix a problem with ARM kernel.bin not having the MFS image
embedded: it is objcopied from the kernel.noheader temporary ELF file, which
was not subject to embedding the MFS image previously.

Reviewed by: imp
Approved by: cognet (mentor)

16 years agoARM locore cosmetics.
Rafal Jaworowski [Tue, 5 Feb 2008 10:23:42 +0000 (10:23 +0000)]
ARM locore cosmetics.

Approved by: cognet (mentor)

16 years agoImprove ARM_TP_ADDRESS and RAS area.
Rafal Jaworowski [Tue, 5 Feb 2008 10:22:33 +0000 (10:22 +0000)]
Improve ARM_TP_ADDRESS and RAS area.

De-hardcode usage of ARM_TP_ADDRESS and RAS local storage, and move this
special purpose page to a more convenient place i.e. after the vectors high
page, more towards the end of address space. Previous location (0xe000_0000)
caused grief if KVA was to go beyond the default limit.

Note that ARM world rebuilding is required after this change since the
location of ARM_TP_ADDRESS is shared between kernel and userland.

Submitted by: Grzegorz Bernacki (gjb AT semihalf dot com)
Reviewed by: imp
Approved by: cognet (mentor)