summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c90
1 files changed, 82 insertions, 8 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index d2c7eaf..444298a 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -8504,6 +8504,7 @@ static u64 svc_rel_va_seen;
*/
static u32 svc_rel_count;
static u32 svc_fake_rel_log; /* r576b DIAG: sema-fake witness budget */
+static u32 svc_ce_foreign_log; /* r577: foreign-release refusal witness */
static u32 svc_dbg_streams;
static u32 svc_chan_put_log;
/* ISSUE-0002 (r55): per-rank put-snapshot throttle (ch is a local copy). */
@@ -21036,7 +21037,12 @@ static void svc_gr_dec_dump(const struct svc_channel *ch)
dstpend ? 1 : 0, copypend ? 1 : 0,
svc_gr_defer_expired(svc_gr_cand.push_va) ? 1 : 0);
- for (i = 0; i < svc_fwd_req.gr_n_data && i < 32; i++)
+ /*
+ * r577: raised from 32 to 256 pages - the mail VADD's fill carried
+ * n_data=969 pages and the red-draw divergence (a wrong-but-similar
+ * input page) can sit beyond the first 32 pages.
+ */
+ for (i = 0; i < svc_fwd_req.gr_n_data && i < 256; i++)
pr_info("vgsp-gr: GR-DEC data[%u] va=0x%llx pa=0x%llx ap=%u reloc=0x%llx\n",
i, svc_fwd_req.gr_data[i].va,
svc_fwd_req.gr_data[i].pa, svc_fwd_req.gr_data[i].ap,
@@ -23610,8 +23616,21 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu)
ch, idx, va, true,
true,
NULL);
+ /*
+ * r577: for a CE channel only a
+ * pool-shaped release target is
+ * this channel's tracking slot. A
+ * rescued stale page can decode a
+ * release to a foreign VA (r575:
+ * 0x12006c004 pay=60); counting
+ * that as the tracking release
+ * advanced the expectation without
+ * delivering to the pool.
+ */
rel_seen =
- (svc_rel_count != rel_n2);
+ (svc_rel_count != rel_n2) &&
+ (!ch->engine_type ||
+ svc_pool_sem_va(svc_rel_va_seen));
/*
* The rescue re-synced the
* expectation down to the RAM
@@ -23638,13 +23657,37 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu)
true,
NULL);
rel_seen =
- (svc_rel_count != rel_n2);
+ (svc_rel_count != rel_n2) &&
+ (!ch->engine_type ||
+ svc_pool_sem_va(svc_rel_va_seen));
}
}
}
if (rel_seen) {
- ch->last_rel_va =
- svc_rel_va_seen;
+ /*
+ * r577: the exact slot every
+ * recovery release targets; only
+ * a pool-shaped VA may claim it
+ * for a CE channel. The r575
+ * wedge adopted a foreign rescued
+ * release (0x12006c004) here and
+ * every later recovery went away
+ * from the client's pool
+ * (0x121000000 stayed at 25 while
+ * the client waited for 34; the
+ * exact-slot poke recovered it).
+ */
+ if (!ch->engine_type ||
+ svc_pool_sem_va(svc_rel_va_seen))
+ ch->last_rel_va =
+ svc_rel_va_seen;
+ else if (svc_ce_foreign_log < 16) {
+ svc_ce_foreign_log++;
+ pr_info("sema-chan: foreign release VA 0x%llx refused as tracking slot h=0x%x eng=%u (recovery stays on the pool slot)\n",
+ svc_rel_va_seen,
+ ch->h_object,
+ ch->engine_type);
+ }
ch->unread_va = 0;
ch->unread_until = 0;
}
@@ -23881,6 +23924,8 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu)
/* Rescue succeeded, retry the read. */
if (!svc_read_va_push(vgpu, ch, va, pb,
len)) {
+ bool track_rel = false;
+
/*
* Never run work decoded from a
* rescued page: the rescue matches
@@ -23905,14 +23950,43 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu)
false,
false,
NULL);
- if (svc_rel_count != rel_n_before)
+ /*
+ * r577: only a pool-shaped
+ * release counts as this CE
+ * channel's tracking release
+ * (see the norel-path comment).
+ * A foreign target must not
+ * claim the exact slot, and the
+ * pool step must still be
+ * delivered.
+ */
+ track_rel =
+ (svc_rel_count != rel_n_before) &&
+ (!ch->engine_type ||
+ svc_pool_sem_va(svc_rel_va_seen));
+ if (track_rel)
ch->last_rel_va =
svc_rel_va_seen;
+ else if (svc_rel_count != rel_n_before &&
+ svc_ce_foreign_log < 16) {
+ svc_ce_foreign_log++;
+ pr_info("sema-chan: foreign release VA 0x%llx refused (rescue) h=0x%x eng=%u (pool step via fallback)\n",
+ svc_rel_va_seen,
+ ch->h_object,
+ ch->engine_type);
+ }
}
ch->submissions++;
svc.gpfifo_entries_done++;
- if (ch->engine_type && ch->expected_sem_payload)
- ch->expected_sem_payload++;
+ if (ch->engine_type &&
+ ch->expected_sem_payload) {
+ if (track_rel)
+ ch->expected_sem_payload++;
+ else if (!gsp_sema_fake_rel)
+ svc_fake_release(vgpu, ch);
+ else
+ ch->expected_sem_payload++;
+ }
} else {
svc.gpfifo_nomap++;
kfree(pb);