Commit Graph

129277 Commits

Author SHA1 Message Date
Konstantin Belousov
5b87ecc643 Assert that vnode_pager_setsize() is called with the vnode exclusively locked
except for filesystems that set the MNTK_VMSETSIZE_BUG,  Set the flag for ZFS.

Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D21883
2019-10-22 16:21:24 +00:00
Konstantin Belousov
c6ba06d86c Fix interface between nfsclient and vnode pager.
Make the nfsclient always call vnode_pager_setsize() with the vnode
exclusively locked.  This ensures that page fault always can find the
backing page if the object size check succeeded.  Set VV_VMSIZEVNLOCK
flag on NFS nodes.

The main offender breaking the interface in nfsclient is
nfs_loadattrcache(), which is used whenever server responded with
updated attributes, which can happen on non-changing operations as
well.  Also, iod threads only have buffers locked (and even that is
LK_KERNPROC), but they still may call nfs_loadattrcache() on RPC
response.

Instead of immediately calling vnode_pager_setsize() if server
response indicated changed file size, but the vnode is not exclusively
locked, set a new node flag NVNSETSZSKIP.  When the vnode exclusively
locked, or when we can temporary upgrade the lock to exclusive, call
vnode_pager_setsize(), by providing the nfsclient VOP_LOCK() implementation.

Tested by:	pho
Discussed with:	rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D21883
2019-10-22 16:17:38 +00:00
Konstantin Belousov
208b81bb05 Add VV_VMSIZEVNLOCK flag.
The flag specifies that vm_fault() handler should check the vnode'
vm_object size under the vnode lock.  It is converted into the object'
OBJ_SIZEVNLOCK flag in vnode_pager_alloc().

Tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D21883
2019-10-22 16:09:25 +00:00
Gleb Smirnoff
be0c32e2ff Execute nd6_dad_timer() in the network epoch, since nd6_dad_duplicated()
requires it.
Make nd6_dad_starttimer() require network epoch.  Two calls out of three
happen from nd6_dad_timer().  Enter epoch in the remaining one.
2019-10-22 16:06:33 +00:00
Konstantin Belousov
0ddd3082a4 vm_fault(): extract code to lock the vnode into a helper vn_fault_lock_vnode().
Tested by:	pho
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D21883
2019-10-22 15:59:16 +00:00
Andriy Gapon
155514eacf nctgpio: improve performance (latency) of operation
This change consists of two parts.

First, nctgpio now supports hardware access via an I/O port window if
it's configured by firmware.  For instance, PC Engines firmware
v4.10.0.2 does that.  This is faster than going through the Super I/O
configuration registers.

Second, nctgpio now caches values of bits that it controls.  For
example, the driver does not need to access the hardware to determine if
a pin is an output or an input, or a state of an output.  Also, the
driver makes use of the fact that the hardware preserves an output state
of a pin accross a switch to the input mode and back.

With this change I am able to use the 1-Wire bus over nctgpio whereas
previously the driver introduced too much latency to be compliant with
the relatively strict protocol timings.

superio0: <Nuvoton NCT5104D/NCT6102D/NCT6106D (rev. B+)> at port 0x2e-0x2f on isa0
gpio1: <Nuvoton GPIO controller> at GPIO ldn 0x07 on superio0
pcib0: allocated type 4 (0x220-0x226) for rid 0 of gpio1
gpiobus1: <GPIO bus> on gpio1
owc0: <GPIO attached one-wire bus> at pin 4 on gpiobus1
ow0: <1 Wire Bus> on owc0
ow0: romid 28:b2:9e:45:92:10:02:34: no driver
ow_temp0: <Advanced One Wire Temperature> romid 28:b2:9e:45:92:10:02:34 on ow0

MFC after:	4 weeks
2019-10-22 14:20:35 +00:00
Mark Johnston
1de9724e55 Avoid reloading bucket pointers in uma_vm_zone_stats().
The correctness of per-CPU cache accounting in that function is
dependent on reading per-CPU pointers exactly once.  Ensure that
the compiler does not emit multiple loads of those pointers.

Reported and tested by:	pho
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D22081
2019-10-22 14:20:06 +00:00
Kyle Evans
200abb43c0 tuntap(4): properly declare if_tun and if_tap modules
Simply adding MODULE_VERSION does not do the trick, because the modules
haven't been declared. This should actually fix modfind/kldstat, which
r351229 aimed and failed to do.

This should make vm-bhyve do the right thing again when using the ports
version, rather than the latest version not in ports.

MFC after:	3 days
2019-10-22 00:18:16 +00:00
Gleb Smirnoff
77d70e515f Assert that any epoch tracker belongs to the thread stack.
Reviewed by:	kib
2019-10-21 23:12:14 +00:00
Kyle Evans
bc9ea1ceb8 if_tuntap: remove if_{tun,tap}.ko -> if_tuntap.ko links
These drivers have been merged into a single if_tuntap in 13.0. The
compatibility links existed only for the interim and will be MFC'd along
with the if_tuntap merge shortly.

MFC after:	never
2019-10-21 20:28:38 +00:00
Gleb Smirnoff
279b9aabe3 Remove epoch tracker from struct thread. It was an ugly crutch to emulate
locking semantics for if_addr_rlock() and if_maddr_rlock().
2019-10-21 18:19:32 +00:00
Gleb Smirnoff
19e09f447f Remove obsoleted KPIs that were used to access interface address lists. 2019-10-21 18:17:03 +00:00
Gleb Smirnoff
38e1a6585b Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:13:37 +00:00
Gleb Smirnoff
d01532086c Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:13:33 +00:00
Gleb Smirnoff
9321bbc558 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:13:28 +00:00
Gleb Smirnoff
c65484668d Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:13:24 +00:00
Gleb Smirnoff
915a6a5179 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:13:19 +00:00
Gleb Smirnoff
45193b43a1 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:13:14 +00:00
Gleb Smirnoff
4d50c26a10 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:58 +00:00
Gleb Smirnoff
c3cf8a054b Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:40 +00:00
Gleb Smirnoff
5c973840f1 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:36 +00:00
Gleb Smirnoff
bc0bdf25c7 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:31 +00:00
Gleb Smirnoff
6dfd087076 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:26 +00:00
Gleb Smirnoff
a4589b2d1a Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:21 +00:00
Gleb Smirnoff
854d87acf2 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:17 +00:00
Gleb Smirnoff
fe8a3369a8 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:12 +00:00
Gleb Smirnoff
2066c71656 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:07 +00:00
Gleb Smirnoff
7384b10ff1 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:12:02 +00:00
Gleb Smirnoff
55b4d627f8 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:58 +00:00
Gleb Smirnoff
9602d60039 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:54 +00:00
Gleb Smirnoff
660d39418f Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:48 +00:00
Gleb Smirnoff
119a6396ca Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:43 +00:00
Gleb Smirnoff
745894d7e5 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:38 +00:00
Gleb Smirnoff
57cc02c62e Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:32 +00:00
Gleb Smirnoff
36581f8254 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:28 +00:00
Gleb Smirnoff
c42980268b Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:24 +00:00
Gleb Smirnoff
3e346c0a6c Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:19 +00:00
Gleb Smirnoff
51e8082055 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:15 +00:00
Gleb Smirnoff
02cc07d105 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:11 +00:00
Gleb Smirnoff
8bd97b0772 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:08 +00:00
Gleb Smirnoff
95f4453e15 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:11:02 +00:00
Gleb Smirnoff
bdf4b0ae33 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:10:58 +00:00
Gleb Smirnoff
dbf9bf044c Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:10:52 +00:00
Gleb Smirnoff
5b7a9eab16 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:10:46 +00:00
Gleb Smirnoff
380a564dc2 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:08:25 +00:00
Gleb Smirnoff
5d0c611c51 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:08:20 +00:00
Gleb Smirnoff
0a3c7ec0f4 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:08:16 +00:00
Gleb Smirnoff
44a30c6224 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:08:12 +00:00
Gleb Smirnoff
0407b8bf7a Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:08:03 +00:00
Gleb Smirnoff
e9c5104f43 Convert to if_foreach_llmaddr() KPI. 2019-10-21 18:07:56 +00:00