[LAA] SCEV-licm-reduce depend_diff_types test (NFC) (#213875)
Reduce a couple of tests in depend_diff_types in a way that preserves
SCEV expressions, by creating invariants that we hoist outside the loop.
This makes the tests a bit clearer.
Illustration: https://godbolt.org/z/eTqdoPPzn
Co-authored-by: Andrei Elovikov <andrei.elovikov at sifive.com>
Parallelize brt_pending_apply() for multiple vdevs
Unlike DDT, sorted by the checksum prefix, BRT uses salted hash.
It means that we can't pre-sort the accesses for better caching,
and with BRT size getting bigger that dbuf cache, there is a high
chance that each lookup will require a 8KB block decompression.
It is not as bad as for 32KB DDT block, but still.
Since each vdev in BRT is completely independent, running several
brt_pending_apply_vdev() instances in parallel should increase both
CPU and (in case of ARC miss) pool utilization.
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #18860
Parallelize cloning of deduplicated blocks
When block cloning is used on deduplicated blocks, the additional
references are accounted in DDT instead of BRT. Previously it was
done by brt_pending_apply_vdev(), calling ddt_addref() for each
block with DEDUP flag in the block pointer. The process was single-
threaded, and caused a bottleneck in the sync context, since with
large DDT ddt_addref() needs to decompress 32KB ZAP leaf for each
added block.
This patch changes how pending blocks with DEDUP flag are handled.
Inspead of storing them in per-vdev bv_pending_tree, sorted by
offset (which sorting makes no sense for later DDT updates), store
them in one of 16 AVL trees, sharded and sorted by their checksum
prefix. This way we can simultaneously reduce lock contention on
pools with small number of vdevs, process the shards by separate
sync threads accessing/decompressing different ZAP leaves, and
access ZAP leaves in hash order to increase chances of decompressed
dbuf cache hits.
[9 lines not shown]
arc: add a few invariant checks in release builds
Convert a couple ASSERTs invariants to VERIFYs to enforce them
in release builds to be able to root-case #18782 kernel panic,
whenever it happens again.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Andriy Tkachuk <atkachuk at wasabi.com>
Closes #18840
(cherry picked from commit 023d44b9ef68f1eff6b97d98c6a16cdb4b93cf76)
arc: fix race between arc_release() and arc_read_done()
Consider the following scenario:
1. arc_release() is called on hdr with one buf, but which has
IO_IN_PROGRESS (reading more raw data in encypted pool while
keeping decrypted data in buf).
2. arc_release() moves hdr to anon state and discards its identity.
3. arc_read_done() is called, adds the 2nd buf to hdr, increasing
b_refcnt to 2.
Now we have hdr in anon state with two bufs and without identity.
Or here's a racing scenario:
1. arc_release() checked that hdr is not in anon state, but before
taking hash_lock
2. arc_read_done() takes hash_lock, moves hdr to anon state, in
case of an error.
[25 lines not shown]
[libc] Add more Linux-specific macro for fcntl and sched. (#213727)
* Add more `O_` flags (in particular, `O_LARGEFILE`) to fcntl-macros and
group all creation/status flags (shared and arch-specific) together.
* Add Linux `CLONE_` flags to sched-macros (to be exposed from
`<sched.h>`). Those are also provided in `<linux/sched.h>` kernel
header, but the libc users often expect to find them in regular
`<sched.h>` as those are passed to `clone()` syscall wrapper. Migrate
internal Linux thread implementation to use our own header (instead of
Linux kernel) for these macro.
18308 format: remove -Wno-parentheses
Reviewed by: Bill Sommerfeld <sommerfeld at hamachi.org>
Approved by: Robert Mustacchi <rm+illumos at fingolfin.org>
Updated with the following changes:
- Modified to report an error on boundary condition.
- Modified tests for the boundary error message.
- Corrected accessibility attributes by giving explicit attributes as needed.
- Added regression test for attributes.
- Reworded incorrect comment.
- Switched to originalTypeSymbol to use in-scope name.
- Added test case to verify pre-built mod name usage.
Adjust pstat(8) to the changed KERN_TTY_INFO struct itty.
Also fix up the code path via kvm which requires an extra indirection
and define __need_process. On top of this fix pstat to allow -t & -M
to work together.
OK deraadt@ kettenis@
Change struct itty and with it KERN_TTY_INFO to return the pid of the
session leader process
The t_session pointer is not very useful and only visible to root.
Adjust this similar to a change done in ps(1) and pass the process id
of the session leader instead.
This is a ABI change but KERN_TTY_INFO is only used by pstat(8) and
debian code search did not find any other use.
OK deraadt@ kettenis@
[AMDGPU] Fold fsub into fma_mix via free neg_lo modifier (#212305)
Rewrite the fsub->fma_mix pattern as `fma((-y), 1.0, x)` using the free
neg_lo modifier
instead of multiplying by -1.0 (which doesn't always flip the sign of
NaN), use the hardware free neg_lo bit, which does a true sign flip. As
a result, now the fold always matches fsub actual behavior instead of
only in the common case (non-NaN FP numbers)
Merge tag 'for-7.2-rc6-fixup-worker-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull Btrfs Fixes 2: Electric Boogaloo from David Sterba:
"This brings back the fixup worker infrastructure.
It's a mechanism to detect pages/folios that are marked dirty without
filesystem knowledge and require COW fixup. The consequence of not
doing so is silent data loss.
The first patch covers the scenarios in detail, also reflecting folio
API port and subpage block size support added in recent years. The
original fixup worker was only for pages.
The patch is relatively big, half of the code is debugging and support
code, the rest is the core design around the detection and fix.
The second patch handles an unlikely case when there's work left
during unmount"
[3 lines not shown]
Merge tag 'for-7.2-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba:
- fix leak in encoded ioctl write
- disable large folios on systems with highmem
- disable block size > page size when there's no transparent hugepage
support (under experimental config)
- reject compressed inline extents without valid LZO headers
- properly initialize cached inode mapping (if block size > page size)
* tag 'for-7.2-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: initialize inode mapping flags for cached inodes
btrfs: disable bs > ps support if no transparent hugepage support
btrfs: fix memory leak in btrfs_do_encoded_write()
[2 lines not shown]
arti: update to 2.5.1.
# Arti 2.5.1 - 3 August 2026
Arti 2.5.1 continues development on relays and directory authorities.
It also adds some performance, security, and convenience features for
onion services.
# Arti 2.5.0 — 30 June 2026
Arti 2.5.0 comes with lots of progress in the relay and directory authority
space, including ntor handshake handling, as well as encoding/decoding support
for router- and micro descriptors.
This release also includes a number of important bug fixes, as well as two security
fixes for medium-severity security issues, [TROVE-2026-24] and [TROVE-2026-27].