FreeBSD/src 324944head/sys/cam cam_iosched.c

Treat a 'current' value of 0 as unlimited as a failsfe.

When limiting I/O, a value of 0 makes no sense as a limit. No progress
can be made. Trade the possibility that someone might be doing
something clever to achieve ultra-low I/O limits vs the damage of not
ever making progress on an I/O in favor of making progress. Now the
machine won't be useless if this accidentally gets requested.

Sponsored by: Netflix

FreeBSD/src 324943stable 11, stable/11/tests/sys/kern ptrace_test.c

MFC r318246,r324566,r324668,r324701:

    Add a regression test for r318191.
    Fix shadowed variable hidden by WARNS changing to 3 in r313006.
    This child is expected to exit on SIGTRAP, don't leave a core behind.
    Add a test for r324671 along with some other masked tests.

FreeBSD/src 324942stable 11, stable/11/lib/libc/sys write.2

MFC r324683: write.2: correct maximum nbytes size for EINVAL error

In FreeBSD 11 and later debug.iosize_max_clamp defaults to 0, and the
maximum nbytes count for write(2) is SSIZE_MAX. Update the man page to
document this, and mention the sysctl that can be set to obtain the
previous behaviour.

PR:            196666
Sponsored by:   The FreeBSD Foundation

FreeBSD/src 324941head/lib/libc/sys aio_suspend.2 lio_listio.2, head/sys/kern vfs_aio.c

Remove artificial restriction on lio_listio's operation count

In r322258 I made p1003_1b.aio_listio_max a tunable. However, further
investigation shows that there was never any good reason for that limit to
exist in the first place. It's used in two completely different ways:

* To size a UMA zone, which globally limits the number of concurrent
  aio_suspend calls.

* To artifically limit the number of operations in a single lio_listio call.
  There doesn't seem to be any memory allocation associated with this limit.

This change does two things:

* Properly names aio_suspend's UMA zone, and sizes it based on a new constant.

* Eliminates the artifical restriction on lio_listio. Instead, lio_listio
  calls will now be limited by the more generous max_aio_queue_per_proc. The
  old p1003_1b.aio_listio_max is now an alias for
  vfs.aio.max_aio_queue_per_proc, so sysconf(3) will still work with

Reported by:    bde
Reviewed by:    jhb
MFC after:      3 weeks

    [2 lines not shown]

FreeBSD/src 324940head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs vdev_geom.c

Fix the error message when creating a zpool on a too-small device

Don't check for SPA_MINDEVSIZE in vdev_geom_attach when opening by path.
It's redundant with the check in vdev_open, and failing to attach here
results in the wrong error message being printed.  However, still check for
it in some other situations:

* When opening by guids, so we don't get bogged down reading from slow
  devices like floppy drives.
* In vdev_geom_read_pool_label for the same reason, because we iterate over
  all providers.
* If the caller requests that we verify the guid, because then we'll have to
  read from the device before vdev_open verifies the size.

PR:            222227
Reported by:    Marie Helene Kvello-Aune <marieheleneka at>
Reviewed by:    avg, mav
MFC after:      3 weeks
Sponsored by:   Spectra Logic Corp
Differential Revision:

FreeBSD/src 324939stable 11, stable/11/usr.sbin/diskinfo diskinfo.8

MFC r324241:

Fix copy/paste error in diskinfo.8 from r320555

Sponsored by:   Spectra Logic Corp

FreeBSD/src 324938head/contrib/jemalloc/include/jemalloc/internal tsd.h

After jemalloc was updated to version 5.0.0 in r319971, i386 executables
linked with AddressSanitizer (even those linked on earlier versions of
FreeBSD, or with external versions of clang) started failing with errors
similar to:

  ==14688==AddressSanitizer CHECK failed:
  "((AddrIsAlignedByGranularity(addr))) != (0)" (0x0, 0x0)

This is because AddressSanitizer expects all the TLS data in the program
to be aligned to at least 8 bytes.

Before the jemalloc 5.0.0 update, all the TLS data in the i386 version
of added up to 80 bytes (a multiple of 8), but 5.0.0 made this
grow to 2404 bytes (not a multiple of 8).  This is due to added caching
data in jemalloc's internal struct tsd_s.

To fix AddressSanitizer, ensure this struct is aligned to at least 16
bytes, which can be done unconditionally for all architectures.  (An
earlier version of the fix aligned the struct to 8 bytes, but only for
ILP32 architectures.  This was deemed unnecessarily complicated.)

PR:            221337
X-MFC-With:     r319971

FreeBSD/src 324937head/sys/net iflib.c

Some cache related optimizations

1. prefetch 128 bytes of mbufs.
2. Re-order filling the pkt_info so cache stalls happen at the end
3. Define empty prefetch2cachelines() macro when the function isn't present.

Provides small performance improvments on some hardware

Reviewed by:    sbruno
Approved by:    sbruno (mentor)
Sponsored by:   Limelight Networks
Differential Revision:
+16-71 files

FreeBSD/src 324936head/share/man/man8 uefi.8

uefi.8: mention use on (32-bit) arm

Sponsored by:   The FreeBSD Foundation

FreeBSD/src 324935stable 11, stable/11/sys/kern kern_sig.c

MFC r324671:
Re-evaluate thread' signal mask after ptracestop().

FreeBSD/src 324934stable/11/sys/sys proc.h

Fix struct thread padding field names.

Direct commit to stable/11.

FreeBSD/src 324933stable/11/sys/sys proc.h

struct ksiginfo has MD size, so use it as the padding type to avoid the wrong size.

This is a direct commit to stable/11 to fix r324932.

Spotted by:     kib

FreeBSD/src 324932stable/11/lib/libprocstat core.c libprocstat.c, stable/11/sys/kern imgact_elf.c kern_sig.c

MFC r316286:

  Add support for capturing 'struct ptrace_lwpinfo' for signals resulting in a
  process dumping core in the corefile.

  Direct stable changed: Padding added to struct thread and td_si added to end
  with explicit bzeroing when forking/initializing a thread to preserve KBI.

FreeBSD/src 324931projects/runtime-coverage Makefile.inc1

Don't expand _coverage_libs

FreeBSD/src 324930projects/runtime-coverage Makefile.inc1

More trying to quash the stupidity of gcc 4.2.1

FreeBSD/src 324929head/lib/libugidfw ugidfw.c Makefile

Clean up trailing whitespace

MFC after:      1 week

FreeBSD/src 324928head/lib/libugidfw ugidfw.c

Remove dead stores

The return value of various snprintf calls was stored in `len` and not used
in many functions.

MFC after:      1 week
Reported by:    clang-scanbuild

FreeBSD/src 324927projects/runtime-coverage/share/mk

Don't require ${DESTDIR}${_gcno_dir} until install

FreeBSD/src 324926head/share/man/man9 atomic.9

Expand explanation of atomicity.

Mention per-location total order, out of thin air, and torn writes
guarantees.  Mention C11 standard' memory model and one most important
FreeBSD additional requirement, that is aligned ordinary loads and
stores are atomic on processors.

The text is introductional and informal.  Reference the C11 and
C++1{1,4,7} standards for authorative description.

In collaboration with:  alc
Sponsored by:   The FreeBSD Foundation (kib)
MFC after:      1 week

FreeBSD/src 324925projects/runtime-coverage Makefile.inc1

Missing .endif FTL

FreeBSD/src 324924projects/runtime-coverage Makefile.inc1

Diff reduce and try to apply MK_COVERAGE only against c++11 compilers

Hashtag crossesFingersAndHopeThisVoodooWorks

FreeBSD/src 324923head/sys/sys bus.h

Remove resource_set_*() declarations from sys/bus.h.

The corresponding definitions were removed in r78135.

PR:            223189
Submitted by:   marc.priggemeyer at
MFC after:      1 week
+0-71 files

FreeBSD/src 324922projects/runtime-coverage/share/mk

Move MK_COVERAGE fu before .include <> so it's actually usable

FreeBSD/src 324921head/sys/fs/tmpfs tmpfs_vfsops.c

Move clear_unrhdr to tmpfs_free_tmp.

Clearing the unr in tmpfs_unmount is not correct. In the case of
multiple references to the tmpfs mount (e.g. when there are lookup
threads using it) it will not be the one to finish tmpfs_free_tmp. In
those cases tmpfs_free_node_locked will be the final one to execute
tmpfs_free_tmp, and until then the unr must be valid.

Reported by:    pho
Approved/reviewed by:   rstone (mentor)
Sponsored by:   Dell EMC Isilon
Differential Revision:

FreeBSD/src 324920head/sys/amd64/amd64 pmap.c, head/sys/arm/arm pmap-v6.c

Fix the VM_NRESERVLEVEL == 0 build.

Add VM_NRESERVLEVEL guards in the pmaps that implement transparent
superpage promotion using reservations.

Reviewed by:    alc, kib
MFC after:      1 week
Differential Revision:

FreeBSD/src 324919user/pho/stress2/misc

Added a regression test.

Reported by:    Dmitry Vyukov <dvyukov at>
Sponsored by:   Dell EMC Isilon

FreeBSD/src 324918stable 11, stable/11/sys/kern kern_sig.c

MFC r324670:
Improve assertion that an ignored or blocked signal is not delivered.

FreeBSD/src 324917stable 11, stable/11/sys/kern kern_sig.c

MFC r324669:

FreeBSD/src 324916stable 11, stable/11/sys/amd64/amd64 pmap.c

MFC r324665:
Fix the pv_chunks pc_lru tailq handling in reclaim_pv_chunk().

FreeBSD/src 324915projects runtime-coverage, projects/runtime-coverage/share/mk

MFhead at r324914
Once more on to the MFC, my dear friends

FreeBSD/src 324914projects/runtime-coverage/share/mk

Fix tabs before the style police nags me

FreeBSD/src 324913projects/runtime-coverage/share/mk

Every day I'm shuffling (comments) to diff reduce

FreeBSD/src 324912projects/runtime-coverage/share/mk

In the search of a perfect knob pairing

Why in the heck is it so dang complicated now?

FreeBSD/src 324911head/share/mk

Fix an omission in a comment

Soft float API support applies to armv7 too after r324340

FreeBSD/src 324910projects/runtime-coverage/share/mk

Congrats riscv* : you unlike millions of americans will have coverage, even
if the ACA is repealed

FreeBSD/src 324909stable 11, stable/11/sys/dev/sound/pci/hda hdac.h hdac.c

MFC r324661: Add Creative vendor ID.

FreeBSD/src 324908stable 11, stable/11/share/man/man4 bridge.4

MFC r324659: Update details of interface capabilities changed by bridge(4).

PR:            221122

FreeBSD/src 324907projects/runtime-coverage/share/mk

Die. Die. Die. Tinderbox failures on mips/powerpc

FreeBSD/src 324906projects/runtime-coverage/share/mk

mips, you cause me too much grief with make tinderbox. Try this instead

FreeBSD/src 324905projects/runtime-coverage Makefile.inc1

Use MK_CLANG instead -_-

FreeBSD/src 324904projects/runtime-coverage/share/mk

Use BROKEN_OPTIONS for MK_COVERAGE=no so it will be documented in src.conf(5)

FreeBSD/src 324903projects/runtime-coverage Makefile.inc1

Trying to get libgcov to work was a stupid, stupid rabbit hole to go down

Just use clang and ports gcc. I will fix the cross-toolchain stuff to actually
work with MK_COVERAGE -- for now the host-only compilers work just fine.

FreeBSD/src 324902projects/runtime-coverage/share/mk

Let's just nip gcc 4.2.1 in the bud and say MK_COVERAGE=no

Reasoning: gcc 4.2.1 lacks -fprofile-dir support

FreeBSD/src 324901projects/runtime-coverage/share/mk

Fix typo in previous commit

My brain was remembering the spelling of the C++ variable, not the option.

FreeBSD/src 324900projects/runtime-coverage/share/mk

Use -fprofile_dir=${COVERAGEDIR} with --coverage

This option implies that it will automatically prefix .gcda files, when
created, thus allowing for the desired prefixing I've added in via .

This option is only available in clang and later versions of gcc, so I'll
likely have to mark MK_COVERAGE broken from a "fully-fledged feature"
perspective, as I don't want to go through the annoyance of implementing the
feature in gcc and testing it.

FreeBSD/src 324899projects/runtime-coverage/lib/libclang_rt/profile Makefile

-fvisibility is a c++ thing, per gcc(1)

Followup to r324894

PR:     223179

FreeBSD/src 324898projects/runtime-coverage Makefile.inc1

libprofile_rt requires c++-11

FreeBSD/src 324897projects/runtime-coverage/lib/libpam/static_libpam Makefile

This shouldn't be required either

FreeBSD/src 324896projects/runtime-coverage/gnu/usr.bin/cc/cc_tools Makefile, projects/runtime-coverage/lib/libpam/libpam Makefile

Diff reduce with ^/head

This doesn't seem to be necessary after the changes to only apply --coverage
to shared objects.

We'll see if it works with make tinderbox.

FreeBSD/src 324895projects/runtime-coverage Makefile.inc1

Get rid of now unnecessary intermediate variable, _coverage_libs

Use _prereq_libs instead.