summaryrefslogtreecommitdiff
path: root/fs/xfs/linux-2.6/kmem.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-09-28 11:03:05 +1000
committerTim Shimmin <tes@sgi.com>2006-09-28 11:03:05 +1000
commitefb8ad7e9431a430a75d44288614cf6047ff4baa (patch)
treecbebf7d8bf1b5f25235756c0aa7ff610d4cb4055 /fs/xfs/linux-2.6/kmem.c
parent3f89243c5b987dd55f8eec6fd54be05887d69bc6 (diff)
[XFS] Add a debug flag for allocations which are known to be larger than
one page. SGI-PV: 955302 SGI-Modid: xfs-linux-melb:xfs-kern:26800a Signed-off-by: Nathan Scott <nathans@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/kmem.c')
-rw-r--r--fs/xfs/linux-2.6/kmem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/linux-2.6/kmem.c
index aba7fcf881a..f77fe5c8fcc 100644
--- a/fs/xfs/linux-2.6/kmem.c
+++ b/fs/xfs/linux-2.6/kmem.c
@@ -34,6 +34,14 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
gfp_t lflags = kmem_flags_convert(flags);
void *ptr;
+#ifdef DEBUG
+ if (unlikely(!(flags & KM_LARGE) && (size > PAGE_SIZE))) {
+ printk(KERN_WARNING "Large %s attempt, size=%ld\n",
+ __FUNCTION__, (long)size);
+ dump_stack();
+ }
+#endif
+
do {
if (size < MAX_SLAB_SIZE || retries > MAX_VMALLOCS)
ptr = kmalloc(size, lflags);