crypto: don't track xor test pages with kmemcheck
authorVegard Nossum <vegard.nossum@gmail.com>
Thu, 26 Feb 2009 08:55:52 +0000 (09:55 +0100)
committerVegard Nossum <vegard.nossum@gmail.com>
Mon, 15 Jun 2009 10:40:10 +0000 (12:40 +0200)
The xor tests are run on uninitialized data, because it is doesn't
really matter what the underlying data is. Annotate this false-
positive warning.

Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
crypto/xor.c

index 996b6ee57d9e3fb3ff48251ea9ee01d405b648ad..fc5b836f343084f74b76f516133adbe455e04ab7 100644 (file)
@@ -101,7 +101,12 @@ calibrate_xor_blocks(void)
        void *b1, *b2;
        struct xor_block_template *f, *fastest;
 
-       b1 = (void *) __get_free_pages(GFP_KERNEL, 2);
+       /*
+        * Note: Since the memory is not actually used for _anything_ but to
+        * test the XOR speed, we don't really want kmemcheck to warn about
+        * reading uninitialized bytes here.
+        */
+       b1 = (void *) __get_free_pages(GFP_KERNEL | __GFP_NOTRACK, 2);
        if (!b1) {
                printk(KERN_WARNING "xor: Yikes!  No memory available.\n");
                return -ENOMEM;