Skip to contentSkip to conversation

Revert "drm/amdkfd: Improve signal event slow path"

PATCH In review Philip Yang 2 participants 2 messages Oct 29, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/amdkfd: Improve signal event slow path"

To fix regression report on gfx8, which requires the exhaustive search path for signaled event.

The high CPU usage of KFD interrupt wq issus is gone after HIP/ROCr add option to reduce HW event interrupts, safe to revert this optimization patch now.

This reverts commit de844846f72b152119faaef1b363448dc8ea368f.

---
 drivers/gpu/drm/amd/amdkfd/kfd_events.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +0 -11
index 82905f3e54dd..5a190dd6be4e 100644
@@ -748,16 +748,6 @@ void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id,
 		uint64_t *slots = page_slots(p->signal_page);
 		uint32_t id;
 
-		/*
-		 * If id is valid but slot is not signaled, GPU may signal the same event twice
-		 * before driver have chance to process the first interrupt, then signal slot is
-		 * auto-reset after set_event wakeup the user space, just drop the second event as
-		 * the application only need wakeup once.
-		 */
-		if ((valid_id_bits > 31 || (1U << valid_id_bits) >= KFD_SIGNAL_EVENT_LIMIT) &&
-		    partial_id < KFD_SIGNAL_EVENT_LIMIT && slots[partial_id] == UNSIGNALED_EVENT_SLOT)
-			goto out_unlock;
-
 		if (valid_id_bits)
 			pr_debug_ratelimited("Partial ID invalid: %u (%u valid bits)\n",
 					     partial_id, valid_id_bits);
@@ -786,7 +776,6 @@ void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id,
 		}
 	}
 
-out_unlock:
 	rcu_read_unlock();
 	kfd_unref_process(p);
 }
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Philip Yang

To fix regression report on gfx8, which requires the exhaustive search path for signaled event.

The high CPU usage of KFD interrupt wq issus is gone after HIP/ROCr add option to reduce HW event interrupts, safe to revert this optimization patch now.

This reverts commit de844846f72b152119faaef1b363448dc8ea368f.

Missing your Signed-off-by. WIth that fixed:

Quoted 36 lines
---
 drivers/gpu/drm/amd/amdkfd/kfd_events.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_events.c +0 -12
index 82905f3e54dd..5a190dd6be4e 100644
@@ -748,16 +748,6 @@ void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id,
                uint64_t *slots = page_slots(p->signal_page);
                uint32_t id;
 
-               /*
-                * If id is valid but slot is not signaled, GPU may signal the same event twice
-                * before driver have chance to process the first interrupt, then signal slot is
-                * auto-reset after set_event wakeup the user space, just drop the second event as
-                * the application only need wakeup once.
-                */
-               if ((valid_id_bits > 31 || (1U << valid_id_bits) >= KFD_SIGNAL_EVENT_LIMIT) &&
-                   partial_id < KFD_SIGNAL_EVENT_LIMIT && slots[partial_id] == UNSIGNALED_EVENT_SLOT)
-                       goto out_unlock;
-
                if (valid_id_bits)
                        pr_debug_ratelimited("Partial ID invalid: %u (%u valid bits)\n",
                                             partial_id, valid_id_bits);
@@ -786,7 +776,6 @@ void kfd_signal_event_interrupt(u32 pasid, uint32_t partial_id,
                }
        }
 
-out_unlock:
        rcu_read_unlock();
        kfd_unref_process(p);
 }
--

2.49.0