aboutsummaryrefslogtreecommitdiffstats
path: root/module/splat
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-05-19 16:53:13 -0700
committerBrian Behlendorf <[email protected]>2010-05-19 16:53:13 -0700
commit5198ea0e713895efc06f1254e009e2271436fc6f (patch)
tree967f9ae9506768c3f27ae590e187919923edd4c9 /module/splat
parent627a74972c23ddd2d27163213317cdfa878eb4d7 (diff)
Remove kmem_set_warning() interface replace with __GFP_NOWARN flag.
Remove the kmem_set_warning() hack used by the kmem-splat regression tests with a per-allocation flag called __GFP_NOWARN. This matches the lower level linux flag of similar by slightly different function. The idea is you can then explicitly set this flag on requests where you know your breaking the max 8k rule but you need/want to do it anyway. This is currently used by the regression tests where we intentionally push things to the limit but don't want the log noise. Additionally, we are forced to use it in spl_kmem_cache_create() because by default NR_CPUS is very large and theres no easy way to handle that. Finally, I've added a stack_dump() call to the warning when it is trigger to make to clear exactly where the allocation is taking place.
Diffstat (limited to 'module/splat')
-rw-r--r--module/splat/splat-kmem.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/module/splat/splat-kmem.c b/module/splat/splat-kmem.c
index 28b657c15..27efadca5 100644
--- a/module/splat/splat-kmem.c
+++ b/module/splat/splat-kmem.c
@@ -90,15 +90,11 @@ splat_kmem_test1(struct file *file, void *arg)
int size = PAGE_SIZE;
int i, count, rc = 0;
- /* We are intentionally going to push kmem_alloc to its max
- * allocation size, so suppress the console warnings for now */
- kmem_set_warning(0);
-
while ((!rc) && (size <= (PAGE_SIZE * 32))) {
count = 0;
for (i = 0; i < SPLAT_KMEM_ALLOC_COUNT; i++) {
- ptr[i] = kmem_alloc(size, KM_SLEEP);
+ ptr[i] = kmem_alloc(size, KM_SLEEP | __GFP_NOWARN);
if (ptr[i])
count++;
}
@@ -116,8 +112,6 @@ splat_kmem_test1(struct file *file, void *arg)
size *= 2;
}
- kmem_set_warning(1);
-
return rc;
}
@@ -128,15 +122,11 @@ splat_kmem_test2(struct file *file, void *arg)
int size = PAGE_SIZE;
int i, j, count, rc = 0;
- /* We are intentionally going to push kmem_alloc to its max
- * allocation size, so suppress the console warnings for now */
- kmem_set_warning(0);
-
while ((!rc) && (size <= (PAGE_SIZE * 32))) {
count = 0;
for (i = 0; i < SPLAT_KMEM_ALLOC_COUNT; i++) {
- ptr[i] = kmem_zalloc(size, KM_SLEEP);
+ ptr[i] = kmem_zalloc(size, KM_SLEEP | __GFP_NOWARN);
if (ptr[i])
count++;
}
@@ -145,7 +135,7 @@ splat_kmem_test2(struct file *file, void *arg)
for (i = 0; i < SPLAT_KMEM_ALLOC_COUNT; i++) {
for (j = 0; j < size; j++) {
if (((char *)ptr[i])[j] != '\0') {
- splat_vprint(file, SPLAT_KMEM_TEST2_NAME,
+ splat_vprint(file,SPLAT_KMEM_TEST2_NAME,
"%d-byte allocation was "
"not zeroed\n", size);
rc = -EFAULT;
@@ -166,8 +156,6 @@ splat_kmem_test2(struct file *file, void *arg)
size *= 2;
}
- kmem_set_warning(1);
-
return rc;
}