public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable
@ 2023-01-11  9:13 Petr Vorel
  2023-01-16 10:53 ` Richard Palethorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2023-01-11  9:13 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

local iteration variable in worker() was probably left over from
previous version before rewrite because clang correctly reported also on
this old version:

    aio-stress.c:1049:6: warning: variable 'iteration' set but not used [-Wunused-but-set-variable]
    int iteration = 0;

NOTE: restart label was considered to be removed, but in the end kept.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Changes v2->v3:
* Keep restart label (remove only the variable)

 testcases/kernel/io/ltp-aiodio/aio-stress.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c
index d84d5a0741..5c3a0a3a49 100644
--- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
+++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
@@ -1039,7 +1039,6 @@ static int *worker(struct thread_info *t)
 	char *this_stage = NULL;
 	struct timeval stage_time;
 	int status = 0;
-	int iteration = 0;
 	int cnt;
 
 	aio_setup(&t->io_ctx, 512);
@@ -1116,10 +1115,8 @@ restart:
 	}
 
 	/* someone got restarted, go back to the beginning */
-	if (t->active_opers && cnt < iterations) {
-		iteration++;
+	if (t->active_opers && cnt < iterations)
 		goto restart;
-	}
 
 	/* finally, free all the ram */
 	while (t->finished_opers) {
-- 
2.39.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable
  2023-01-11  9:13 [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable Petr Vorel
@ 2023-01-16 10:53 ` Richard Palethorpe
  2023-01-16 16:20   ` Petr Vorel
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Palethorpe @ 2023-01-16 10:53 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hello,

I have merged this and my/Petr's aiocp patches.

Petr I'm not sure what motivated some of these changes? Although clearly
the code was incorrect, I don't see the test failures in OpenQA?

Petr Vorel <pvorel@suse.cz> writes:

> local iteration variable in worker() was probably left over from
> previous version before rewrite because clang correctly reported also on
> this old version:
>
>     aio-stress.c:1049:6: warning: variable 'iteration' set but not used [-Wunused-but-set-variable]
>     int iteration = 0;
>
> NOTE: restart label was considered to be removed, but in the end kept.
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Changes v2->v3:
> * Keep restart label (remove only the variable)
>
>  testcases/kernel/io/ltp-aiodio/aio-stress.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/testcases/kernel/io/ltp-aiodio/aio-stress.c b/testcases/kernel/io/ltp-aiodio/aio-stress.c
> index d84d5a0741..5c3a0a3a49 100644
> --- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
> +++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
> @@ -1039,7 +1039,6 @@ static int *worker(struct thread_info *t)
>  	char *this_stage = NULL;
>  	struct timeval stage_time;
>  	int status = 0;
> -	int iteration = 0;
>  	int cnt;
>  
>  	aio_setup(&t->io_ctx, 512);
> @@ -1116,10 +1115,8 @@ restart:
>  	}
>  
>  	/* someone got restarted, go back to the beginning */
> -	if (t->active_opers && cnt < iterations) {
> -		iteration++;
> +	if (t->active_opers && cnt < iterations)
>  		goto restart;
> -	}
>  
>  	/* finally, free all the ram */
>  	while (t->finished_opers) {


-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable
  2023-01-16 10:53 ` Richard Palethorpe
@ 2023-01-16 16:20   ` Petr Vorel
  2023-01-17 13:57     ` Richard Palethorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2023-01-16 16:20 UTC (permalink / raw)
  To: Richard Palethorpe; +Cc: ltp

Hi Richie, all,

> Hello,

> I have merged this and my/Petr's aiocp patches.
Thanks!

> Petr I'm not sure what motivated some of these changes? Although clearly
> the code was incorrect, I don't see the test failures in OpenQA?

These tests fail on by default on distros with /tmp using tmpfs
(e.g. openSUSE by default and likely many other distros).

We test them on openSUSE with TMPDIR set to folder on Btrfs.

Also I wonder if run aio-stress or other of aio/aiodio tests with
.all_filesystems = 1 (filter out MS filesystems - run only normal Linux
filesystems).

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable
  2023-01-16 16:20   ` Petr Vorel
@ 2023-01-17 13:57     ` Richard Palethorpe
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Palethorpe @ 2023-01-17 13:57 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

Hello,

Petr Vorel <pvorel@suse.cz> writes:

> Hi Richie, all,
>
>> Hello,
>
>> I have merged this and my/Petr's aiocp patches.
> Thanks!
>
>> Petr I'm not sure what motivated some of these changes? Although clearly
>> the code was incorrect, I don't see the test failures in OpenQA?
>
> These tests fail on by default on distros with /tmp using tmpfs
> (e.g. openSUSE by default and likely many other distros).
>
> We test them on openSUSE with TMPDIR set to folder on Btrfs.
>
> Also I wonder if run aio-stress or other of aio/aiodio tests with
> .all_filesystems = 1 (filter out MS filesystems - run only normal Linux
> filesystems).

Sigh, I suppose so. In fact testing on tmpfs will have very limited
coverage. all_filesystems is more or less a requirement for I/O tests.

>
> Kind regards,
> Petr


-- 
Thank you,
Richard.

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-17 14:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-11  9:13 [LTP] [PATCH v3 1/1] aio-stress.c: Remove useless iteration variable Petr Vorel
2023-01-16 10:53 ` Richard Palethorpe
2023-01-16 16:20   ` Petr Vorel
2023-01-17 13:57     ` Richard Palethorpe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox