All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Dave Young <dyoung@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	xiyou.wangcong@gmail.com, penberg@kernel.org,
	fengguang.wu@intel.com, cl@linux.com,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 3/3 v2] move hugepage test examples to tools/testing/selftests/vm
Date: Thu, 9 Feb 2012 15:03:16 -0800	[thread overview]
Message-ID: <20120209150316.15be9361.akpm@linux-foundation.org> (raw)
In-Reply-To: <20120209014622.GA5143@darkstar.nay.redhat.com>

On Thu, 9 Feb 2012 09:46:22 +0800
Dave Young <dyoung@redhat.com> wrote:

> Andrew, updated the patch as below, is it ok to you?
> ---
> 
> hugepage-mmap.c, hugepage-shm.c and map_hugetlb.c in Documentation/vm are
> simple pass/fail tests, It's better to promote them to tools/testing/selftests
> 
> Thanks suggestion of Andrew Morton about this. They all need firstly setting up
> proper nr_hugepages and hugepage-mmap need to mount hugetlbfs. So I add a shell
> script run_vmtests to do such work which will call the three test programs and
> check the return value of them.
> 
> Changes to original code including below:
> a. add run_vmtests script
> b. return error when read_bytes mismatch with writed bytes.
> c. coding style fixes: do not use assignment in if condition
> 
> [v1 -> v2]:
> 1. [akpm:] rebased on runing make run_tests from Makefile
> 2. [akpm:] rename test script from run_test ro run_vmtests
> 2. fix a bug about shell exit code checking 
> 

So I tried to run this, from tools/testing/selftests.

a) The testing failed because ./vm's run_test target requires root. 

   We need to make a policy decision here.  Do we require that
   selftests run as root?  If not then the root-requiring selftests
   should warn and bail out without declaring a failure, so that those
   tests which can be run without root permissions can be successfully
   used.

b) When I ran the vm test, my machine went paralytically comatose
   for half a minute.  That's a bit rude - if all the selftests do this
   then the selftests become kinda useless.

c) I can run "make run_tests" in the top-lvel directory and all is
   well: the tools in ./vm get compiled first.  But when I do "make
   clean ; cd vm ; make run-tests" it fails, because vm/Makefile
   doesn't build the targets before trying to run them.

   This can be fixed with

--- a/tools/testing/selftests/vm/Makefile~a
+++ a/tools/testing/selftests/vm/Makefile
@@ -7,7 +7,7 @@ all: hugepage-mmap hugepage-shm  map_hug
 %: %.c
 	$(CC) $(CFLAGS) -o $@ $^
 
-run_tests:
+run_tests: all
 	/bin/sh ./run_vmtests
 
 clean:

   But this is unpleasing: a top-level "make run_tests" will end up
   trying to compile the targets twice.

   We could change the top-level Makefile to a single-pass thing
   which just descends into the subdirectories and runs "make
   run_tests".  But that gives us no way of compiling everything
   without also running everything.  That's a huge PITA if running
   everything sends your machine comatose for half a minute!

   So I think I'll go with the above patch.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Dave Young <dyoung@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	xiyou.wangcong@gmail.com, penberg@kernel.org,
	fengguang.wu@intel.com, cl@linux.com,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: Re: [PATCH 3/3 v2] move hugepage test examples to tools/testing/selftests/vm
Date: Thu, 9 Feb 2012 15:03:16 -0800	[thread overview]
Message-ID: <20120209150316.15be9361.akpm@linux-foundation.org> (raw)
In-Reply-To: <20120209014622.GA5143@darkstar.nay.redhat.com>

On Thu, 9 Feb 2012 09:46:22 +0800
Dave Young <dyoung@redhat.com> wrote:

> Andrew, updated the patch as below, is it ok to you?
> ---
> 
> hugepage-mmap.c, hugepage-shm.c and map_hugetlb.c in Documentation/vm are
> simple pass/fail tests, It's better to promote them to tools/testing/selftests
> 
> Thanks suggestion of Andrew Morton about this. They all need firstly setting up
> proper nr_hugepages and hugepage-mmap need to mount hugetlbfs. So I add a shell
> script run_vmtests to do such work which will call the three test programs and
> check the return value of them.
> 
> Changes to original code including below:
> a. add run_vmtests script
> b. return error when read_bytes mismatch with writed bytes.
> c. coding style fixes: do not use assignment in if condition
> 
> [v1 -> v2]:
> 1. [akpm:] rebased on runing make run_tests from Makefile
> 2. [akpm:] rename test script from run_test ro run_vmtests
> 2. fix a bug about shell exit code checking 
> 

So I tried to run this, from tools/testing/selftests.

a) The testing failed because ./vm's run_test target requires root. 

   We need to make a policy decision here.  Do we require that
   selftests run as root?  If not then the root-requiring selftests
   should warn and bail out without declaring a failure, so that those
   tests which can be run without root permissions can be successfully
   used.

b) When I ran the vm test, my machine went paralytically comatose
   for half a minute.  That's a bit rude - if all the selftests do this
   then the selftests become kinda useless.

c) I can run "make run_tests" in the top-lvel directory and all is
   well: the tools in ./vm get compiled first.  But when I do "make
   clean ; cd vm ; make run-tests" it fails, because vm/Makefile
   doesn't build the targets before trying to run them.

   This can be fixed with

--- a/tools/testing/selftests/vm/Makefile~a
+++ a/tools/testing/selftests/vm/Makefile
@@ -7,7 +7,7 @@ all: hugepage-mmap hugepage-shm  map_hug
 %: %.c
 	$(CC) $(CFLAGS) -o $@ $^
 
-run_tests:
+run_tests: all
 	/bin/sh ./run_vmtests
 
 clean:

   But this is unpleasing: a top-level "make run_tests" will end up
   trying to compile the targets twice.

   We could change the top-level Makefile to a single-pass thing
   which just descends into the subdirectories and runs "make
   run_tests".  But that gives us no way of compiling everything
   without also running everything.  That's a huge PITA if running
   everything sends your machine comatose for half a minute!

   So I think I'll go with the above patch.


  reply	other threads:[~2012-02-09 23:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-05  8:15 [PATCH 3/3] move hugepage test examples to tools/testing/selftests/vm Dave Young
2012-02-05  8:15 ` Dave Young
2012-02-06 23:53 ` Andrew Morton
2012-02-06 23:53   ` Andrew Morton
2012-02-07  1:31   ` Dave Young
2012-02-07  1:31     ` Dave Young
2012-02-08  3:40   ` [PATCH] selftests: Launch individual selftests from the main Makefile Frederic Weisbecker
2012-02-08  3:40     ` Frederic Weisbecker
2012-02-08 14:45     ` Christoph Lameter
2012-02-08 14:45       ` Christoph Lameter
2012-02-08 15:38       ` Frederic Weisbecker
2012-02-08 15:38         ` Frederic Weisbecker
2012-02-08 23:20     ` Andrew Morton
2012-02-08 23:20       ` Andrew Morton
2012-02-08 23:57       ` Frederic Weisbecker
2012-02-08 23:57         ` Frederic Weisbecker
2012-02-09  1:46   ` [PATCH 3/3 v2] move hugepage test examples to tools/testing/selftests/vm Dave Young
2012-02-09  1:46     ` Dave Young
2012-02-09 23:03     ` Andrew Morton [this message]
2012-02-09 23:03       ` Andrew Morton
2012-02-10  3:01       ` Dave Young
2012-02-10  3:01         ` Dave Young
2012-02-07  1:32 ` [PATCH 3/3] " Dave Young
2012-02-07  1:32   ` Dave Young

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120209150316.15be9361.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=dyoung@redhat.com \
    --cc=fengguang.wu@intel.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.