All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xiao Yang <yangx.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH] read_all: give more time to wait children finish read action
Date: Mon, 9 Apr 2018 14:56:08 +0800	[thread overview]
Message-ID: <5ACB0E88.60607@cn.fujitsu.com> (raw)
In-Reply-To: <1523092180-5365-1-git-send-email-liwang@redhat.com>

On 2018/04/07 17:09, Li Wang wrote:
> 1. Some children are still working on the read I/O but parent trys to
> stopping them after visit_dir() immediately. Although the stop_attemps
> is 65535, it still sometimes fails, so we get the following worker
> stalled messges in test.
Hi Li,

I got the same message on RHEL6.9Alpha as well, and this patch looks good to me.

Thanks,
Xiao Yang.

>   # uname -rm
>     4.16.0-rc7 ppc64
>   # ./read_all -d /sys -q -r 10
>     tst_test.c:987: INFO: Timeout per run is 0h 05m 00s
>     read_all.c:280: BROK: Worker 26075 is stalled
>     read_all.c:280: WARN: Worker 26075 is stalled
>     read_all.c:280: WARN: Worker 26079 is stalled
>     read_all.c:280: WARN: Worker 26087 is stalled
>
> 2. The sched_work() push action in a infinite loop, here I propose to let
> it in limited times.
>
> Signed-off-by: Li Wang<liwang@redhat.com>
> ---
>   testcases/kernel/fs/read_all/read_all.c | 10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
> index b7ed540..ab206e7 100644
> --- a/testcases/kernel/fs/read_all/read_all.c
> +++ b/testcases/kernel/fs/read_all/read_all.c
> @@ -280,6 +280,7 @@ static void stop_workers(void)
>   						workers[i].pid);
>   					break;
>   				}
> +				usleep(100);
>   			}
>   		}
>   	}
> @@ -306,9 +307,12 @@ static void sched_work(const char *path)
>   		if (pushed)
>   			break;
>
> -		if (++push_attempts>  worker_count) {
> -			usleep(100);
> -			push_attempts = 0;
> +		usleep(100);
> +		if (++push_attempts>  0xffff) {
> +			tst_brk(TBROK,
> +				"Attempts %d times but still failed to push %s",
> +				push_attempts, path);
> +			break;
>   		}
>   	}
>   }




  reply	other threads:[~2018-04-09  6:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07  9:09 [LTP] [RFC PATCH] read_all: give more time to wait children finish read action Li Wang
2018-04-09  6:56 ` Xiao Yang [this message]
2018-04-09  7:43 ` Richard Palethorpe
2018-04-09  9:22   ` Li Wang
2018-04-09 10:55     ` Richard Palethorpe
2018-04-09 11:11       ` Cyril Hrubis
2018-04-09 12:19         ` Richard Palethorpe
2018-04-09 13:00           ` Cyril Hrubis
2018-04-11  9:26           ` Li Wang
2018-04-11  9:15       ` Li Wang

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=5ACB0E88.60607@cn.fujitsu.com \
    --to=yangx.jy@cn.fujitsu.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 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.