[COFF] Parallelize PDB Section Contrib. NFC
PDB's createSectionContrib was computed serially.
This contains a CRC over data which can be expensive
for large binaries.
Keep received data when a send is resumed with -L
zfs send -t adds the -L or -w given on its command line to the
flags in the resume token, so a receive started without -L can be
resumed with -L, or with -w, which is -Lec for an unencrypted
dataset. The resumed stream then sends the OBJECT record of the
object the receive stopped in with a 1M block size, while the
receiver holds that object in 128K blocks.
receive_handle_existing_object() frees an object whose block size
changed if the stream is a full one, or if the object is not a
plain file, as for a volume with volblocksize=1M. That drops
everything received before the block that holds the resume offset.
The resumed stream does not send it again, and zfs recv exits 0.
A release-build run cut a full send of an 8M file with recordsize=1M
at a saved offset of 3538944. After a resume with -L, or with -w on
an unencrypted dataset, the received file differed from the source
from its first byte. An incremental resumed the same way matched.
[19 lines not shown]
ZTS: toggle -L when resuming a send
send-L_toggle_resume sends an 8M file from a recordsize=1m dataset
without -L and cuts the stream so the saved offset falls inside a
1M block. It resumes that receive with zfs send -L -t, and a second
cut receive with zfs send -w -t, which is -Lec for an unencrypted
dataset. It then does the same with -L for 8M written to a volume
with volblocksize=1m. The first WRITE for the resume object must be
1M, and the received file and volume must match the source.
The test needs the next commit. With only the sender fix from the
previous commit, it fails at the file comparison.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Patrick Domack <patrickdk at patrickdk.com>
Closes #19749
Resume a split large-block send at the saved offset
A send without -L splits each block larger than 128K into 128K
WRITE records. A receive that stops partway through such a block
saves the offset of the last 128K record it applied as the resume
offset, so the offset can fall inside the block. The resumed send
starts its traversal at the block that holds that offset, and
do_dump() then sends every 128K piece of the block from its start.
On debug builds the ASSERT in do_dump() requires the block to start
at or after the resume offset, so zfs send -t trips it. On release
builds the receiver gets the pieces before the resume offset a
second time and writes them again. In a release-build run of a full
send of an 8M file with recordsize=1M, the stream resumed from a
saved offset of 3538944 started with a WRITE at 3145728.
Skip the pieces that start before the resume offset, so the resumed
stream starts with the record the receive last applied, and let the
ASSERT accept a block that contains the resume offset. Resuming such
[6 lines not shown]
ZTS: resume a send of split large blocks
send_resume_split_large_block writes a 6M file and a file with one
293K block to a recordsize=1m dataset, sends them without -L, and
cuts the stream at five points, the last two near its end. It
resumes each cut receive with zfs send -t. The first WRITE for the
resume object must be at the saved resume offset, and the received
files must match. At least one saved offset must fall inside a
block.
The test fails without the next commit.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Patrick Domack <patrickdk at patrickdk.com>
Closes #19749
zdb: do not close the spa twice when an objset ID lookup fails
When the target is <pool>/<objset ID> and -N is given, or the name
does not resolve as a dataset, zdb opens the pool into the global spa
to turn the ID into a dataset name, and closes it again. The global
keeps pointing at the closed pool, so when no objset has that ID, zdb
goes on to fatal(), and zdb_exit() closes the pool a second time:
failed to hold objset 4194304: No such file or directory
zdb: can't open 'testpool/0x400000': No such file or directory
ASSERT at module/zfs/spa_misc.c:1078:spa_close()
zfs_refcount_count(&spa->spa_refcount) > spa->spa_minref || ...
zdb_objset_id runs "zdb -N" and "zdb -Nd" on such IDs and passes,
because log_mustnot takes a command killed by SIGABRT for one that
failed.
Do the lookup with a local spa, as the retry after a missing log
device already does. The global stays NULL until the dataset is
[5 lines not shown]
[CIR] Wire unreachable, return, and switch to MemoryEffectsOpInterface
These operations should be naturally Pure. However, cir.return and
cir.unreachable can inside cir.scope and cir.if. Making it create side
effect if it jump out of scope.
As a result, we check its parent. If it is a function, we make it
pure. Otherwise, we define read an write.
Notice that it is a ground work rather than enable some optimization
now. Currently, Core MLIR doesn't eliminiate now. However, Enzyme MLIR
did a much more optimization and require this feature. I think it
makes sense to have this in upstream now.
Assisted-by: Claude # Test
[clang-tidy][docs] Rewrite modernize check docs to Markdown [2/4] (#232214)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the second part of rewriting check documentations in modernize
module from reST to MyST Markdown.
AI Usage: This was prepared with rnk's fork of rst2myst and
GPT5.6-assisted (both Codex and AmpCode) cleanup.
I manually verified that the documentation renders as expected.
Preview site:
https://broken.life/llvm-staging/modernize-markdown-port/index.html
[clang-tidy][docs] Rename modernize check docs to Markdown [2/4] (#232213)
Tracking issue: #201242
See the [migration guide] for more information.
[migration guide]:
https://llvm.org/docs/SphinxQuickstartTemplate.html#markdown-migration-guidelines
This is the second part of the mechanical rename of the check
documentations in modernize module.
The rewrite is provided by the next PR in this stack.
[NFC][Clang][CodeGen] Take const& in deleted copy assignment operators (#241713)
436f391d1d56 (#154671) deleted the copy assignment operators of
`ApplyInlineDebugLocation` and `SanitizerDebugLocation` with a non-const
parameter. That still leaves the classes non-copyable, but it breaks
`std::optional<SanitizerDebugLocation>`: libstdc++ fails to default the
copy assignment of its storage.
Use `const &`, matching the deleted copy constructors.
Needed by #241646.
Assisted-by: Gemini
[ORC] Add SPS serialization for JITDylibLookupFlags (#242152)
JITDylibLookupFlags moves from Core.h into a new
Shared/JITDylibLookupFlags.h (still in the llvm::orc namespace),
alongside a new SPSJITDylibLookupFlags tag that serializes it as a bool:
true for MatchAllSymbols, false for MatchExportedSymbolsOnly. This
matches the ORC runtime's encoding, and will be used by an upcoming
call-controller handler that receives lookup flags from the executor.
The enum has to move because headers in Shared/ can't include Core.h.
Core.h includes the new header, so existing users are unaffected. The
enum's doc comment is also fixed to name its actual enumerators.
[ubsan] Improve scoped enum diagnostic printer (#216460)
Noticed that ubsan diagnostic which print out enum underlying value,
default to `<unknown>` for scoped enum.
**Why**
The original code path in `EmitCheckTypeDescriptor` checks against
whether the type is integer via `isIntegerType(),
isSignedIntegerType()`. Per language, enum class types are never
considered integer types so that always fails and then the UBSan runtime
default prints `<unknown>` instead of the real value.
**Fix**
Simply extract the enum's underlying integer type up front and use that
for the int checks instead of the enum type itself.
**before**
`error: load of value <unknown>, which is not a valid value for type
'enum EBool'`
[12 lines not shown]
Don't busy-loop in txg_sync_thread() while the pool is suspended
Since c3f2f1aa2 ("vdev probe to slow disk can stall mmp write
checker"), txg_sync_thread() skips the sync of a suspended pool with a
bare "continue". Whatever ended its wait (an expired txg timer, a
txg_wait_synced() caller, an active scan or pending frees) stays true
while the pool is suspended, so the thread loops without sleeping,
holding tx_sync_lock, until the pool resumes. An exiting thread loops
forever.
A pool suspended while no txg is syncing, which is how an MMP
suspension usually happens, therefore costs a whole CPU. Kernels
without full preemption report soft lockups and RCU stalls, and every
caller of txg_wait_synced() or txg_wait_open() blocks on the mutex
instead of the condvar, so TXG_WAIT_SIGNAL and TXG_WAIT_SUSPEND waits
can no longer be interrupted or return early.
Wait on tx_sync_more_cv for up to a second instead, and let an exiting
thread go on to exit.
[6 lines not shown]
ZTS: txg_sync must not spin on a suspended pool
Add fault/suspend_txg_sync_idle. It suspends a single-vdev pool while
no txg is syncing: a read error starts a vdev probe, the probe's label
write fails, and the async thread faults the vdev and suspends the
pool. It then checks that txg_sync uses almost no CPU while a read and
a write wait for the pool to resume, and that "zpool clear" resumes the
pool, with both completing and the data intact after an export and
import.
Without a fix, txg_sync runs at 100% of a CPU from the moment the txg
timer expires until the pool resumes.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Will Rouesnel <wrouesnel at wrouesnel.com>
Closes #19815