Skip to content

DLM rung-2: real cross-node $ENQ GRANT (vms-e8f1 / vms-17c, H4) - #849

Merged
baron-3dl merged 2 commits into
mainfrom
work/vms-e8f1
Aug 28, 2026
Merged

baron-3dl merged 2 commits into
mainfrom
work/vms-e8f1

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

H4 — the crown of the 0.6 DLM ladder: the first rung that MODIFIES THE EXECUTIVE

Makes vms_lock_dlm_xnode_dispatch (src/kernel-core/vms_lock.c) actually GRANT an inbound cross-node $ENQ for a resource mastered on this node, instead of the rung-1 honest SS$_UNSUPPORTED (2296) stub. Grounded on docs/research-alpha-dlm-wire.md §7 (rung-2 GRANT semantics from public $ENQ/$LCKDEF/IDSM/Cluster Systems sources). Clean-room Rule 8 respected — no VSI/HPE disassembly.

Executive (kernel-core; rides the 3-way gate {x86_64, VAX ILP32, Alpha LP64})

  • The grant: the ENQ case marshals the decoded request into vms_enq_core() with owner_csid = req->req_csid, so the master's lock record is held for the REMOTE requester's cluster identity, not the local delivery daemon. Compatible → SS$_NORMAL.
  • Scope fence (INV-6, everything past the foundation fails honestly): LCK_M_NOQUEUE fences out cross-node contention (incompatible → SS$_NOTQUEUED, no wait queue); no SYNC (never blocks the delivery thread); no VALBLK/AST (LVB replication + blocking-AST are later rungs). DEQ/GRANT/BLKAST still decline with SS$_UNSUPPORTED.
  • vms_lock_entry gains req_csid (the CSID a lock is held for; 0 = local), stamped in vms_enq_core. GET_RESMASTER reports remote_holder_csid so a test can PROVE the master genuinely holds a lock for a peer. Both fields reuse existing struct padno ABI size change, static_asserts unchanged. Mirrored into the NetBSD headers.

Transport (SCSD)

On a granted ENQ, scsd_dlm_dispatch_to_executive reads B's own lock DB back (GET_RESMASTER, same registered fd) and prints SCSD-I-DLMHELD — a READ of real executive state. DLMRX/DLMGRANT/DLMDONE wording is now status-aware. H0 --dlm-selftest switches ENQ→DEQ so it stays a side-effect-free "executive reached" probe (still 2296) — H0 harness untouched.

Proof — H4 harness (dlm-harness-h4 CI job)

Two real-/dev/vms QEMU nodes join, node A issues a cross-node $ENQ for a B-mastered resource. Ran locally under KVM — PASSED:

node B: SCSD-I-DLMRX  ... executive status=0x00000001 (GRANTED)
node B: SCSD-I-DLMHELD, master DB: resnam='RESONE' found=1 is_local_master=1 n_granted=1 held_for_csid=1601 master_csid=1
node A: SCSD-I-DLMDONE ... GRANT status=0x00000001 ... cross-node lock GRANTED by the master (SS$_NORMAL)

DLM HARNESS H4 PASSED: cross-node $ENQ GRANTED rc=SS$_NORMAL, B holds lock for A's CSID
  B_DISPATCH_STATUS=0x00000001  held_for_csid=1601 (A_CSID=1601)  n_granted=1  is_local_master=1

held_for_csid=1601 is node A's real SCSSYSTEMID (OVMXA) — B's resource DB genuinely holds the lock for A's cluster identity, not a fabricated SS$_NORMAL.

  • test_kmod_dlm_xnode retargeted to the foundation grant + a contention scope-fence (SS$_NOTQUEUED) proof.
  • H3's verdict updated to the grant (SS$_NORMAL) so it stays green (re-ran locally — PASSED).

Alpha caveat

Alpha vms.ko is P0-broken on main (rd vms-d38b / #835, unrelated). This change adds no new Alpha break; x86_64 grant proof above is the authoritative leg. Conductor release-gates Alpha convergence once the P0 lands.

🤖 Generated with Claude Code

baron-3dl and others added 2 commits August 28, 2026 16:29
…cutive

H4, the crown of the 0.6 DLM ladder: the first rung that MODIFIES THE EXECUTIVE.
vms_lock_dlm_xnode_dispatch (src/kernel-core/vms_lock.c) now GRANTS an inbound
cross-node $ENQ for a resource mastered on this node, instead of the rung-1
honest SS$_UNSUPPORTED stub.

Executive (kernel-core, rides the 3-way gate {x86_64, VAX ILP32, Alpha LP64}):
- vms_lock_dlm_xnode_dispatch ENQ case marshals the decoded request into
  vms_enq_core() with owner_csid = req->req_csid, so the master's lock record is
  held FOR the REMOTE requester's cluster identity, not the local delivery
  daemon. Compatible -> SS$_NORMAL (grant); LCK_M_NOQUEUE fences out cross-node
  contention (incompatible -> SS$_NOTQUEUED, no wait queue); no SYNC/VALBLK/AST.
  DEQ/GRANT/BLKAST still decline honestly (later rungs). INV-6: genuine grant,
  never a fabricated SS$_NORMAL.
- vms_lock_entry gains req_csid (the CSID a lock is held for; 0 = local),
  stamped in vms_enq_core from vms_enq_args.owner_csid.
- GET_RESMASTER reports remote_holder_csid -- the CSID a remote-held grant is
  held for -- so a test PROVES the master genuinely holds a lock for a peer,
  not just that n_granted rose. Both fields reuse existing struct pad (no ABI
  size change; static_asserts unchanged). Mirrored into the NetBSD headers.

Transport (SCSD, src/vmsscs/scsd.c):
- scsd_dlm_dispatch_to_executive, on a granted ENQ, reads B's own lock DB back
  (GET_RESMASTER, same registered fd) and prints SCSD-I-DLMHELD -- a READ of
  real executive state. DLMRX/DLMGRANT/DLMDONE wording is now status-aware
  (GRANTED vs honest decline). The H0 --dlm-selftest switches ENQ->DEQ so it
  stays a side-effect-free "executive reached" probe (still 2296), leaving the
  H0 harness untouched.

Proof -- H4 harness (extends H3): tests/qemu/{Dockerfile.dlm-harness-h4,
init_dlm_h4.sh,run_dlm_harness_h4.sh} + a dlm-harness-h4 CI job on the
dlm_harness path filter. Two real-/dev/vms QEMU nodes join, node A issues a
cross-node $ENQ for a B-mastered resource, and the verdict asserts (a) B's
dispatch = SS$_NORMAL and (b) B holds the lock for A's CSID (SCSD-I-DLMHELD
held_for_csid == A's CSID, n_granted>=1, is_local_master=1). H3's verdict is
updated to the grant (SS$_NORMAL) so it stays green; test_kmod_dlm_xnode is
retargeted to the foundation grant + a contention scope-fence (SS$_NOTQUEUED).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The H3 assertion already expects SS$_NORMAL (the rung-2 grant); only the
diagnostic echo line still said 'want 2296'. Cosmetic, log-only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit 5778d8d into main Aug 28, 2026
205 of 207 checks passed
baron-3dl added a commit that referenced this pull request Aug 28, 2026
…ce parity, SHOW USERS de-fab (#858)

Bumps OVMX_PRODUCT_VERSION and os-release V0.5-7 -> V0.5-8. 14 commits since V0.5-7.

Distributed Lock Manager — the cross-node ladder tops out at a real GRANT:
  - #849 vms-e8f1/vms-17c  DLM rung-2 (H4): the first REAL cross-node $ENQ GRANT
                           — node B holds a lock on A's behalf for A's CSID,
                           $ENQ returns SS$_NORMAL over live SCS (no longer
                           INV-6 "grants nothing"). The distributed lock
                           manager now actually locks across nodes.
  - #845 vms-209          DLM harness H3 — a cross-node $ENQ reaches node B's
                           real executive
  - #843 vms-4bd0         DLM harness H2 — two real-executive QEMU nodes
                           complete the full VMS$VAXcluster join
  - #842 vms-534          DLM harness H1 — two real-executive nodes exchange
                           the 0x6007 HELLO over a socket netdev
  - #840 vms-4b6          DLM harness rung H0 — SCSD.EXE composes with a real
                           executive
  - #841 docs             Alpha cross-node DLM wire oracle — observed SCS
                           transport + documented GRANT semantics (Rule 8)

Alpha co-release parity — authenticated login + the shared SHOW battery:
  - #852 vms-f2c          Alpha DCL/SHOW acceptance parity — the same shared
                           11-command battery x86_64 runs, now on
                           qemu-system-alpha
  - #847                  vms.ko guards BG fork-inherit tracepoints behind
                           CONFIG_TRACEPOINTS (Alpha P0 modpost fix)

Authenticity (INV-6 de-fabrication):
  - #839 vms-6a1          SHOW USERS fails honestly when the executive is
                           absent — no more per-process fabricated user list

Boot console fidelity:
  - #850 vms-dec          kill boot-console newline spam (the operator's echoed
                           RETURNs) + a type-during-boot regression gate

Networking (layered-product promotion):
  - #851 vms-67f          TCP/IP Services promoted to a first-class layered
                           product — build plan + roadmap (1.0 blocker)

Docs / ledger:
  - #745                  Alpha C-RTL archive DECIDED — Option A (operator
                           ruling 2026-08-23)
  - #709 vms-da0          OpenVMS GCC port × OVMX faithful-surface gap analysis
  - #838                  reconcile the release block for the V0.5-7 tag
                           (INV-LEDGER)

QA'd under KVM boot-to-login on the workshop host with the full SHOW
acceptance battery VMS-faithful; boot console clean (no newline flood) and
SHOW USERS honest. Release notes are generated at tag time by
tools/gen_release_notes.py (INV-LEDGER single-ledger); the roadmap narrative
block + public site are the conductor's reconcile (INV-0/INV-LEDGER).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
baron-3dl added a commit that referenced this pull request Aug 28, 2026
)

Renames tests/qemu/test_kmod_dlm_xnode.c -> test_syssvc_dlm_xnode.c so the
cross-node DLM RECEIVE-handler proof runs in the qemu_syssvc_tests family on
BOTH x86_64 and Alpha LP64 from a SINGLE source (DRY). On qemu-system-alpha,
with a freshly-built merged vms.ko (#849), it asserts the LIVE rung-2 grant:
a compatible cross-node $ENQ is GRANTED (SS$_NORMAL) and held for the REMOTE
requester's CSID, an incompatible one declines SS$_NOTQUEUED (NOQUEUE fence,
not queued/faked), DEQ/GRANT/BLKAST honestly decline SS$_UNSUPPORTED, and
bad-mode/op/empty-name are refused SS$_BADPARAM. 16/16 pass, modpost clean --
proving the vms_dlm_xnode_args / vms_enq_args LP64 struct layout is width-correct.

- syssvc contract: honest SKIP (77) when /dev/vms is absent, never a fake pass.
- tests/qemu/CMakeLists.txt: per-target src/kernel include (vms_ioctl.h).
- facility_defects.sh: new genuine negctl 'dlm-xnode-mode-unvalidated' + anchor
  (neuters the dispatch's lock-mode bounds check; reddens ONLY the bad-mode
  assertion) so the new test_syssvc_ suite is covered, not floor-bumped (INV-6).
- cross-ref comments in vms_kif.h/scsd.c/test_scsd_wire.c follow the rename.

Verified: qemu-system-alpha DRIVER_RC=0, SUITE rc=0 (16 pass / 0 fail).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant