From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] dma_thread_diotest: Correct the number of running workers
Date: Fri, 3 Jun 2016 05:24:34 -0400 (EDT) [thread overview]
Message-ID: <2014219793.2541042.1464945874769.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20160602135831.GA31858@localhost.localdomain>
----- Original Message -----
> From: "Dong Zhu" <bluezhudong@gmail.com>
> To: ltp@lists.linux.it
> Sent: Thursday, 2 June, 2016 3:58:31 PM
> Subject: [LTP] [PATCH] dma_thread_diotest: Correct the number of running workers
>
> This test will cause Segmentation fault (core dumped) in a
> system with 20 CPUs and memory PAGESIZE is 64KB.
> Because for a 1MB buffer which could admit 1MB/PAGESIZE
> workers at most.
>
> So the purpose of this patch is correcting the number
> of running workers in terms of actual PAGESIZE.
>
> Signed-off-by: Dong Zhu <bluezhudong@gmail.com>
I have slightly modified commit log and pushed.
Thanks,
Jan
> ---
> testcases/kernel/io/direct_io/dma_thread_diotest.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/testcases/kernel/io/direct_io/dma_thread_diotest.c
> b/testcases/kernel/io/direct_io/dma_thread_diotest.c
> index 39cf658..5f52dcc 100644
> --- a/testcases/kernel/io/direct_io/dma_thread_diotest.c
> +++ b/testcases/kernel/io/direct_io/dma_thread_diotest.c
> @@ -113,10 +113,10 @@
> #define DIR_MODE (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
> S_IXGRP|S_IROTH|S_IXOTH)
> #define FILECOUNT 100
> -#define MIN_WORKERS 2
> -#define MAX_WORKERS 256
> #define PATTERN (0xfa)
> #define PAGE_SIZE getpagesize()
> +#define MIN_WORKERS 2
> +#define MAX_WORKERS (READSIZE/PAGE_SIZE)
>
> char *TCID = "dma_thread_diotest";
> int TST_TOTAL = 1;
> @@ -229,6 +229,8 @@ int main(int argc, char *argv[])
> int i, lc;
>
> workers = sysconf(_SC_NPROCESSORS_ONLN);
> + if (workers > MAX_WORKERS)
> + workers = MAX_WORKERS;
> tst_parse_opts(argc, argv, options, help);
>
> setup();
> @@ -439,6 +441,6 @@ static void cleanup(void)
> static void help(void)
> {
> printf("-a align read buffer to offset <alignment>.\n");
> - printf("-w number of worker threads, 2 (default) to 256,"
> - " defaults to number of cores.\n");
> + printf("-w number of worker threads, 2 (default) to %d,"
> + " defaults to number of cores.\n", MAX_WORKERS);
> }
> --
> 2.1.0
>
>
> --
> Best Regards,
> Dong Zhu
>
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
>
prev parent reply other threads:[~2016-06-03 9:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 13:58 [LTP] [PATCH] dma_thread_diotest: Correct the number of running workers Dong Zhu
2016-06-03 9:24 ` Jan Stancek [this message]
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=2014219793.2541042.1464945874769.JavaMail.zimbra@redhat.com \
--to=jstancek@redhat.com \
--cc=ltp@lists.linux.it \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox