[LangRef] Specify that `allocsize` gives the exact size (#249103)
The LangRef describes `allocsize` as a lower bound: the function returns
"at least" the given number of bytes. The implementation disagrees and
optimizes under the assumption that it is exact. Alternative to #245519
and see there for more details.
I've had Claude survey downstream projects. Findings:
Of major frontends only julia assumed the langref semantics (we're happy
to change this). Additional frontends that make this assumption that
Claude found are llgo, nlvm and kairo, but these are relatively small
projects (and as mentioned in the issue, these are the semantics today,
so clearly they didn't notice). Still if this merges, I'm happy to file
courtesy issues there. Other frontends (e.g. Rust, Mojo) appear to
assume exact as best as I can tell.
Clang uses `allocsize` in two places: For `operator new` and for the
`alloc_size` attribute. For `operator new` on objects, I think the exact
[16 lines not shown]
[flang][cuda] Wait for kernel completion when requested by NVCOMPILER_ACC_SYNCHRONOUS (#248668)
`NVCOMPILER_ACC_SYNCHRONOUS` is a bit field. For CUDA Fortran, bit 2
requests a wait at the end of each CUF kernel and bit 4 requests a wait
at the end of each kernel subroutine launch. The CUDA Fortran runtime
did not look at the variable, so a launch always returned before the
kernel completed.
**Change:**
* `CUFLaunchKernel` takes a new trailing argument `isCUFKernel`.
`CUFGPUToLLVMConversion` passes 1 when the kernel was generated for a
CUF kernel directive and 0 when it is a kernel subroutine. A CUF kernel
is recognized by `_cufk_` in the kernel name, the same test
`CUFLaunchAttachAttr` uses; the constant moves to `CUFCommon.h`.
* After a successful launch, the runtime calls `cudaStreamSynchronize`
on the stream of the launch when the bit for that kind of kernel is set.
`CUFLaunchClusterKernel` and `CUFLaunchCooperativeKernel` only launch
kernel subroutines, so they test bit 4 and keep their signature.
[37 lines not shown]
Merge tag 'i2c-fixes-7.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux
Pull i2c fixes from Andi Shyti:
"Three driver fixes around initialization and cleanup, plus a
DesignWare maintainer update.
- omap: avoid deselecting the mux twice on removal
- rtl9300: ensure the controller is configured on first transfer
- spacemit: use an atomic-safe delay during bus reset
- designware: hand over maintenance to Heikki Krogerus"
* tag 'i2c-fixes-7.4-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux:
i2c: rtl9300: set sda_num before registering adapters
i2c: spacemit: Avoid sleeping during bus reset in atomic context
MAINTAINERS: Update I2C Designware driver maintainer
i2c: omap: do not deselect the mux-state twice in remove()
sysctl.conf: drop kern.sched.preempt_thresh
Remove kern.sched.preempt_thresh=224 from the default sysctl.conf.
FreeBSD 15.1 moved the ULE sysctls under kern.sched.ule, so the old
name fails at boot with "unknown oid" and the setting was not applied
anyway. The desktop benefit of the tweak is anecdotal, so use the
FreeBSD default instead of renaming it.
sysctl.conf: drop kern.sched.preempt_thresh
Remove kern.sched.preempt_thresh=224 from the default sysctl.conf.
FreeBSD 15.1 moved the ULE sysctls under kern.sched.ule, so the old
name fails at boot with "unknown oid" and the setting was not applied
anyway. The desktop benefit of the tweak is anecdotal, so use the
FreeBSD default instead of renaming it.
sysctl.conf: drop kern.sched.preempt_thresh
Remove kern.sched.preempt_thresh=224 from the default sysctl.conf.
FreeBSD 15.1 moved the ULE sysctls under kern.sched.ule, so the old
name fails at boot with "unknown oid" and the setting was not applied
anyway. The desktop benefit of the tweak is anecdotal, so use the
FreeBSD default instead of renaming it.
bwfm at sdmmc stability improvements
Some stability improvements to the bwfm driver that help a lot on the
Nintendo Wii U and Pinebook Pro. Crashes, hangs, and stalls are gone.
- Periodically send a TX control frame, if we don't do this it seems
that firmware can stop giving back TX credits and we get stuck with
IFF_OACTIVE set. Do this from the if watchdog, and save 2 TX credits
for control frames only so data packets don't block the recovery path.
- In bwfm_sdio_stop, clear tx_count instead of resetting tx_seq and
tx_max_seq. This makes ifconfig bwfm0 down up work.
- bwfm_sdio_intr is called from the sdmmc task thread and the sdmmcchip
interrupt is acknowledged when it returns. Do work directly here
instead of queueing up another task to do it so we don't acknowledge
the interrupt first.
- Stop transmitting if there are RX frames pending.
- Explicitly initialize the flowctl and res0 fields of swhdr when
submitting a control or data frame.
- Update the TX max sequence number from the RX glom header too, in
case it has changed.
sdt: Don't clear a probe's ID when disabling it
A thread may have jumped out of a tracepoint but not yet loaded the
probe ID when sdt_disable() clears it. It then calls dtrace_probe()
with ID 0, which reads far past the end of the probe array.
Leave the ID set. dtrace_probe() does nothing for a disabled probe,
and sdt_enable() sets the ID each time.
Reviewed by: markj
MFC after: 1w
Co-authored-by: Claude Opus 5.5
Differential Revision: https://reviews.freebsd.org/D62154
(cherry picked from commit ef6d8eb703b959a91c28222a20b3f3a04ba4ff1a)
amd64/sdt: Use a single NOP for disabled probes
sdt_tracepoint_restore() wrote five one-byte NOPs. A thread
interrupted between them could resume in the middle of the jump
written when the probe was next enabled, and run its displacement
as instructions. Write the single five-byte NOP that the compiler
emits for _SDT_ASM_PATCH_INSTR instead.
Reviewed by: markj
MFC after: 1w
Co-authored-by: Claude Opus 5.5
Differential Revision: https://reviews.freebsd.org/D62153
(cherry picked from commit b8180220627577c403b04de3647ac631798fdb8b)
i386/sdt: Use a single NOP for disabled probes
On i386, both _SDT_ASM_PATCH_INSTR and sdt_tracepoint_restore()
used five one-byte NOPs. Use "leal %ds:0(%esi,%eiz,1), %esi"
[12 lines not shown]
Bump version to 26.3.R15.1p8 and drop preempt_thresh sysctl
Bump the package version to 26.3.R15.1p8 after merging FreeBSD
releng/15.1 p8.
Remove kern.sched.preempt_thresh=224 from the default sysctl.conf.
FreeBSD 15.1 moved the ULE sysctls under kern.sched.ule, so the old
name fails at boot with "unknown oid" and the setting was not applied
anyway. The desktop benefit of the tweak is anecdotal, so use the
FreeBSD default instead of renaming it.