sendfile: keep the lowat hack more conservative
First, record the original lowat value and later in the wait/EAGAIN loop
look at the original value, rather than on the value that we just faked.
This eliminates some blank syscalls, where socket was reported as writable
and immediate write instantly fails. In my testing the ratio of such
syscalls was really small, under 2%, however in a different scenario this
negative effect can be more profound.
Second, cap the lowat growth to 1/2 of original socket buffer size, rather
than to current size. The problem was there before, but it became more
profound after 587c6c121504.
Note: we are considering to evaluate if the lowat hack is needed at all.
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D60106
tcp: use SB_AUTOSIZE flag to tell if socket buffer was set
The check against V_tcp_sendspace is not a correct one, as a buffer may
grow larger than the initial value. The conjunction was always false up
until 587c6c121504, and only after it the bug surfaced.
If we already grow our buffer past the value stored in the hostcache,
prefer our value.
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D60105
[llvm-profdata] Propagate Error in loadInput and mergeWriterContexts
Propagate Error from loadInput and mergeWriterContexts in mergeInstrProfile,
supplementInstrProfile, and overlapInstrProfile. In mergeInstrProfile's
ThreadPool, catch errors from worker threads, stop scheduling new jobs,
and return the first encountered fatal error.
Ensure ~WriterContext() consumes any pending unhandled errors in
WriterContext::Errors upon destruction.
Not NFC as destructors are run on the stack and ThreadPool workers exit
earlier on error.
With all subcommands propagating llvm::Error to main, exitWithError,
exitWithErrorCode, and the LSan leak suppression workaround are no
longer needed.
Assisted-by: Gemini
[NFCI][llvm-profdata] Propagate Error in merge subcommand
Change merge_main and its helpers to return Error and handle it
with reportError in main.
Not NFC as destructors are run on the stack.
Assisted-by: Gemini
[orc-rt] Use the Error matchers in ExecutorProcessInfoTest (#228307)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in ExecutorProcessInfoTest.
[mlir][xegpu] Block a convert_layout at a tile both layouts accept (#227892)
This PR makes `XeGPUBlockingPass::getTileShape` pick a
`convert_layout`'s tile per dimension instead of by total size.
Choosing by total size returns `inst_data = [8, 16]` over `[1, 64]`
because `128 >= 64`, leaving a 16-wide tile while the target needs
`lane_layout * lane_data = 16 * 4 = 64` columns. The blocked op is then
rejected as "invalid target layout, data cannot be evenly distributed".
Taking the larger `inst_data` per dim gives `[8, 64]`, which is valid
for both layouts since `inst_data` values are powers of two.
assisted-by-claude
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
vt: Fix timer race between vtterm_splash() and vt_flush()
Current code leads to console text being drawn over the splash image.
vt_flush() draws while holding the vtbuf lock. Have it check VDF_SPLASH
under it too, and make vtterm_splash() take the vtbuf lock when setting
it, before drawing the splash.
Sponsored by: Defenso
Signed-off-by: Quentin Thébault <quentin.thebault at defenso.fr>
Reviewed by: vexeduxr
Differential Revision: https://reviews.freebsd.org/D59928
[orc-rt] Use the Error matchers in BootstrapInfoTest (#228305)
Use the Error matchers introduced in 4c8a437d0487 to clean up error
checks in BootstrapInfoTest.
stand/images: remove translucent pixels around orb
Remove semi-transparent pixels around the orb. These become more
pronounced when the orb is used as the spash screen image.
While here also strip metadata.
MFC after: 3 days
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D60163
[InstCombine] Fix profile propagation in intrinsic-select.ll (#228295)
In these cases we're creating a new Select with the exact same
condition, so we can just copy the metadata.
kern: Fix mmioctl() to return ENOTTY for unknown devices
The default case for unknown devices handles /dev/null and previously
returned ENODEV for tcsetattr/tcgetattr/tc* requests, which should be
ENOTTY as specified by POSIX (as well as documented in the man pages).
Fix the bug by correcting mmioctl() to return ENOTTY in the default
case.
Patch-by: jpikin, sigttou (David Bidner)
Bug: https://bugs.dragonflybsd.org/issues/3252
w(1) - Do not warn about non-existent tty lines
ttystat() called warn() when stat("/dev/<line>") failed, so X11 sessions
(ut_line like ":16") printed a spurious
"w: /dev/:16: No such file or directory".
Return NULL silently unless the line is an existing character device.
Matches FreeBSD (see commits 21632754d652d20a4618cac0b52ebe7d8e790865,
d0d0355e4dd9fa060443d3f1b1a223118ff68827).
Fixes #3298
loader: Clear CR0.WP during EFI kernel relocation
Firmware on an HP ProDesk 600 G4 leaves relocation destination pages
read-only. efi_copy_finish() faults at 0x1001000 with page-fault error
code 3 (supervisor write, protection violation) while CR0.WP is set.
Save CR0 and clear WP around the relocation copy after ExitBootServices,
with interrupts disabled. Restore CR0 before entering the kernel. Reject
active CET before leaving boot services, since it prevents clearing WP.
Bug: https://bugs.dragonflybsd.org/issues/3427
w(1) - Do not warn about non-existent tty lines
ttystat() called warn() when stat("/dev/<line>") failed, so X11 sessions
(ut_line like ":16") printed a spurious
"w: /dev/:16: No such file or directory".
Return NULL silently unless the line is an existing character device.
Matches FreeBSD (see commits 21632754d652d20a4618cac0b52ebe7d8e790865,
d0d0355e4dd9fa060443d3f1b1a223118ff68827).
Fixes #3298
[StaticDataLayout] Only emit JT prefixes if enabled (#228222)
Previously we were unconditionally emitting section prefixes for jump
tables. This meant that even with SDP disabled, we would end up with a
.rodata.unlikely section. This is somewhat confusing and also makes
ablation experiments harder.
sbappendcontrol never fails; nix the return value indicating success.
Cleanup which in principle changes the module ABI (I doubt there are
any modules out there that actually use sbappendcontrol, though rump
does use it across libraries) after:
PR kren/60832: AF_LOCAL stream: sendmsg() with SCM_RIGHTS silently
drops data and descriptors but reports success
XXX kernel revbump due to API/ABI change -- not for pullup
sendmsg(2): Don't fail with ENOBUFS on fd passing.
We don't fail with ENOBUFS if we're not fd-passing -- we just block
or fail earlier on with EAGAIN; no reason to invent a new failure
mode just for the fd-passing case.
Whether we should have _any_ path that checks the receiving socket's
receive buffer limit is another question, but it's silly for it to:
1. apply _only_ when passing fds,
2. trip only when the kernel internally expands the buffer, and/or
3. fail with ENOBUFS instead of blocking or failing with EAGAIN.
This change essentially matches FreeBSD's subversion r337328:
commit 5b0480f2cca0a4a04f21055ed769be93f11348de
Author: Mark Johnston <markj at FreeBSD.org>
Date: Sat Aug 4 20:26:54 2018 +0000
Don't check rcv sockbuf limits when sending on a unix stream socket.
[25 lines not shown]
sendmsg(2): Treat ENOBUFS on fd passing as a bug.
PR kern/60832: AF_LOCAL stream: sendmsg() with SCM_RIGHTS silently
drops data and descriptors but reports success