aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_proc.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-17 19:52:34 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-10-17 19:52:34 +0200
commitf22f89e6b3c970a29197d3a53c170fb7d0340cbe (patch)
treee36c1e56ae728a57c2af09025a82786d944b6006 /linux-core/drm_proc.c
parentd515936ea7f98f6aaa9217699796beadef9d664b (diff)
Add vma list memory usage to memory accounting.
Use byte unit for /proc printout of memory usage for small sizes to be able to detect memory allocation bugs more easily.
Diffstat (limited to 'linux-core/drm_proc.c')
-rw-r--r--linux-core/drm_proc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/linux-core/drm_proc.c b/linux-core/drm_proc.c
index 4bb71ca7..863cacfc 100644
--- a/linux-core/drm_proc.c
+++ b/linux-core/drm_proc.c
@@ -469,8 +469,13 @@ static int drm__objects_info(char *buf, char **start, off_t offset, int request,
drm_query_memctl(&used_mem, &low_mem, &high_mem);
- DRM_PROC_PRINT("Used object memory is %lu pages.\n",
- (unsigned long) (used_mem >> PAGE_SHIFT));
+ if (used_mem > 16*PAGE_SIZE) {
+ DRM_PROC_PRINT("Used object memory is %lu pages.\n",
+ (unsigned long) (used_mem >> PAGE_SHIFT));
+ } else {
+ DRM_PROC_PRINT("Used object memory is %lu bytes.\n",
+ (unsigned long) used_mem);
+ }
DRM_PROC_PRINT("Soft object memory usage threshold is %lu pages.\n",
(unsigned long) (low_mem >> PAGE_SHIFT));
DRM_PROC_PRINT("Hard object memory usage threshold is %lu pages.\n",