There's no need to write pattern across whole range,
just make sure we touch every page.

Signed-off-by: Jan Stancek <jstan...@redhat.com>
---
 testcases/kernel/mem/lib/mem.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index 61b1ee6..b0c97ae 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -28,7 +28,8 @@
 
 static int alloc_mem(long int length, int testcase)
 {
-       void *s;
+       char *s;
+       long i, pagesz = getpagesize();
 
        tst_resm(TINFO, "allocating %ld bytes.", length);
 
@@ -43,7 +44,8 @@ static int alloc_mem(long int length, int testcase)
        if (testcase == KSM && madvise(s, length, MADV_MERGEABLE) == -1)
                return errno;
 #endif
-       memset(s, '\a', length);
+       for (i = 0; i < length; i += pagesz)
+               s[i] = '\a';
 
        return 0;
 }
-- 
1.7.1


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to