[GVN] Treat Deadblock as Available
PRE insert load instruction if there is only one predecessor cannot be
eliminated. A deadblock can actually be treat as Available so that it
doesn't count into the BB that needs to insert load.
ZTS: auto_offline_001_pos: rescan only the scsi_debug host
insert_disk without a host makes scan_scsi_hosts write "- - -" to the
scan file of every SCSI host. On a VM with eight virtio_scsi
controllers, each of those scans takes about 9 seconds: for every LUN
it probes and does not find, the scan allocates a temporary device and
frees it again, and each time the host's shared tag set is updated,
which freezes the queue of the disk behind it. A reattach then takes
about 67 seconds, and the test, which reattaches its disk eight
times, is killed at its 10 minute timeout.
Every other caller of insert_disk passes the host of its device. Do the
same here: record the scsi_debug host before the first removal, while
the device still exists, and rescan only that host.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #20060
[AMDGPU] Precommit test for SIFixSGPRCopies PHI-to-AGPR rewrite
processPHINode moves a VGPR PHI to an AGPR class when all of its uses
are copies to AGPRs. A DBG_VALUE use currently blocks the move, so the
chosen class depends on -g.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[flang][semantics] Ignore a !DIR$ ALIGN directive that cannot be applied, with a warning (#247762)
The semantic checks of `!DIR$ ALIGN` (244506) made it an error to name
something the directive cannot align, or to put the directive after an
executable statement or outside a program unit. Existing code that other
compilers accept has such directives, for example `!DIR$ ATTRIBUTES
ALIGN` on a named constant, on the name of a derived type or on a
function result, and it no longer compiled.
Make these cases warnings under `-Wignored-directive`, and ignore the
directive for that name. The request is not recorded, so module files
and lowering do not see it. This follows what #180994 did for a
misplaced `IGNORE_TKR`. An alignment that is not a valid power of two
and two different alignments for one name stay errors.
A directive that follows a program unit was checked in the scope of that
program unit. Issuing a warning there aborted the compiler, which
`IGNORE_TKR` already did. Such a directive is now checked in the global
scope. There `IGNORE_TKR` gets its "must appear in a program unit"
[7 lines not shown]
[libc] Reject CPU affinity mask sizes above INT_MAX (#247852)
On Linux, `SYS_sched_getaffinity` and `SYS_sched_setaffinity` take a
32-bit `unsigned int` mask length, while
`linux_syscalls::sched_getaffinity` returns the written byte count as
`int`. Sizes above `INT_MAX` don't fit in `ErrorOr<int>` and narrow to
32 bits at the syscall boundary past `UINT_MAX`.
Return `EINVAL` for mask sizes above `INT_MAX` in
`linux_syscalls::sched_getaffinity` and
`linux_syscalls::sched_setaffinity`, and clear trailing mask bytes with
`inline_memset` in `sched_getaffinity`. Also add tests for trailing
zero-fill and for zero and `> INT_MAX` mask sizes.
Assisted-By: Gemini
[Clang] Check address space overlap for C-style casts to references (#244964)
In OpenCL and SYCL, `TryAddressSpaceCast` rejects a pointer cast between
two address spaces that don't overlap, but a C-style cast to a reference
is not checked (there is a FIXME for it). As a result, `(__local int
&)global_var` is accepted and we emit an `addrspacecast`.
This PR checks such reference casts in the same way. We only check the
case where the reference binds to the operand directly, i.e. the two
types are related. Other casts to a reference are not affected.
This PR was assisted by AI but I reviewed all the changes.
anyraid: allow a child capacity of 65536 tiles
The header of each copy of the AnyRAID tile map records the capacity
of every child, in tiles, as a 16-bit value: the writer stores the
capacity minus one and anyraid_open_existing() adds one back, so
capacities from 1 to VDEV_ANYRAID_MAX_TPD (2^16) round-trip.
vdev_anyraid_open() and vdev_anyraid_expand() cap a child at that
many tiles, so one with room for more gets exactly 2^16. The
assertion in vdev_anyraid_write_map_sync() bounds the capacity by
UINT16_MAX instead, one less.
A debug build thus fails the assertion on the first sync of a pool
with such a child, which is a little over 4 TiB with 64 MiB tiles: at
"zpool create", and when it imports a pool created without
assertions, with the child present or missing. Builds without
assertions record and read the capacity correctly.
Bound the capacity by VDEV_ANYRAID_MAX_TPD. The lower bound stays: a
capacity of 0 would be read back as 2^16, and only a child that holds
[6 lines not shown]
ZTS: create AnyRAID with a child of 2^16 tiles
An AnyRAID child holds at most VDEV_ANYRAID_MAX_TPD (2^16) tiles, and
the header of the tile map records its capacity minus one in 16 bits,
but the writer of the map asserts that the capacity itself fits in 16
bits. A debug build fails that assertion on the first sync of a pool
with a child that holds 2^16 tiles.
Add a test that creates an anymirror1 pool with 16 MiB tiles on two
sparse files of 512 MiB and one of 1025 GiB, which gets 2^16 tiles,
imports it read-only without the large file, so that its capacity is
read from the map, then with it, and scrubs it.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19849
netstat: update descriptions of two hostcache counters
Remove "on close", as now these counters are updated more often.
Reported by: llm-postcr
Fixes: c72102583a9a7881c5f992408dad6440840a8650
anyraid: fail the creation when a child fails to open
When a vdev is created, vdev_anyraid_open() works out the tile size
from the sizes of its children and has no capacity recorded for them,
so child_capacities stays NULL. The children that failed to open are
counted against the parity, and when there are no more than nparity of
them, the tiles of each one are read from child_capacities, with only
an assertion that it is set. A child that failed before its size was
known does not get there, as anyraid_calculate_size() reports it as
too small, but one that fails after vdev_open() has set its asize, as
when the probe of the device fails on I/O errors, makes a build without
assertions read through a NULL pointer, which panics the kernel.
vdev_create() fails a vdev with a child that did not open anyway, so
return the child's error once anyraid_calculate_size() has run, which
keeps its report of the children that are too small.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
[2 lines not shown]
[llvm-rc] Allow '+' in identifiers (#247298)
Unquoted resource names and filenames in Windows resource scripts can
now contain '+' characters (for example, "libc++.dll" in user-defined
resources). Microsoft rc.exe accepts '+' within unquoted resource
identifiers.
Previously, Tokenizer::canContinueIdentifier() did not handle '+',
splitting "libc++.dll" into "libc", '+', '+', ".dll" and failing with
"expected int or identifier, got +".
Allow '+' in Tokenizer::canContinueIdentifier(), matching how '-' and
'/' are already handled.
Assisted-by: Antigravity, especially for tests and review
ZTS: create AnyRAID with a child that fails to open
When a vdev is created, vdev_anyraid_open() has no capacity recorded
for its children, and reads one from a NULL array for each child that
failed to open. A child that failed before its size was known never
gets there: anyraid_calculate_size() reports it as too small. One that
fails after, as when the probe of the device fails on I/O errors, trips
an assertion on debug builds and makes other builds dereference NULL,
which panics the kernel.
The test puts one of three sparse files on a full tmpfs, where the
probe of the device cannot write the blocks of its labels it rewrites,
and checks that creating an anymirror1 pool on them fails, reporting
that a device could not be opened, and leaves no pool. It then moves
that file out of the tmpfs and checks that the pool is created. It
mounts a tmpfs, so it runs on Linux only. The next commit fixes the
bug.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
[3 lines not shown]
anyraid: report the full names of disks too small for a tile
anyraid_calculate_size() copies the name of each disk too small for a
tile into a 64-byte buffer, so zpool create reports paths longer than
63 characters cut short, as /dev/disk/by-id paths often are. The ZTS
test of the rounded tile size, which matches the names it expects,
then fails when the test directory's path is long. Use MAXPATHLEN
buffers instead.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Paul Dagnelie <paul.dagnelie at klarasystems.com>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19836
anyraid: check the disks against the rounded tile size
anyraid_calculate_size() checks that the smallest disk holds
vdev_anyraid_min_tile_size and 2^vdev_anyraid_disk_shift bytes, takes
the larger of the minimum and the smallest disk shifted right, and
rounds it up to a power of two. The rounding can take the tile past
the smallest disk: with a 100 MiB minimum, a disk with 105.5 MiB of
room for tiles passes the check and gets 128 MiB tiles, and so does,
with a shift of 0, any disk whose room is not a power of two. Such a
disk holds no tile, and calculate_asize() assumes that only a child
that failed to open has none. It trips an assertion on debug builds.
Without assertions, it dereferences a NULL pointer when fewer than
nparity + 1 children hold a tile, and otherwise creates the vdev with
a child that never holds one, which trips the same assertion when a
debug build imports the pool.
Check the disks against the rounded tile size instead, list those
below it, and report that size, plus the AnyRAID maps, as the minimum
device size. The tile size of a vdev whose disks all hold a tile is
[13 lines not shown]
ZTS: AnyRAID disks must hold a tile of the rounded size
The tile size of a new AnyRAID vdev is rounded up to a power of two,
but the disks are only checked against the size before rounding. With
a vdev_anyraid_min_tile_size that is not a power of two, or with a
vdev_anyraid_disk_shift of 0, the tile can be larger than the smallest
disk, which then holds no tile. On "zpool create", calculate_asize()
then trips an assertion on debug builds, which panics the kernel.
Without assertions, it dereferences a NULL pointer when fewer than
nparity + 1 disks hold a tile, and otherwise creates the vdev with a
disk that never holds one.
The test makes three files with 105.5 MiB of room for tiles each, and
checks that creating an anymirror1 pool on them fails, lists the three
files and reports the AnyRAID maps plus a 128 MiB tile as the minimum
device size, once with a 100 MiB minimum tile size and once with a
disk shift of 0. It then grows two of the files and checks that the
creation fails and lists only the third, and grows the third and
checks that the pool is created with 128 MiB tiles. The next commit
[6 lines not shown]
clnt_rdma.c: Add EADDRNOTAVAIL and EHOSTUNREACH error handling
There was a testing report that showed an RDMA connection
attempt replied EADDRNOTAVAIL during a network partitioning.
This error was not being handled as one that required a retry
of the connection attempt.
This patch adds EADDRNOTAVAIL and EHOSTUNREACH errors as ones
that require another reconnect attempt.
I have not been able to reproduce the failure, but think this
patch should correct the problem.
Reported by: Wafa Hamzah <wafah at nvidia.com>
MFC after: 1 month
Fixes: 80bee4d83637 ("nfsclrdma: Add code to support client side NFS over RDMA")
[libc] Check upper key limit in TSSKeyMgr::is_valid_key (#247857)
`TSSKeyMgr::get_dtor`, `TSSKeyMgr::remove_key`, and `get_tss_value`
check `key >= TSS_KEY_COUNT` before indexing key storage, while
`TSSKeyMgr::is_valid_key` indexed `units[key]` directly. Check `key >=
TSS_KEY_COUNT` in `is_valid_key` as well so `set_tss_value` returns
`false` for keys at or above `TSS_KEY_COUNT`, and add `pthread_tss_test`
covering `pthread_key_*` and `tss_*` key validation.
Assisted-By: Gemini
devel/aphpunit: Upgrade from 2.3 to 2.42.0
Changelog:
Feature: Add optional legacy JUnit XML reports for CI and test-case management systems
Feature: Add --max-forks option to configure the number of parallel tests
Feature: Display test-case discovery and execution progress
Bugfix: Reap all finished child processes when SIGCHLD signals are combined
Bugfix: Report the test case and message and queue sizes when sending an IPC message fails
Bugfix: Add the missing bin/aphpunit executable for Composer installations
Bugfix: Use a separate IPC queue for each APHPUnit instance to support parallel runs
Taken from: https://gitlab.p.variablis.de/open-source/aphpunit/-/releases/2.42.0
Sponsored by: OTTRIA
(cherry picked from commit beecb1c707e52b0b92b3d7195fb82b3a24b32131)
[Clang][AMDGPU] Remove redundant isAMDGCN checks. NFC (#246818)
After the r600 target removal, AMDGPUTargetInfo is only created for
the amdgcn triple, so every `isAMDGCN()` check in it is always true.
Drop those checks and the helpers that only wrapped them.
```
if (hasFMAF())
Builder.defineMacro("__HAS_FMAF__");
-->
Builder.defineMacro("__HAS_FMAF__");
```
RFC: https://discourse.llvm.org/t/rfc-amdgpu-deprecating-and-removing-llvm-s-r600-terascale-backend/92840