Hi,

I test LTP in arm, cortex-a9 which is 4 core system, and find that the mmap1
of memtest06, failed. when I check the LTP mail list and find this patch
http://www.mail-archive.com/[email protected]/msg10706.html
however, when I apply this patch, I can still see the same problem but with
less frequency. It looks like the write process and read process are running
on different core, when write process unmap and remap the address, and the
other process is read at the same time.

So any suggestions?

Regards,

Hake

2011/8/16 <[email protected]>

> Send Ltp-list mailing list submissions to
>        [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://lists.sourceforge.net/lists/listinfo/ltp-list
> or, via email, send a message with subject or body 'help' to
>        [email protected]
>
> You can reach the person managing the list at
>        [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Ltp-list digest..."
>
>
> Today's Topics:
>
>   1.  [PATCH 4/6] hugemmap02.c (tangchen)
>   2.  [PATCH 5/6] hugemmap03.c (tangchen)
>   3.  [PATCH 6/6] hugemmap04.c (tangchen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 16 Aug 2011 16:02:23 +0800
> From: tangchen <[email protected]>
> Subject: [LTP]  [PATCH 4/6] hugemmap02.c
> To: Cyril Hrubis <[email protected]>, Garrett Cooper
>        <[email protected]>
> Cc: "[email protected]" <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Signed-off-by: Tang Chen <[email protected]>
> ---
>  testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c |   47
> +++++++-------------
>  1 files changed, 16 insertions(+), 31 deletions(-)
>
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
> b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
> index 45cddf7..3bbbc46 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c
> @@ -63,6 +63,7 @@
>  #include "test.h"
>  #include "usctest.h"
>  #include "system_specific_hugepages_info.h"
> +#include "libmnt.h"
>
>  #define LOW_ADDR       (void *)(0x80000000)
>  #define LOW_ADDR2      (void *)(0x90000000)
> @@ -77,38 +78,17 @@ unsigned long *addrlist[5]; /* list of addresses of
> memory mapped region */
>  int i;
>  int fildes;                    /* file descriptor for tempfile */
>  int nfildes;                   /* file descriptor for /dev/zero */
> -char *Hopt;                     /* location of hugetlbfs */
> +char *mount_point = NULL;
>
> -void setup();                  /* Main setup function of test */
> -void cleanup();                        /* cleanup function for the test */
> -
> -void help()
> -{
> -       printf("  -H /..  Location of hugetlbfs, i.e. -H /var/hugetlbfs
> \n");
> -}
> +void setup(void);                      /* Main setup function of test */
> +void cleanup(void);                    /* cleanup function for the test */
>
>  int
>  main(int ac, char **av)
>  {
>        int lc;
> -       char *msg;
> -        int Hflag = 0;
>        int page_sz, map_sz;
>
> -               option_t options[] = {
> -               { "H:",   &Hflag, &Hopt },    /* Required for location of
> hugetlbfs */
> -               { NULL, NULL, NULL }          /* NULL required to end array
> */
> -               };
> -
> -       /* Parse standard options given to run the test. */
> -       if ((msg = parse_opts(ac, av, options, &help)) != NULL)
> -               tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s, use
> -help", msg);
> -
> -       if (Hflag == 0) {
> -               tst_brkm(TBROK, NULL,
> -                   "-H option is REQUIRED for this test, use -h for
> options help");
> -       }
> -
>        page_sz = getpagesize();
>        map_sz = 2 * 1024 * hugepages_size();
>
> @@ -206,15 +186,20 @@ main(int ac, char **av)
>  *          Write some known data into file and get the size of the file.
>  */
>  void
> -setup()
> +setup(void)
>  {
> -       tst_tmpdir();
> -
> -       snprintf(TEMPFILE, sizeof(TEMPFILE), "%s/mmapfile%d", Hopt,
> getpid());
> -
> +       tst_require_root(NULL);
>        tst_sig(FORK, DEF_HANDLER, cleanup);
>
>        TEST_PAUSE;
> +
> +       tst_tmpdir();
> +       mount_point = get_tst_tmpdir();
> +
> +       mount_hugetlbfs(mount_point);
> +       hugepage_alloc(1024);
> +
> +       snprintf(TEMPFILE, sizeof(TEMPFILE), "%s/mmapfile%d", mount_point,
> getpid());
>  }
>
>  /*
> @@ -223,7 +208,7 @@ setup()
>  *            Remove the temporary directory created.
>  */
>  void
> -cleanup()
> +cleanup(void)
>  {
>        /*
>         * print timing stats if that option was specified.
> @@ -231,6 +216,6 @@ cleanup()
>        TEST_CLEANUP;
>
>        unlink(TEMPFILE);
> -
> +       umount_hugetlbfs(mount_point);
>        tst_rmdir();
>  }
> --
> 1.7.1
>
> --
> Best Regards,
> Tang chen
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: 0004-hugemmap02.c-Automatically-mount-hugetlbfs-on-huge.patch
>
> ------------------------------
>
> Message: 2
> Date: Tue, 16 Aug 2011 16:03:25 +0800
> From: tangchen <[email protected]>
> Subject: [LTP]  [PATCH 5/6] hugemmap03.c
> To: Cyril Hrubis <[email protected]>, Garrett Cooper
>        <[email protected]>
> Cc: "[email protected]" <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Signed-off-by: Tang Chen <[email protected]>
> ---
>  testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c |   66
> ++++++++------------
>  1 files changed, 26 insertions(+), 40 deletions(-)
>
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
> b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
> index cac94b0..b17b19d 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c
> @@ -54,54 +54,31 @@
>  #include "test.h"
>  #include "usctest.h"
>  #include "system_specific_hugepages_info.h"
> +#include "libmnt.h"
>
>  #define HIGH_ADDR      (void *)(0x1000000000000)
>
> -char* TEMPFILE="mmapfile";
> +char TEMPFILE[MAXPATHLEN];
>
>  char *TCID="hugemmap03";       /* Test program identifier.    */
>  int TST_TOTAL=1;               /* Total number of test cases. */
>  unsigned long *addr;           /* addr of memory mapped region */
>  int fildes;                    /* file descriptor for tempfile */
> -char *Hopt;                     /* location of hugetlbfs */
> +char *mount_point = NULL;
>
> -void setup();                  /* Main setup function of test */
> -void cleanup();                        /* cleanup function for the test */
> -
> -void help()
> -{
> -       printf("  -H /..  Location of hugetlbfs, i.e. -H /var/hugetlbfs
> \n");
> -}
> +void setup(void);                      /* Main setup function of test */
> +void cleanup(void);                    /* cleanup function for the test */
>
>  int
>  main(int ac, char **av)
>  {
>        int lc;                 /* loop counter */
> -       char *msg;              /* message returned from parse_opts */
> -        int Hflag=0;              /* binary flag: opt or not */
>        int page_sz;
>
>  #if __WORDSIZE==32  /* 32-bit compiled */
>        tst_brkm(TCONF, NULL, "This test is only for 64bit");
>  #endif
>
> -               option_t options[] = {
> -               { "H:",   &Hflag, &Hopt },    /* Required for location of
> hugetlbfs */
> -               { NULL, NULL, NULL }          /* NULL required to end array
> */
> -               };
> -
> -       /* Parse standard options given to run the test. */
> -       msg = parse_opts(ac, av, options, &help);
> -       if (msg != (char *) NULL) {
> -               tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s, use
> -help", msg);
> -               tst_exit();
> -       }
> -
> -       if (Hflag == 0) {
> -               tst_brkm(TBROK, NULL, "-H option is REQUIRED for this test,
> use -h for options help");
> -               tst_exit();
> -       }
> -
>        page_sz = getpagesize();
>
>        setup();
> @@ -122,8 +99,15 @@ main(int ac, char **av)
>                addr = mmap(HIGH_ADDR, page_sz, PROT_READ,
>                            MAP_SHARED | MAP_FIXED, fildes, 0);
>                if (addr != MAP_FAILED) {
> -                       tst_resm(TFAIL, "Normal mmap() into high region
> unexpectedly succeeded on %s, errno=%d : %s",
> -                                TEMPFILE, errno, strerror(errno));
> +                       tst_resm(TFAIL|TERRNO, "Normal mmap() into high
> region unexpectedly "
> +                               "succeeded on %s",
> +                               TEMPFILE);
> +
> +                       /* Unmap the mapped memory */
> +                       if (munmap(addr, page_sz) != 0) {
> +                               tst_brkm(TFAIL|TERRNO, NULL, "munmap()
> fails to unmap the "
> +                                       "memory");
> +                       }
>                        continue;
>                } else {
>                        tst_resm(TPASS, "Normal mmap() into high region
> failed correctly");
> @@ -132,7 +116,6 @@ main(int ac, char **av)
>
>                close(fildes);
>        }
> -
>        cleanup();
>
>        tst_exit();
> @@ -149,18 +132,20 @@ main(int ac, char **av)
>  *          Write some known data into file and get the size of the file.
>  */
>  void
> -setup()
> +setup(void)
>  {
> -       char mypid[40];
> -
> -       sprintf(mypid,"/%d",getpid());
> -       TEMPFILE=strcat(mypid,TEMPFILE);
> -       TEMPFILE=strcat(Hopt,TEMPFILE);
> -
> +       tst_require_root(NULL);
>        tst_sig(FORK, DEF_HANDLER, cleanup);
>
>        TEST_PAUSE;
>
> +       tst_tmpdir();
> +       mount_point = get_tst_tmpdir();
> +
> +       mount_hugetlbfs(mount_point);
> +       hugepage_alloc(1024);
> +
> +       snprintf(TEMPFILE, sizeof(TEMPFILE), "%s/mmapfile%d", mount_point,
> getpid());
>  }
>
>  /*
> @@ -169,7 +154,7 @@ setup()
>  *            Remove the temporary directory created.
>  */
>  void
> -cleanup()
> +cleanup(void)
>  {
>        /*
>         * print timing stats if that option was specified.
> @@ -177,5 +162,6 @@ cleanup()
>        TEST_CLEANUP;
>
>        unlink(TEMPFILE);
> -
> +       umount_hugetlbfs(mount_point);
> +       tst_rmdir();
>  }
> --
> 1.7.1
>
> --
> Best Regards,
> Tang chen
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: 0005-hugemmap03.c-Automatically-mount-hugetlbfs-on-huge.patch
>
> ------------------------------
>
> Message: 3
> Date: Tue, 16 Aug 2011 16:04:10 +0800
> From: tangchen <[email protected]>
> Subject: [LTP]  [PATCH 6/6] hugemmap04.c
> To: Cyril Hrubis <[email protected]>, Garrett Cooper
>        <[email protected]>
> Cc: "[email protected]" <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Signed-off-by: Tang Chen <[email protected]>
> ---
>  testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c |   52
> ++++++--------------
>  1 files changed, 16 insertions(+), 36 deletions(-)
>
> diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
> b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
> index 4cc6ed4..9774e87 100644
> --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c
> @@ -73,10 +73,11 @@
>  #include "test.h"
>  #include "usctest.h"
>  #include "system_specific_hugepages_info.h"
> +#include "libmnt.h"
>
>  #define BUFFER_SIZE  256
>
> -char* TEMPFILE="mmapfile";
> +char TEMPFILE[MAXPATHLEN];
>
>  char *TCID="hugemmap04";       /* Test program identifier.    */
>  int TST_TOTAL=1;               /* Total number of test cases. */
> @@ -87,41 +88,17 @@ int freepages=0;            /* Amount of free huge
> pages to use for testing */
>  int beforetest=0;              /* Amount of free huge pages before testing
> */
>  int aftertest=0;               /* Amount of free huge pages after testing
> */
>  int hugepagesmapped=0;         /* Amount of huge pages mapped after
> testing */
> -char *Hopt;                     /* location of hugetlbfs */
> +char *mount_point = NULL;
>
> -void setup();                  /* Main setup function of test */
> -void cleanup();                        /* cleanup function for the test */
> -
> -void help()
> -{
> -       printf("  -H /..  Location of hugetlbfs, i.e. -H /var/hugetlbfs
> \n");
> -}
> +void setup(void);                      /* Main setup function of test */
> +void cleanup(void);                    /* cleanup function for the test */
>
>  int
>  main(int ac, char **av)
>  {
>        int lc;                 /* loop counter */
> -       char *msg;              /* message returned from parse_opts */
> -        int Hflag=0;              /* binary flag: opt or not */
>        int huge_pagesize=0;
>
> -               option_t options[] = {
> -               { "H:",   &Hflag, &Hopt },    /* Required for location of
> hugetlbfs */
> -               { NULL, NULL, NULL }          /* NULL required to end array
> */
> -               };
> -
> -       /* Parse standard options given to run the test. */
> -       msg = parse_opts(ac, av, options, &help);
> -       if (msg != (char *) NULL) {
> -               tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s, use
> -help", msg);
> -               tst_exit();
> -       }
> -
> -       if (Hflag == 0) {
> -               tst_brkm(TBROK, NULL, "-H option is REQUIRED for this test,
> use -h for options help");
> -               tst_exit();
> -       }
> -
>        /* Check number of hugepages */
>        if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0)
>                tst_brkm(TCONF, cleanup, "Not enough available Hugepages");
> @@ -151,7 +128,7 @@ main(int ac, char **av)
>                tst_resm(TINFO,"Total amount of free huge pages is
> %d",freepages);
>                tst_resm(TINFO,"Max number allowed for 1 mmap file in
> 32-bits is 128");
>                if (freepages > 128)
> -                 freepages=128;
> +                       freepages=128;
>  #endif
>                /*
>                 * Call mmap
> @@ -206,16 +183,18 @@ main(int ac, char **av)
>  void
>  setup()
>  {
> -       char mypid[40];
> -
> -       sprintf(mypid,"/%d",getpid());
> -       TEMPFILE=strcat(mypid,TEMPFILE);
> -       TEMPFILE=strcat(Hopt,TEMPFILE);
> -
> +       tst_require_root(NULL);
>        tst_sig(FORK, DEF_HANDLER, cleanup);
>
>        TEST_PAUSE;
>
> +       tst_tmpdir();
> +       mount_point = get_tst_tmpdir();
> +
> +       mount_hugetlbfs(mount_point);
> +       hugepage_alloc(1024);
> +
> +       snprintf(TEMPFILE, sizeof(TEMPFILE), "%s/mmapfile%d", mount_point,
> getpid());
>  }
>
>  /*
> @@ -232,5 +211,6 @@ cleanup()
>        TEST_CLEANUP;
>
>        unlink(TEMPFILE);
> -
> +       umount_hugetlbfs(mount_point);
> +       tst_rmdir();
>  }
> --
> 1.7.1
>
> --
> Best Regards,
> Tang chen
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: 0006-hugemmap04.c-Automatically-mount-hugetlbfs-on-huge.patch
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> uberSVN's rich system and user administration capabilities and model
> configuration take the hassle out of deploying and managing Subversion and
> the tools developers use with it. Learn more about uberSVN and get a free
> download at:  http://p.sf.net/sfu/wandisco-dev2dev
>
>
> ------------------------------
>
> _______________________________________________
> Ltp-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
>
> End of Ltp-list Digest, Vol 63, Issue 22
> ****************************************
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to