Commit Graph

247032 Commits

Author SHA1 Message Date
bouyer 9ae5fc1a0b Rename "CH341 serial/parallel" to "CH341 USB-Serial Bridge", and
add a second device id for this chip.
From FreeBSD.
2016-12-12 16:41:08 +00:00
christos 8a4f73aacb simple path fixes 2016-12-12 16:30:03 +00:00
maya 21cc7f1b6b acknowleg -> acknowledg, proceedure -> procedure.
only comments were changed.

from miod
2016-12-12 15:58:44 +00:00
nat b2644509c2 Fix path to files.audio. 2016-12-12 13:31:13 +00:00
kamil 2cfd9597d2 Add missing files in distribution file lists to fix evbarm64-aarch64 build
Add ./usr/libdata/ldscripts/aarch64elf{,b}.xd{,c,w}

Tested with MKLLVM=yes and HAVE_LLVM=yes.
2016-12-12 13:13:11 +00:00
nat 4012ae34ea Update audio man page with regard to audio changes.
OK wiz@
2016-12-12 11:49:27 +00:00
joerg 9b3102e4b1 Mark bell_thread as static and dead. 2016-12-12 10:46:39 +00:00
joerg 5e6012ec99 sig_atomic_t does not include volatile. Prevent static analysis from
understanding that the test function is dead.
2016-12-12 10:34:55 +00:00
wiz c985f95b45 Improve wording. Fix typo. Remove superfluous Pp. 2016-12-12 10:13:00 +00:00
wiz 9b02f8947b New sentence, new line.
Sort SEE ALSO.
2016-12-12 10:10:05 +00:00
wiz 36a13280ea Fix xref. 2016-12-12 10:09:52 +00:00
wiz d8a6eb3c16 Whitespace. 2016-12-12 10:07:48 +00:00
knakahara 446d4c27f3 fix accidentally if_pppoe atf failure depends on cpu workload.
advised by s-yamaguchi@IIJ, thanks.
2016-12-12 09:56:58 +00:00
christos 2b4d6aa5a1 fix placement of lint comment 2016-12-12 04:20:31 +00:00
ozaki-r 55a0c560da Bump for MP-safe routing table
Welcome to 7.99.46
2016-12-12 03:59:24 +00:00
ozaki-r 6fb8880601 Make the routing table and rtcaches MP-safe
See the following descriptions for details.

Proposed on tech-kern and tech-net


Overview
--------

We protect the routing table with a rwock and protect
rtcaches with another rwlock. Each rtentry is protected
from being freed or updated via reference counting and psref.

Global rwlocks
--------------

There are two rwlocks; one for the routing table (rt_lock) and
the other for rtcaches (rtcache_lock). rtcache_lock covers
all existing rtcaches; there may have room for optimizations
(future work).

The locking order is rtcache_lock first and rt_lock is next.

rtentry references
------------------

References to an rtentry is managed with reference counting
and psref. Either of the two mechanisms is used depending on
where a rtentry is obtained. Reference counting is used when
we obtain a rtentry from the routing table directly via
rtalloc1 and rtrequest{,1} while psref is used when we obtain
a rtentry from a rtcache via rtcache_* APIs. In both cases,
a caller can sleep/block with holding an obtained rtentry.

The reasons why we use two different mechanisms are (i) only
using reference counting hurts the performance due to atomic
instructions (rtcache case) (ii) ease of implementation;
applying psref to APIs such rtaloc1 and rtrequest{,1} requires
additional works (adding a local variable and an argument).

We will finally migrate to use only psref but we can do it
when we have a lockless routing table alternative.

Reference counting for rtentry
------------------------------

rt_refcnt now doesn't count permanent references such as for
rt_timers and rtcaches, instead it is used only for temporal
references when obtaining a rtentry via rtalloc1 and rtrequest{,1}.
We can do so because destroying a rtentry always involves
removing references of rt_timers and rtcaches to the rtentry
and we don't need to track such references. This also makes
it easy to wait for readers to release references on deleting
or updating a rtentry, i.e., we can simply wait until the
reference counter is 0 or 1. (If there are permanent references
the counter can be arbitrary.)

rt_ref increments a reference counter of a rtentry and rt_unref
decrements it. rt_ref is called inside APIs (rtalloc1 and
rtrequest{,1} so users don't need to care about it while
users must call rt_unref to an obtained rtentry after using it.

rtfree is removed and we use rt_unref and rt_free instead.
rt_unref now just decrements the counter of a given rtentry
and rt_free just tries to destroy a given rtentry.

See the next section for destructions of rtentries by rt_free.

Destructions of rtentries
-------------------------

We destroy a rtentry only when we call rtrequst{,1}(RTM_DELETE);
the original implementation can destroy in any rtfree where it's
the last reference. If we use reference counting or psref, it's
easy to understand if the place that a rtentry is destroyed is
fixed.

rt_free waits for references to a given rtentry to be released
before actually destroying the rtentry. rt_free uses a condition
variable (cv_wait) (and psref_target_destroy for psref) to wait.

Unfortunately rtrequst{,1}(RTM_DELETE) can be called in softint
that we cannot use cv_wait. In that case, we have to defer the
destruction to a workqueue.

rtentry#rt_cv, rtentry#rt_psref and global variables
(see rt_free_global) are added to conduct the procedure.

Updates of rtentries
--------------------

One difficulty to use refcnt/psref instead of rwlock for rtentry
is updates of rtentries. We need an additional mechanism to
prevent readers from seeing inconsistency of a rtentry being
updated.

We introduce RTF_UPDATING flag to rtentries that are updating.
While the flag is set to a rtentry, users cannot acquire the
rtentry. By doing so, we avoid users to see inconsistent
rtentries.

There are two options when a user tries to acquire a rtentry
with the RTF_UPDATING flag; if a user runs in softint context
the user fails to acquire a rtentry (NULL is returned).
Otherwise a user waits until the update completes by waiting
on cv.

The procedure of a updater is simpler to destruction of
a rtentry. Wait on cv (and psref) and after all readers left,
proceed with the update.

Global variables (see rt_update_global) are added to conduct
the procedure.

Currently we apply the mechanism to only RTM_CHANGE in
rtsock.c. We would have to apply other codes. See
"Known issues" section.

psref for rtentry
-----------------

When we obtain a rtentry from a rtcache via rtcache_* APIs,
psref is used to reference to the rtentry.

rtcache_ref acquires a reference to a rtentry with psref
and rtcache_unref releases the reference after using it.
rtcache_ref is called inside rtcache_* APIs and users don't
need to take care of it while users must call rtcache_unref
to release the reference.

struct psref and int bound that is needed for psref is
embedded into struct route. By doing so we don't need to
add local variables and additional argument to APIs.

However this adds another constraint to psref other than
reference counting one's; holding a reference of an rtentry
via a rtcache is allowed by just one caller at the same time.
So we must not acquire a rtentry via a rtcache twice and
avoid a recursive use of a rtcache. And also a rtcache must
be arranged to be used by a LWP/softint at the same time
somehow. For IP forwarding case, we have per-CPU rtcaches
used in softint so the constraint is guaranteed. For a h
rtcache of a PCB case, the constraint is guaranteed by the
solock of each PCB. Any other cases (pf, ipf, stf and ipsec)
are currently guaranteed by only the existence of the global
locks (softnet_lock and/or KERNEL_LOCK). If we've found the
cases that we cannot guarantee the constraint, we would need
to introduce other rtcache APIs that use simple reference
counting.

psref of rtcache is created with IPL_SOFTNET and so rtcache
shouldn't used at an IPL higher than IPL_SOFTNET.

Note that rtcache_free is used to invalidate a given rtcache.
We don't need another care by my change; just keep them as
they are.

Performance impact
------------------

When NET_MPSAFE is disabled the performance drop is 3% while
when it's enabled the drop is increased to 11%. The difference
comes from that currently we don't take any global locks and
don't use psref if NET_MPSAFE is disabled.

We can optimize the performance of the case of NET_MPSAFE
on by reducing lookups of rtcache that uses psref;
currently we do two lookups but we should be able to trim
one of two. This is a future work.

Known issues
------------

There are two known issues to be solved; one is that
a caller of rtrequest(RTM_ADD) may change rtentry (see rtinit).
We need to prevent new references during the update. Or
we may be able to remove the code (perhaps, need more
investigations).

The other is rtredirect that updates a rtentry. We need
to apply our update mechanism, however it's not easy because
rtredirect is called in softint and we cannot apply our
mechanism simply. One solution is to defer rtredirect to
a workqueue but it requires some code restructuring.
2016-12-12 03:55:57 +00:00
ozaki-r f2613b7f35 Introduce macros for the prefix list
No functional change.
2016-12-12 03:14:01 +00:00
ozaki-r f5a82c952d Introduce macros for the default router list
No functional change.
2016-12-12 03:13:14 +00:00
pgoyette e0bed1f988 Make kernels w/o ACPICA compile. (Same "fix" as Martin made to i386...)
cvs: ----------------------------------------------------------------------
2016-12-12 02:51:24 +00:00
martin e4d8985f7f Make kernels w/o ACPICA compile. 2016-12-11 22:38:50 +00:00
blymn 4114d2610d Improve debug information. 2016-12-11 21:25:22 +00:00
mrg 48524f008b there was a bug fix in july. call this 20160720. 2016-12-11 20:40:41 +00:00
christos 2437894b76 catch up with sd changes. 2016-12-11 16:25:54 +00:00
christos 3d8a0ad9b3 PR/51706: Amir Plivatsky: Fix memory leak 2016-12-11 15:47:06 +00:00
christos a106fb55e5 Add libprop for static linking 2016-12-11 15:43:48 +00:00
skrll 3c2315de2f Fix some bugs introduced by the nick-nhusb merge and related to the
Tx Interrupt pipe transfer handling

While I'm here make some other changes moving towards MPification

PR/51151: athn panic on attach
PR/51458: usb athn panic
2016-12-11 15:01:37 +00:00
flxd 93b71490f8 Note scsictl(8) getrealloc and setrealloc commands. 2016-12-11 12:51:09 +00:00
martin 4fedd9d77b Improve a panic message with a bit details 2016-12-11 10:28:00 +00:00
mrg 2c22342178 copyright and date maint. 2016-12-11 08:40:10 +00:00
maxv b6a32da467 Kenter local_apic_va to a fake physical page, because our x86
implementation expects this va to be valid even if no lapic is present;
which probably is a bug in itself, but let's just reproduce the old
behavior and rehide that bug.
2016-12-11 08:31:53 +00:00
skrll 34f6acde6b More ATHN_DEBUG 2016-12-11 08:30:39 +00:00
nat baaaeb8681 Update test output to reflect audio changes. 2016-12-11 08:09:29 +00:00
skrll 84a7873a10 KNF 2016-12-11 08:06:39 +00:00
skrll 677845f4cd Fix athn async stuff - the wakeup call should have been converted to
cv_broadcast.

While here remove unnecessary splusb usage.
2016-12-11 08:04:17 +00:00
ozaki-r 95eeb954a9 Add nd6_ prefix to exported functions 2016-12-11 07:38:50 +00:00
ozaki-r 091c448c26 Move default interface things from nd6_rtr.c to nd6.c 2016-12-11 07:37:53 +00:00
ozaki-r 100c447a96 Make some functions static 2016-12-11 07:36:55 +00:00
nat a205694d0a PR 50613: Onno van der Linden: unpausing audio(4) causes already written
data to be dropped.
Applied patch prepared by Onno.
2016-12-11 07:36:30 +00:00
ozaki-r c43c0bf31c Remove function declarations that have no actual definition 2016-12-11 07:36:20 +00:00
ozaki-r eecbd48e68 Correct sanity checks of icmp6_redirect_output
- rt->rt_ifp is always non-NULL
- Checking RTF_UP here is just racy and meaningless
- The arguments should be non-NULL (at least for now)
2016-12-11 07:35:42 +00:00
ozaki-r a5540a4a8e Remove unnecessary forward struct declarations 2016-12-11 07:34:14 +00:00
christos e04e53e08d complete the transition to binutils-2.27 2016-12-11 06:37:49 +00:00
christos 56de918b3d one more vaudiospeaker remove 2016-12-11 06:30:11 +00:00
nat daf039cf2e Ensure variables are initialized. Fixes error due to -Wmaybe-unitialized. 2016-12-11 05:27:00 +00:00
mrg 9aed0f5ab2 aarch64 builds work with binutils 2.27. switch it. hppa builds,
just needs a run time test if someone wants.  then we're done!
2016-12-11 03:40:57 +00:00
kamil f120395189 Skip t_exect test because it makes test machines to hang
exect(NULL,NULL,NULL) generates 15859 times SIGTRAP on amd64
Currently exect(3) is misdesigned -- see PR port-amd64/51700 and it
needs to be redone from scratch.

This test affects amd64 releng machines causing tests to hang or
fail. As there is little point to test interface that is still not,
designed and implemented and implemented and is breaking tests - skip it
unconditionally for all ports.

Sponsored by <The NetBSD Foundation>
2016-12-11 03:38:09 +00:00
mrg 692b61f19e switch mips (32 bit) and arm to binutils 2.27. hppa and aarch64 left. 2016-12-11 02:38:54 +00:00
mrg 42a13a4db0 mknative-binutils 2.27 and hppa. 2016-12-11 02:13:34 +00:00
mrg 16e7be53ca regen binutils mknative files for binutils 2.27 on mipsel, mipseb and aarch64. 2016-12-11 01:53:43 +00:00
mrg fa2fc3a3fc add a bunch of stuff i've done since netbsd-7. fix a few entries. 2016-12-11 01:44:32 +00:00