Skip to content

Commit 97ddae7

Browse files
committed
Revert "drm/amdkfd: SMI report dropped event count"
This reverts commit a3ab2d4. The userspace side for this code is not ready yet so revert for now. Reviewed-by: Philip Yang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: Philip Yang <[email protected]>
1 parent 32e7ee2 commit 97ddae7

File tree

2 files changed

+4
-29
lines changed

2 files changed

+4
-29
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ struct kfd_smi_client {
4242
struct rcu_head rcu;
4343
pid_t pid;
4444
bool suser;
45-
u32 drop_count;
4645
};
4746

4847
#define KFD_MAX_KFIFO_SIZE 8192
@@ -104,28 +103,12 @@ static ssize_t kfd_smi_ev_read(struct file *filep, char __user *user,
104103
}
105104
to_copy = min(size, to_copy);
106105
ret = kfifo_out(&client->fifo, buf, to_copy);
106+
spin_unlock(&client->lock);
107107
if (ret <= 0) {
108-
spin_unlock(&client->lock);
109108
ret = -EAGAIN;
110109
goto ret_err;
111110
}
112111

113-
if (client->drop_count) {
114-
char msg[KFD_SMI_EVENT_MSG_SIZE];
115-
int len;
116-
117-
len = snprintf(msg, sizeof(msg), "%x ", KFD_SMI_EVENT_DROPPED_EVENT);
118-
len += snprintf(msg + len, sizeof(msg) - len,
119-
KFD_EVENT_FMT_DROPPED_EVENT(ktime_get_boottime_ns(),
120-
client->pid, client->drop_count));
121-
if (kfifo_avail(&client->fifo) >= len) {
122-
kfifo_in(&client->fifo, msg, len);
123-
client->drop_count = 0;
124-
}
125-
}
126-
127-
spin_unlock(&client->lock);
128-
129112
ret = copy_to_user(user, buf, to_copy);
130113
if (ret) {
131114
ret = -EFAULT;
@@ -199,15 +182,13 @@ static void add_event_to_kfifo(pid_t pid, struct kfd_node *dev,
199182
list_for_each_entry_rcu(client, &dev->smi_clients, list) {
200183
if (!kfd_smi_ev_enabled(pid, client, smi_event))
201184
continue;
202-
203185
spin_lock(&client->lock);
204-
if (!client->drop_count && kfifo_avail(&client->fifo) >= len) {
186+
if (kfifo_avail(&client->fifo) >= len) {
205187
kfifo_in(&client->fifo, event_msg, len);
206188
wake_up_all(&client->wait_queue);
207189
} else {
208-
client->drop_count++;
209-
pr_debug("smi_event(EventID: %u): no space left drop_count %d\n",
210-
smi_event, client->drop_count);
190+
pr_debug("smi_event(EventID: %u): no space left\n",
191+
smi_event);
211192
}
212193
spin_unlock(&client->lock);
213194
}

include/uapi/linux/kfd_ioctl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ enum kfd_smi_event {
530530
KFD_SMI_EVENT_QUEUE_EVICTION = 9,
531531
KFD_SMI_EVENT_QUEUE_RESTORE = 10,
532532
KFD_SMI_EVENT_UNMAP_FROM_GPU = 11,
533-
KFD_SMI_EVENT_DROPPED_EVENT = 12,
534533

535534
/*
536535
* max event number, as a flag bit to get events from all processes,
@@ -611,7 +610,6 @@ struct kfd_ioctl_smi_events_args {
611610
* rw: 'W' for write page fault, 'R' for read page fault
612611
* rescheduled: 'R' if the queue restore failed and rescheduled to try again
613612
* error_code: migrate failure error code, 0 if no error
614-
* drop_count: how many events dropped when fifo is full
615613
*/
616614
#define KFD_EVENT_FMT_UPDATE_GPU_RESET(reset_seq_num, reset_cause)\
617615
"%x %s\n", (reset_seq_num), (reset_cause)
@@ -647,10 +645,6 @@ struct kfd_ioctl_smi_events_args {
647645
"%lld -%d @%lx(%lx) %x %d\n", (ns), (pid), (addr), (size),\
648646
(node), (unmap_trigger)
649647

650-
#define KFD_EVENT_FMT_DROPPED_EVENT(ns, pid, drop_count)\
651-
"%lld -%d %d\n", (ns), (pid), (drop_count)
652-
653-
654648
/**************************************************************************************************
655649
* CRIU IOCTLs (Checkpoint Restore In Userspace)
656650
*

0 commit comments

Comments
 (0)