OPNsense - FreeBSD source
Find a file
Xin LI fcf8d36c46 hyperv: vmbus: run non-blocking message handlers in vmbus_msg_swintr()
We'll remove the per-channel control_work_queue because it can't properly
do serialization of message handling, e.g., when there are 2 NIC devices,
vmbus_channel_on_offer() -> hv_queue_work_item() has a race condition:
for an SMP VM, vmbus_channel_process_offer() can run concurrently on
different CPUs and if the second NIC's
vmbus_channel_process_offer() -> hv_vmbus_child_device_register() runs
first, the second NIC's name will be hn0 and the first NIC's name will
be hn1!

We can fix the race condition by removing the per-channel control_work_queue
and run all the message handlers in the global
hv_vmbus_g_connection.work_queue -- we'll do this in the next patch.

With the coming next patch, we have to run the non-blocking handlers
directly in the kernel thread vmbus_msg_swintr(), because the special
handling of sub-channel: when a sub-channel (e.g., of the storvsc driver)
is received and being handled in vmbus_channel_on_offer() running on the
global hv_vmbus_g_connection.work_queue, vmbus_channel_process_offer()
invokes channel->sc_creation_callback, i.e., storvsc_handle_sc_creation,
and the callback will invoke hv_vmbus_channel_open() -> hv_vmbus_post_message
and expect a further reply from the host, but the handling of the further
messag can't be done because the current message's handling hasn't finished
yet; as result, hv_vmbus_channel_open() -> sema_timedwait() will time out
and th device can't work.

Also renamed the handler type from hv_pfn_channel_msg_handler to
vmbus_msg_handler: the 'pfn' and 'channel' in the old name make no sense.

Submitted by:	Dexuan Cui <decui microsoft com>
Reviewed by:	royger
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4596
2015-12-29 08:19:43 +00:00
bin sh: Add tests for #/##/%/%% on $* and $@. 2015-12-26 22:27:48 +00:00
cddl Reduce zfs utilities overlinking 2015-12-24 11:56:37 +00:00
contrib Staticize several variables that are used exclusively in bsnmpd/main.c and 2015-12-28 01:51:20 +00:00
crypto Incorrect length in calloc() call, already fixed upstream. 2015-12-17 19:36:25 +00:00
etc Let old-style (shell-based) jail configuration handle jail names that 2015-12-26 23:01:34 +00:00
gnu Install ld also as ld.bfd, for use with cc -fuse-ld=bfd 2015-12-23 14:31:26 +00:00
include Replace implementation of hsearch() by one that scales. 2015-12-27 07:50:11 +00:00
kerberos5 DIRDEPS_BUILD: Update dependencies. 2015-12-07 23:53:01 +00:00
lib The FILE structure has a mbstate_t in it. This structure needs to be 2015-12-27 23:04:11 +00:00
libexec Use a macro to create the names for the library path names. This will 2015-12-27 23:04:12 +00:00
release Fix tmpfs(5) '/tmp' mount point. 2015-11-25 19:10:04 +00:00
rescue Fix the build after ifconfig was converted over to lib80211 in r291470 2015-11-30 16:34:13 +00:00
sbin Add SFF-8024 Extended Specification Compliance 2015-12-28 09:26:07 +00:00
secure Build engines in parallel. 2015-12-15 19:57:56 +00:00
share procfs(5) is not required by ps(1) and w(1) anymore 2015-12-26 14:23:35 +00:00
sys hyperv: vmbus: run non-blocking message handlers in vmbus_msg_swintr() 2015-12-29 08:19:43 +00:00
targets local.meta.sys.mk already defines TARGET_ARCHES_arm 2015-12-08 00:22:24 +00:00
tests Remove retval to fix a -Wunused-but-set-variable warning from gcc 4.9 2015-12-28 02:36:57 +00:00
tools - Explicitly initialize ch to 0 2015-12-28 00:53:37 +00:00
usr.bin Add on systat -vm the ability to display the physical and kernel memory 2015-12-28 02:07:56 +00:00
usr.sbin Simplify code for parsing extra groups 2015-12-29 00:08:32 +00:00
.arcconfig Add repository.callsign, to help arcanist figure out what repo it's 2015-07-02 22:23:52 +00:00
.arclint phabricator related changes: 2015-04-20 20:33:22 +00:00
COPYRIGHT Bump copyright year. 2014-12-31 10:00:43 +00:00
LOCKS Explicitly require Security Officer's approval for kernel PRNG bits. 2013-09-17 14:19:05 +00:00
MAINTAINERS Add interests/maintainerships + notes 2015-12-28 19:29:05 +00:00
Makefile Update advice on obj disk space requirements 2015-12-14 19:20:18 +00:00
Makefile.inc1 Fixup native-xtools target for poudriere cross build jails after svn 2015-12-23 21:55:54 +00:00
ObsoleteFiles.inc Upgrade our copies of clang and llvm to 3.7.1 release. This is a 2015-12-25 21:39:45 +00:00
README README: changes and fixups 2015-04-19 07:16:44 +00:00
UPDATING pxeboot: make the tftp loader use the option root-path directive 2015-12-16 17:13:09 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html