Skip to contentSkip to conversation

nouveau: add ratelimit to nouveau_graph_dump_trap_info

PATCH New Xavier Chantry 2 participants 3 messages Nov 27, 2009 – Dec 5, 2009 2 messages not in the archive

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

PATCH 1/1 nouveau: add ratelimit to nouveau_graph_dump_trap_info

Often when things get stuck spinning, nouveau_pgraph_intr_error and nouveau_graph_dump_trap_info gets called many times, flooding logs with PGRAPH_ERROR and filling up the disk.

Pekka Paalanen pointed me to ratelimit, so I went ahead and added some ratelimit support. It is much better now :)

I am completely new to the kernel world though so I hope I did not do something terribly wrong.

---
 drivers/gpu/drm/nouveau/nouveau_irq.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/gpu/drm/nouveau/nouveau_irq.c +9 -1
index 597007a..0aae8c2 100644
@@ -462,6 +462,14 @@ nouveau_pgraph_intr_notify(struct drm_device *dev, uint32_t nsource)
 		nouveau_graph_dump_trap_info(dev, "PGRAPH_NOTIFY", &trap);
 }
 
+DEFINE_RATELIMIT_STATE(nouveau_ratelimit_state, 3 * HZ, 20);
+
+int nouveau_ratelimit(void)
+{
+	        return __ratelimit(&nouveau_ratelimit_state);
+}
+
+
 static inline void
 nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource)
 {
@@ -478,7 +486,7 @@ nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource)
 		unhandled = 1;
 	}
 
-	if (unhandled)
+	if (unhandled && nouveau_ratelimit())
 		nouveau_graph_dump_trap_info(dev, "PGRAPH_ERROR", &trap);
 }
 
Signature · 1 line
1.6.5.3

A message that is not in the archive (sent off-list or not yet received): 1259357794-6972-1-git-send-email-shiningxc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 1/1 nouveau: add ratelimit to nouveau_graph_dump_trap_info

Often when things get stuck spinning, nouveau_pgraph_intr_error and nouveau_graph_dump_trap_info gets called many times, flooding logs with PGRAPH_ERROR and filling up the disk.

Pekka Paalanen pointed me to ratelimit, so I went ahead and added some ratelimit support. It is much better now :)

I am completely new to the kernel world though so I hope I did not do something terribly wrong.

---

Addressed a few comments from pq (or is it PP ? :D)
* make the function and global variable static
* fix whitespace damage

 drivers/gpu/drm/nouveau/nouveau_irq.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/gpu/drm/nouveau/nouveau_irq.c +9 -1
index 597007a..fa3b5d1 100644
@@ -462,6 +462,14 @@ nouveau_pgraph_intr_notify(struct drm_device *dev, uint32_t nsource)
 		nouveau_graph_dump_trap_info(dev, "PGRAPH_NOTIFY", &trap);
 }
 
+static DEFINE_RATELIMIT_STATE(nouveau_ratelimit_state, 3 * HZ, 20);
+
+static int nouveau_ratelimit(void)
+{
+	return __ratelimit(&nouveau_ratelimit_state);
+}
+
+
 static inline void
 nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource)
 {
@@ -478,7 +486,7 @@ nouveau_pgraph_intr_error(struct drm_device *dev, uint32_t nsource)
 		unhandled = 1;
 	}
 
-	if (unhandled)
+	if (unhandled && nouveau_ratelimit())
 		nouveau_graph_dump_trap_info(dev, "PGRAPH_ERROR", &trap);
 }
 
Signature · 1 line
1.6.5.3

A message that is not in the archive (sent off-list or not yet received): 1259361073-24931-1-git-send-email-shiningxc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#4 lore raw
Quoted 11 lines · On Fri, 27 Nov 2009 23:31:13 +0100 Xavier Chantry…

Often when things get stuck spinning, nouveau_pgraph_intr_error and nouveau_graph_dump_trap_info gets called many times, flooding logs with PGRAPH_ERROR and filling up the disk.

Pekka Paalanen pointed me to ratelimit, so I went ahead and added some ratelimit support. It is much better now :)

I am completely new to the kernel world though so I hope I did not do something terribly wrong.

Pushed, finally, with a little message trimming.
Sorry for the delay.

Signature · 2 lines
Pekka Paalanen
http://www.iki.fi/pq/