NAS-144060 / 27.0.0 / Create thick zvols with refreservation=auto (by ixhamza) (#19965)
Depends on the libzfs fix (already merged):
https://github.com/truenas/zfs/pull/471.
`zfs_create()` now resolves `refreservation=auto`, so a thick volume can
ask ZFS for the reservation it actually needs: the volsize plus metadata
and raidz/draid overhead, which is what `zfs create -V` has always set.
Default to that at creation instead of reserving exactly the volsize.
The old value under-reserved every thick volume, and because libzfs only
grows a reservation it computed itself, the first resize left the
reservation behind. An explicit `auto` is accepted at creation as well,
the way `zfs.resource.set` already accepts it, and rejected for a
filesystem with the same error. Volumes created by earlier releases keep
reserving exactly their volsize until they are grown, which the update
path still switches to `auto`.
A thick volume therefore reserves more than its volsize now: about 1-2%
at the default 16K volblocksize, and 1.37x to 2.36x with 4K or 8K blocks
[25 lines not shown]
[lldb] Recognize flag forms in DWARFFormValue's constant accessors (#229738)
LLDB crashes on parsing a `DW_TAG_LLVM_ptrauth_type` with
`DW_AT_LLVM_ptrauth_address_discriminated`, here is the crash
inside lldb,
```
thread #1, stop reason = libc++: .../usr/include/c++/v1/optional:1150:libc++ Hardening assertion this->has_value() failed: optional operator*
called on a disengaged value
frame #2: llvm::DWARFTypePrinter<...>::appendUnqualifiedNameAfter(...)::'lambda'(...)::operator()(Attr=DW_AT_LLVM_ptrauth_address_discriminated) const at DWARFTypePrinter.h:375
374 if (auto Form = D.find(Attr))
-> 375 return *Form->getAsUnsignedConstant();
(lldb) frame variable Form
(std::optional<DWARFFormValue>) Form = Has Value=true {
Value = { m_form = DW_FORM_flag_present, m_value = (uval = 1, ...) }
}
```
[26 lines not shown]
[flang][openacc] Keep the source of END DO turned into CONTINUE for ACC loops (#229850)
When an OpenACC LOOP or combined construct is associated with a labeled
DO
loop terminated by a labeled END DO statement, AccNonBlockDoConstruct
replaces
that END DO with a labeled CONTINUE statement, since the DO construct it
builds
has its own synthesized END DO. The new CONTINUE statement had no
source.
Label analysis now treats such a DO construct as the original labeled DO
statement and checks its terminating label, so the empty source compared
as
preceding the DO statement and valid code was rejected:
!$acc parallel loop
do 100 n = 1, np
c(n) = 0
[6 lines not shown]
[CIR][NFC] Generalize loop condition cleanup capturing (#229773)
The mechanism for deferring cleanups for loop conditions is also useful
for coroutines. For those we need to emit cleanups for the coroutine
parameters and the promise in a separate destroy region.
Rename identifiers such as LoopConditionCleanups to CapturedCleanups (to
disambiguate between this and deferred conditional cleanups, which are
something else) so future coroutine related patches can reuse this
mechanism.
This only updates identifier names and comments and brings no functional
change.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Add middleware support for LIO ALUA HA
Wire up the middleware side of LIO ALUA high-availability: load
lio_ha.ko with per-node addresses on service start, manage ALUA
state across failover events, clean up STANDBY configfs on pool
export, and add pre-flight validation that targets have static
initiator ACLs before ALUA can be enabled.
For each target, create a portal-less phantom TPG carrying the peer
node's controller group so that a single RTPG response from any
connected port lists both ALUA groups. Write tpgt_N/rtpi explicitly
before enable so that relative target port IDs in RTPG match the
tag formula (portal.tag on Node A, portal.tag + 32000 on Node B)
rather than being auto-assigned sequentially by the kernel.
ALUA group states are driven by role and ha_state:
MASTER + synced local=OPTIMIZED remote=NONOPTIMIZED
MASTER + connected local=OPTIMIZED remote=TRANSITIONING
[4 lines not shown]
[clang][CIR] Add tests for SVE ANDV intrinsics (#227657)
This adds CIR tests for `svandv` (plain SVE) intrinsics.
Moves and adapts `sve-intrinsics/acle_sve_andv.c` to `sve/andv.c`.
Part of #223963
[lld][MachO] Support Objective-C class stubs
Support Objective-C class selector stubs in lld's Mach-O backend.
This consumes the class-stub symbols emitted by Clang in [ObjC] Emit class
msgSend stub calls (#186433), using the form
`_objc_msgSendClass$<selector>$_OBJC_CLASS_$_<class>`.
Class stubs load the class object into `x0`, load the selector into `x1`, and
branch to `_objc_msgSend`. Local class symbols are materialized directly with
`adrp`/`add`; dylib or dynamic class symbols are loaded indirectly.
The implementation also tracks the resolved class symbol before dead stripping
so live class stubs can retain the needed class definition without keeping dead
dylib references alive.
[lld][MachO] Fix ObjC stubs from autolinked archives
Move ObjC stub preparation after LC_LINKER_OPTION processing so archive
members loaded through autolink can contribute `_objc_msgSend$` selector stubs
before selector references are finalized.
Otherwise, stubs discovered from autolinked archives may not get matching
`__objc_methname` and `__objc_selrefs` entries needed during stub emission.
[lld][MachO][NFC] Prepare ObjC stubs for variable sizes
This is an NFC change to prepare for the next PRs:
- Track the total `__objc_stubs` size explicitly as entries are added, so
stub offsets no longer assume every stub has the same size.
- Rename `symbolPrefix` to `objcMsgSendStubPrefix` for clarity.
[RegAllocFast] Allocate tied uses first and enable for PowerPC (#229672)
In p9-vinsert-vextract.ll:shuffle_vector_halfword_1_3, an untied read of
a value precedes its tied use (XXPERM's XA comes before XTi):
```
%5:vsrc = XXPERM %0:vrrc, %0:vrrc(tied-def 0), killed %4:vsrc
```
Allocating uses in operand order gives the untied %0 a register other
than %5's, so the tied %0 needs copies:
```
vmr 3, 2
addis 3, 2, .LCPI17_0 at toc@ha
addi 3, 3, .LCPI17_0 at toc@l
lxv 0, 0(3)
vmr 2, 3
xxperm 34, 35, 0
[6 lines not shown]
[docs] Drop stale "experimental" note for preserve_most (#214205)
The LangRef and Clang attribute docs say preserve_most "will be used by
a future version of the Objective-C runtime and should therefore still
be considered experimental at this time." That note dates to the
convention's introduction in 2014.
It's now used in the swift runtime (swiftlang/swift#85044), [linux
kernel](https://github.com/torvalds/linux/blob/c21bb4193868a8de71fc4693fa741e195fdf5d86/include/linux/compiler_types.h#L139-L143),
V8 (V8_PRESERVE_MOST), tcmalloc, and protobuf's upb.
Following the precedent of #158637 (which dropped "experimental" from
the partial reduction intrinsics): this convention has been used in
production for a while and is unlikely to change.
preserve_all is left untouched; its adoption story is much thinner, so
its experimental note is arguably still doing honest work.
Addresses part of #178277.
[ProfCheck] Remove already fixed tests (#229819)
I believe this test was fixed by a combination of fixes that landed
concurrently and thus no single patch detected fixing it.
Updating this mostly to avoid someone trying to take a look at it given
this the de-facto TODO list at this point.
[clang] Don't use isConstantInitializer in CodeGen. (#224781)
isConstantInitializer() is a complicated bit of code that tries, badly,
to predict what constant evaluation will do. Just query constant
evaluation directly. (Historically there was a split between AST-level
constant evaluation and CodeGen-level constant evaluation, but that's
mostly gone now.)
Fixes #228162
[lldb] Register 'target modules dump pcm-info' from TypeSystemClang (#229816)
`ModuleListProperties` calls
`clang::driver::Driver::getDefaultModuleCachePath`, so `lldbCore` links
`clangDriver`, which drags in `clangAST` and most of LLVM via static
initializers.
Set the default from `TypeSystemClang::Initialize` instead. Every tool
that uses the clang module cache registers `TypeSystemClang`.
Combined with https://github.com/llvm/llvm-project/pull/229817, this
halves the size of the lldb-server.exe binary on Windows.
[LV] Add VPlan printing tests for struct calls and call operands (NFC) (#229825)
Add tests for scalarized struct-returning calls and for operands of
widened calls that only use their first lane.
[LICM] Recompute insertion point for promotion when necessary (#229581)
Each time we call collectPromotionCandidates, it considers the loop from
scratch, without considering any operations which have been previously
promoted. This is generally fine, but that also means we need recompute
all the relevant state.
Without this patch, we would use a stale insertion point: a point after
any promoted stores. This meant promotion would sink the newly inserted
store past previously promoted stores, without checking aliasing.
The way the code is currently structured, I think this issue can only
show up with aliasing metadata.
Fixes: https://github.com/llvm/llvm-project/issues/226391.
Fixes: https://github.com/llvm/llvm-project/issues/227174.
[DirectX] Move the DXContainer debug options from MC to DirectX (#228329)
The DXIL embedder pass assigns MC's -dx-embed-debug and -dx-strip-debug
to tell the object writer whether to embed ILDB, and the assignment
persists to later modules.
Define the options in DirectX instead, and add an
MCDXContainerTargetWriter hook so the target writer makes that decision
from the options as given. Options shared across files move to
llvm::dxil.
Aided by Opus 5.5
[GVN] Preserve !prof metadata when materializing select for load PRE (#229298)
Pass the originating SelectInst through to GVN so we can propagate its
profile when creating the replacement value select.
LinuxKPI: firmware: remove `enoentok` logic in `*firmware_request(..)`
Prior to this change, in the event that a firmware module could not be
loaded, the linux_firmware driver would return a partially initialized
structure with uninitialized/zeroed out values for certain fields. Linux
does not do this, however, so some drivers that use
`request_firmware_nowait` expecting Linux behavior, like `if_bcrmfmac`,
would crash trying to dereference a NULL pointer.
This doesn't address the load/unload situation completely as the driver
remains loaded after the "firmware crashes", but it makes a completely
unusable situation (a kernel panic) into a slightly more usable situation
(driver does not unload).
As a sidenote: the raw free(9) call was replaced with a call to
`linuxkpi_release_firmware` because the latter call [better] ensures
that all resources allocated earlier on in the function are cleaned up.
MFC after: 1 weeks
[2 lines not shown]