diff options
author | Brian Behlendorf <[email protected]> | 2014-04-07 15:40:20 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-04-08 12:44:41 -0700 |
commit | 668d2a0da5d542983ab200b35732d44c8b724305 (patch) | |
tree | 533f1f8cf22f4f1bde7b5f70af74641b5fac4104 | |
parent | 4c995417bc4207118eb9ae4848086c89bf1132f7 (diff) |
splat kmem:slab_reclaim: Test cleanup
By setting __GFP_NORETRY the kernel memory reclaim logic was allowed to
abort early and dump a falled allocation stack to the console. Since
this was done in a tight loop to fill memory it could result in a large
number of stacks being dumped to the console. This in turn slowed down
the test sufficiently so it exceeded the time limit and failed.
To resolve this issue the __GFP_NORETRY flag is being removed. This is
how it should have been called originally to ensure we're simulating
the behavior of most callers which will use the GFP_KERNEL flag.
In addition, the reclaim granularity of 1000 objects was far to coarse
for this to be a realistic test. For kmem:slab_reclaim there might
only be a few thousand objects total in the cache. Therefore, the
SPLAT_KMEM_OBJ_RECLAIM constant for these tests was lowered. This
will cause the reclaim callback to run more frequently which makes
for a better test case.
The frequency of the cache reaping in kmem:slab_reap was increased
to accommodate the reduced number of objects released during the
reclaim.
These changes only impact the test cases and were done to remove
false positives caused by the test case itself.
Signed-off-by: Brian Behlendorf <[email protected]>
-rw-r--r-- | module/splat/splat-kmem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/module/splat/splat-kmem.c b/module/splat/splat-kmem.c index 28ff83721..25a52b43d 100644 --- a/module/splat/splat-kmem.c +++ b/module/splat/splat-kmem.c @@ -244,7 +244,7 @@ splat_kmem_test4(struct file *file, void *arg) #define SPLAT_KMEM_TEST_MAGIC 0x004488CCUL #define SPLAT_KMEM_CACHE_NAME "kmem_test" #define SPLAT_KMEM_OBJ_COUNT 1024 -#define SPLAT_KMEM_OBJ_RECLAIM 1000 /* objects */ +#define SPLAT_KMEM_OBJ_RECLAIM 32 /* objects */ #define SPLAT_KMEM_THREADS 32 #define KCP_FLAG_READY 0x01 @@ -895,7 +895,8 @@ splat_kmem_test8(struct file *file, void *arg) goto out_kct; } - for (i = 0; i < 60; i++) { + /* Force reclaim every 1/10 a second for 60 seconds. */ + for (i = 0; i < 600; i++) { kmem_cache_reap_now(kcp->kcp_cache); splat_kmem_cache_test_debug(file, SPLAT_KMEM_TEST8_NAME, kcp); @@ -903,7 +904,7 @@ splat_kmem_test8(struct file *file, void *arg) break; set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(HZ); + schedule_timeout(HZ / 10); } if (kcp->kcp_cache->skc_obj_total == 0) { @@ -1271,7 +1272,7 @@ splat_kmem_test13(struct file *file, void *arg) break; } - dp = (dummy_page_t *)__get_free_page(GFP_KERNEL | __GFP_NORETRY); + dp = (dummy_page_t *)__get_free_page(GFP_KERNEL); if (!dp) { fails++; splat_vprint(file, SPLAT_KMEM_TEST13_NAME, |