Commit Graph

247383 Commits

Author SHA1 Message Date
Jeff Roberson
a81c400e75 Simplify VM and UMA startup by eliminating boot pages. Instead use careful
ordering to allocate early pages in the same way boot pages were but only
as needed.  After the KVA allocator has started up we allocate the KVA that
we consumed during boot.  This also makes the boot pages freeable since they
have vm_page structures allocated with the rest of memory.

Parts of this patch were written and tested by markj.

Reviewed by:	glebius, markj
Differential Revision:	https://reviews.freebsd.org/D23102
2020-01-16 05:01:21 +00:00
Leandro Lupori
e16c18650c [PPC64] memcpy/memmove/bcopy optimization
For copies shorter than 512 bytes, the data is copied using plain
ld/std instructions.
For 512 bytes or more, the copy is done in 3 phases:

Phase 1: copy from the src buffer until it's aligned at a 16-byte boundary
Phase 2: copy as many aligned 64-byte blocks from the src buffer as possible
Phase 3: copy the remaining data, if any

In phase 2, this code uses VSX instructions when available. Otherwise,
it uses ldx/stdx.

Submitted by:	Luis Pires <lffpires_ruabrasil.org> (original version)
Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D15118
2020-01-15 20:25:52 +00:00
Leandro Lupori
181e35008c [PPC64] strncpy optimization
Assembly optimization of strncpy for PowerPC64, using double words
instead of bytes to copy strings.

Submitted by:	Leonardo Bianconi <leonardo.bianconi_eldorado.org.br> (original version)
Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D15369
2020-01-15 19:53:03 +00:00
Leandro Lupori
075fb85f09 [PPC64] strcpy optimization
Assembly optimization of strcpy for PowerPC64, using double words
instead of bytes to copy strings.

Submitted by:	Leonardo Bianconi <leonardo.bianconi_eldorado.org.br> (original version)
Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D15368
2020-01-15 19:46:01 +00:00
Ed Maste
8c5cb4ce25 acpi_ibm: reference ThinkPad instead of IBM
These are now Lenovo ThinkPads, not IBM ThinkPads.

PR:		234403
Submitted by:	Kevin Zheng <kevinz5000@gmail.com> (original)
2020-01-15 19:43:45 +00:00
Kirk McKusick
bbb1e07d65 Peter Holm reports that his test that does an umount(8) on an active
mount point while numerous tests are running that are writing to
files on that mount point cause the unmount(8) to hang forever.

The unmount(8) system call is handled in the kernel by the dounmount()
function. The cause of the hang is that prior to dounmount() calling
VFS_UNMOUNT() it is calling VFS_SYNC(mp, MNT_WAIT). The MNT_WAIT
flag indicates that VFS_SYNC() should not return until all the dirty
buffers associated with the mount point have been written to disk.
Because user processes are allowed to continue writing and can do
so faster than the data can be written to disk, the call to VFS_SYNC()
can never finish.

Unlike VFS_SYNC(), the VFS_UNMOUNT() routine can suspend all processes
when they request to do a write thus having a finite number of dirty
buffers to write that cannot be expanded. There is no need to call
VFS_SYNC() before calling VFS_UNMOUNT(), because VFS_UNMOUNT() needs
to flush everything again anyway after suspending writes, to catch
anything that was dirtied between the VFS_SYNC() and writes being
suspended.

The fix is to simply remove the unnecessary call to VFS_SYNC() from
dounmount().

Reported by:  Peter Holm
Analysis by:  Chuck Silvers
Tested by:    Peter Holm
MFC after:    7 days
Sponsored by: Netflix
2020-01-15 18:53:32 +00:00
Scott Long
92471f7ab7 Fix a spacing error from the previous commit for -ll mode. Add a little
more space padding to that mode to give the columns a consistent offset.
2020-01-15 16:47:44 +00:00
Kyle Evans
a6eb07a961 mips trampoline: don't bother with unwind tables
The utility here seems somewhat limited, but clang will attempt to generate
.eh_frame and actively fail in doing so. It is perhaps worth investigating
why it's being generated in the first place (GCC doesn't do so), but this
isn't a high priority.
2020-01-15 15:59:32 +00:00
Mark Johnston
a7e348d7cf Handle a NULL thread pointer in linux_close_file().
This can happen if a file is closed during unix socket GC.  The same bug
was fixed for devfs descriptors in r228361.

PR:		242913
Reported and tested by:	iz-rpi03@hs-karlsruhe.de
Reviewed by:	hselasky, kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23178
2020-01-15 15:31:35 +00:00
Ed Maste
8fac174c3e Update WITHOUT_BINUTILS* descriptions
In the WITHOUT_ descriptions we don't need to mention that ld.bfd is
limited to powerpc. When WITHOUT_BINUTILS is specified ld.bfd is not
installed on any CPU architecture.
2020-01-15 13:52:13 +00:00
Ben Woods
d512033e2a bsdinstall: Change "default" (first) Partitioning method to ZFS
Reported by:	Ruben Schade (during his talk at linux.conf.au)
Approved by:	philip
Differential Revision:	https://reviews.freebsd.org/D23173
2020-01-15 07:47:52 +00:00
Gleb Smirnoff
9758a507e9 gif_transmit() must always be called in the network epoch. 2020-01-15 06:18:32 +00:00
Gleb Smirnoff
ed0282f46a A miss from r356754. 2020-01-15 06:12:39 +00:00
Gleb Smirnoff
2a4bd982d0 Introduce NET_EPOCH_CALL() macro and use it everywhere where we free
data based on the network epoch.   The macro reverses the argument
order of epoch_call(9) - first function, then its argument. NFC
2020-01-15 06:05:20 +00:00
Gleb Smirnoff
b1328235b4 Use official macro to enter/exit the network epoch. NFC 2020-01-15 05:48:36 +00:00
Gleb Smirnoff
97168be809 Mechanically substitute assertion of in_epoch(net_epoch_preempt) to
NET_EPOCH_ASSERT(). NFC
2020-01-15 05:45:27 +00:00
Gleb Smirnoff
fae994f636 Stop header pollution and don't include if_var.h via in_pcb.h. 2020-01-15 03:41:15 +00:00
Gleb Smirnoff
8fd73e9160 Since this code dereferences struct ifnet, it must include if_var.h
explicitly, not via header pollution.  While here move TCPSTATES
declaration right above the include that is going to make use of it.
2020-01-15 03:40:32 +00:00
Gleb Smirnoff
9074694339 Since this code uses if_ref()/if_rele() it must include if_var.h
explicitly, not via header pollution.
2020-01-15 03:39:11 +00:00
Gleb Smirnoff
35e67a79fb Netgraph queue processing thread must process all its items
in the network epoch.

Reported by:	Michael Zhilin <mizhka@ >
2020-01-15 03:35:57 +00:00
Gleb Smirnoff
3264dcadc9 - Move global network epoch definition to epoch.h, as more different
subsystems tend to need to know about it, and including if_var.h is
  huge header pollution for them.  Polluting possible non-network
  users with single symbol seems much lesser evil.
- Remove non-preemptible network epoch.  Not used yet, and unlikely
  to get used in close future.
2020-01-15 03:34:21 +00:00
Gleb Smirnoff
9cdc43b16e The non-preemptible network epoch identified by net_epoch isn't used.
This code definitely meant net_epoch_preempt.
2020-01-15 03:30:33 +00:00
Mateusz Guzik
cda3176851 vfs: in vop_stdadd_writecount only vlazy vnodes on mounts using msync
The only reason to vlazy there is to (overzealously) ensure all vnodes
which need to be visited by msync scan can be found there.

In particluar this is of no use zfs and tmpfs.

While here depessimize the check.
2020-01-15 01:34:05 +00:00
Mateusz Guzik
2a829749d3 tmpfs: add missing CLTFLAG_MPSAFE annotation 2020-01-15 01:32:11 +00:00
Mateusz Guzik
7493134e08 nfs: add missing CLTFLAG_MPSAFE annotations 2020-01-15 01:31:57 +00:00
Mateusz Guzik
388820fbef fusefs: add missing CLTFLAG_MPSAFE annotation 2020-01-15 01:31:28 +00:00
Mateusz Guzik
da8e950a27 rtld: remove hand rolled memset and bzero
They were introduced to take care of ifunc, but right now no architecture
provides ifunc'ed variants. Since rtld uses memset extensively this results in
a pessmization. Should someone want to use ifunc here they should provide a
mandatory symbol (e.g., rtld_memset).

See the review for profiling data.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D23176
2020-01-15 01:30:32 +00:00
Rebecca Cran
a107ddbb83 bsdinstall: Use TMPDIR if set
Submitted by:	Ryan Moeller <ryan@freqlabs.com>
Reviewed by:	bcran, Nick Wolff <darkfiberiru@gmail.com>
Differential Revision:	https://reviews.freebsd.org/D22979/
2020-01-15 00:45:05 +00:00
Kirk McKusick
0297c1384a When sync'ing a mount point, the mount point's vnodes were scanned
twice. Once to update the changed inodes, and a second time to update
changed quota information. This change merges these two scans into a
single scan which does both inode and quota updates.

MFC after: 7 days
2020-01-14 22:27:46 +00:00
Ed Maste
0002146228 src.conf.5: regen after r356736, limiting ld.bfd to powerpc 2020-01-14 18:06:09 +00:00
John Baldwin
d0cacf5d12 Preserve the inherited value of the status register in cpu_set_upcall().
Instead of re-deriving the value of SR using logic similar to
exec_set_regs(), just inherit the value from the existing thread
similar to fork().

Reviewed by:	brooks
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23059
2020-01-14 18:00:04 +00:00
Ed Maste
1e1c6bb49f limit ld.bfd to powerpc
All archs except powerpc either use lld or require external toolchain.
powerpc still needs binutils ld to link 32-bit binaries.

Reviewed by:	jhibbits
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23107
2020-01-14 17:56:54 +00:00
Kyle Evans
4b50c45172 Revert r353140: Re-add ALLOW_MIPS_SHARED_TEXTREL, sprinkle it around
arichardson has an actual fix for the same issue that this was working
around; given that we don't build with llvm today, go ahead and revert the
workaround in advance.
2020-01-14 17:50:13 +00:00
Ed Maste
8683408cec src.conf.5: regen after option description updates 2020-01-14 17:38:34 +00:00
Ed Maste
0843201309 Update WITH_/WITHOUT_CLANG_IS_CC descriptions
Describe /usr/bin/cc etc. as links to the compiler, and don't conflate
WITHOUT_CLANG_IS_CC with installing GCC.  Leave a reference to WITH_GCC
and WITHOUT_CLANG_IS_CC installing links to GCC, although this will be
removed in ~1.5 months when GCC 4.2.1 is removed from the tree.

Sponsored by:	The FreeBSD Foundation
2020-01-14 17:35:34 +00:00
Ed Maste
980aad374e Update WITH_AMD description reflecting upcoming removal
In-tree amd(8) is deprecated; update WITH_AMD's description to make
this more clear.

Sponsored by:	The FreeBSD Foundation
2020-01-14 16:59:21 +00:00
Mark Johnston
7dddaa0979 Do not skip line-by-line comparison if -q and -I are specified.
This fixes a regression from r356695.

Submitted by:	kevans
Reported by:	Jenkins via lwhsu
MFC after:	6 days
2020-01-14 15:35:03 +00:00
Andriy Gapon
efdba95d62 storvsc: port a Linux patch, properly set residual data length on errors
This change is based on Linux commit 40630f462824ee.  csio.resid should
account for transfer_len only for success and SRB_STATUS_DATA_OVERRUN
condition.

I am not sure how exactly this change works, but I have a report from a
user that they see lots of checksum errors when running a pool scrub
concurrently with iozone -l 1 -s 100G.  After applying this patch the
problem cannot be reproduced.

Reviewed by:	nobody
Sponsored by:	CyberSecure
Differential Revision: https://reviews.freebsd.org/D22312
2020-01-14 13:20:16 +00:00
Edward Tomasz Napierala
9c6eb0f92f Make linux(4) use kern_setsockopt(9) instead of going through
sys_setsockopt.  Just a cleanup; no functional changes.

Reviewed by:	kib
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D22812
2020-01-14 11:33:07 +00:00
Edward Tomasz Napierala
dfd060c0b6 Make linux(4) use kern_getsockopt(9) instead of going through
sys_getsockopt().  It's a cleanup; no functional changes.

Reviewed by:	kib (earlier version)
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D22813
2020-01-14 11:30:30 +00:00
Edward Tomasz Napierala
46209ceae5 Make linux getcpu(2) report the domain.
Submitted by:	markj
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23144
2020-01-14 11:24:06 +00:00
Baptiste Daroussin
12d9c0dc55 When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.

Obtained from:	OpenBSD
MFC after:	3 days
2020-01-14 08:22:28 +00:00
Baptiste Daroussin
f9eac42577 asprintf returns -1, not an arbitrary value < 0. Also upon error the
(very sloppy specification) leaves an undefined value in *ret, so it is
wrong to inspect it, the error condition is enough.

Obtained from:	OpenBSD
MFC after:	3 days
2020-01-14 08:18:04 +00:00
Baptiste Daroussin
a3337141a4 mkstemp returns -1
Obtained from:	OpenBSD
MFC after:	3 days
2020-01-14 08:16:15 +00:00
Alexander Motin
ace409ce9c Restore loop break in vm_pageout_lowmem().
r355004 removed return statement from this loop with intention to also
call uma_reclaim_wakeup().  But in case of vm.lowmem_period=0 it causes
infinite loop.

Reviewed by:	markj
Sponsored by:	iXsystems, Inc.
2020-01-14 03:27:57 +00:00
Ryan Libby
9b8db4d0a0 uma: split slabzone into two sizes
By allowing more items per slab, we can improve memory efficiency for
small allocs.  If we were just to increase the bitmap size of the
slabzone, we would then waste slabzone memory.  So, split slabzone into
two zones, one especially for 8-byte allocs (512 per slab).  The
practical effect should be reduced memory usage for counter(9).

Reviewed by:	jeff, markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23149
2020-01-14 02:14:15 +00:00
Ryan Libby
51871224c0 malloc: remove assumptions about MINALLOCSIZE
Remove assumptions about the minimum MINALLOCSIZE, in order to allow
testing of smaller MINALLOCSIZE.  A following patch will lower the
MINALLOCSIZE, but not so much that the present patch is required for
correctness at these sites.

Reviewed by:	jeff, markj
Sponsored by:	Dell EMC Isilon
2020-01-14 02:14:02 +00:00
Ryan Libby
e63a1c2f52 uma: fixup some ktr messages
Reviewed by:	markj
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D23148
2020-01-14 02:13:46 +00:00
Jeff Roberson
815b74866a Fix a long standing bug in journaled soft-updates. The dirrem structure
needs to handle file removal, directory removal, file move, directory move,
etc.  The code in handle_workitem_remove() needs to propagate any completed
journal entries to the write that will render the change stable.  In the
case of a moved directory this means the new parent.  However, for an
overwrite that frees a directory (DIRCHG) we must move the jsegdep to the
removed inode to be released when it is stable in the cg bitmap or the
unlinked inode list.  This case was previously unhandled and caused a
panic.

Reported by:	mckusick, pho
Reviewed by:	mckusick
Tested by:	pho
2020-01-14 02:00:24 +00:00
Navdeep Parhar
46d29cab25 cxgbe/iw_cxgbe: Do not allow memory registrations with page size greater
than 128MB, which is the maximum supported by the hardware in RDMA mode.

Obtained from:	Chelsio Communications
MFC after:	3 days
Sponsored by:	Chelsio Communications
2020-01-14 01:43:04 +00:00