diff options
author | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-04-24 17:41:23 +0000 |
---|---|---|
committer | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-04-24 17:41:23 +0000 |
commit | 3561541c244da5ff6b0ded99a22bd1541bdb2a11 (patch) | |
tree | 4ff6216ba29ab1d72e45f2d88f66c839a9d7799b /include/sys/kmem.h | |
parent | 1bac409fa3a7c0b4e09e43776ac063ef50efcfd6 (diff) |
Prep for 0.2.1 tag
Minor fixes to headers to use debug macros
Added /proc/sys/spl/version
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@90 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/sys/kmem.h')
-rw-r--r-- | include/sys/kmem.h | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h index a02bdcbff..c355fdc3c 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -36,17 +36,21 @@ extern int kmem_warning_flag; \ /* Marked unlikely because we should never be doing this */ \ if (unlikely((size) > (PAGE_SIZE * 4)) && kmem_warning_flag) \ - printk("spl: Warning kmem_alloc(%d, 0x%x) large alloc at %s:%d "\ - "(%ld/%ld)\n", (int)(size), (int)(flags), \ - __FILE__, __LINE__, \ - atomic64_read(&kmem_alloc_used), kmem_alloc_max); \ + __CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \ + "kmem_alloc(%d, 0x%x) large alloc at %s:%d " \ + "(%ld/%ld)\n", (int)(size), (int)(flags), \ + __FILE__, __LINE__, \ + atomic64_read(&kmem_alloc_used), \ + kmem_alloc_max); \ \ _ptr_ = (void *)allocator((size), (flags)); \ if (_ptr_ == NULL) { \ - printk("spl: Warning kmem_alloc(%d, 0x%x) failed at %s:%d " \ - "(%ld/%ld)\n", (int)(size), (int)(flags), \ - __FILE__, __LINE__, \ - atomic64_read(&kmem_alloc_used), kmem_alloc_max); \ + __CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \ + "kmem_alloc(%d, 0x%x) failed at %s:%d " \ + "(%ld/%ld)\n", (int)(size), (int)(flags), \ + __FILE__, __LINE__, \ + atomic64_read(&kmem_alloc_used), \ + kmem_alloc_max); \ } else { \ atomic64_add((size), &kmem_alloc_used); \ if (unlikely(atomic64_read(&kmem_alloc_used)>kmem_alloc_max)) \ @@ -72,17 +76,20 @@ extern int kmem_warning_flag; \ ASSERT(flags & KM_SLEEP); \ \ - _ptr_ = (void *)__vmalloc((size), (((flags) | \ - __GFP_HIGHMEM) & \ - ~__GFP_ZERO), PAGE_KERNEL); \ + _ptr_ = (void *)__vmalloc((size), \ + (((flags) | __GFP_HIGHMEM) & ~__GFP_ZERO), \ + PAGE_KERNEL); \ if (_ptr_ == NULL) { \ - printk("spl: Warning vmem_alloc(%d, 0x%x) failed at %s:%d " \ - "(%ld/%ld)\n", (int)(size), (int)(flags), \ - __FILE__, __LINE__, \ - atomic64_read(&vmem_alloc_used), vmem_alloc_max); \ + __CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \ + "vmem_alloc(%d, 0x%x) failed at %s:%d " \ + "(%ld/%ld)\n", (int)(size), (int)(flags), \ + __FILE__, __LINE__, \ + atomic64_read(&vmem_alloc_used), \ + vmem_alloc_max); \ } else { \ if (flags & __GFP_ZERO) \ memset(_ptr_, 0, (size)); \ + \ atomic64_add((size), &vmem_alloc_used); \ if (unlikely(atomic64_read(&vmem_alloc_used)>vmem_alloc_max)) \ vmem_alloc_max = atomic64_read(&vmem_alloc_used); \ |