]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
Merge from head 226829, 230213, 230480, 230486, 230487, 231585:
authorglebius <glebius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 13 Feb 2012 15:21:12 +0000 (15:21 +0000)
committerglebius <glebius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 13 Feb 2012 15:21:12 +0000 (15:21 +0000)
commitdca55be7e35382e19af2e1ab9313305ca37ba4f1
tree1238fcf5f2853aa154172162aa889c709d08f986
parentbae3eb3588924a7e3b19a9c39a579eca59bd3fd2
Merge from head 226829, 230213, 230480, 230486, 230487, 231585:

r226829 in ng_base:
  - If KDB & NETGRAPH_DEBUG are on, print traces on discovered failed
    invariants.
  - Reduce tautology in NETGRAPH_DEBUG output.

r230213 in ng_socket:
  Remove some disabled NOTYET code. Probability of enabling it is low,
  if anyone wants, he/she can take it from svn.

r230480 in ng_base:
  Convert locks that protect name hash, ID hash and typelist from
  mutex(9) to rwlock(9) based locks.

  While here remove dropping lock when processing NGM_LISTNODES,
  and NGM_LISTTYPES generic commands. We don't need to drop it
  since memory allocation is done with M_NOWAIT.

r230486 in subr_hash.c:
  Convert panic()s to KASSERT()s. This is an optimisation for
  hashdestroy() since in absence of INVARIANTS a compiler
  will drop the entire for() cycle.

230487, 231585 in ng_socket:
  Provide a findhook method for ng_socket(4). The node stores a
  hash with names of its hooks. It starts with size of 16, and
  grows when number of hooks reaches twice the current size. A
  failure to grow (memory is allocated with M_NOWAIT) isn't
  fatal, however.

  I used standard hash(9) function for the hash. With 25000
  hooks named in the mpd (ports/net/mpd5) manner of "b%u", the
  distributions is the following: 72.1% entries consist of one
  element, 22.1% consist of two, 5.2% consist of three and
  0.6% of four.

  Speedup in a synthetic test that creates 25000 hooks and then
  runs through a long cyclce dereferencing them in a random order
  is over 25 times.

The last merge was done in an ABI preserving manner, the struct
ngsock is still exposed to userland (unlike in head), but its new
fields are at its end and under #ifdef _KERNEL.

git-svn-id: svn://svn.freebsd.org/base/stable/9@231587 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/subr_hash.c
sys/netgraph/netgraph.h
sys/netgraph/ng_base.c
sys/netgraph/ng_socket.c
sys/netgraph/ng_socketvar.h