Skip to contentSkip to conversation

aiodio: Skip tests on tmpfs

PATCH Superseded Petr Vorel 4 participants 13 messages Jan 21, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 aiodio: Skip tests on tmpfs

tmpfs does not support it.

---
 testcases/kernel/io/ltp-aiodio/aiodio_append.c | 10 ++++++++--
 testcases/kernel/io/ltp-aiodio/dio_append.c    |  4 ++++
 testcases/kernel/io/ltp-aiodio/dio_read.c      |  4 ++++
 testcases/kernel/io/ltp-aiodio/dio_sparse.c    | 10 ++++++++--
 testcases/kernel/io/ltp-aiodio/dio_truncate.c  | 10 ++++++++--
 5 files changed, 32 insertions(+), 6 deletions(-)
testcases/kernel/io/ltp-aiodio/aiodio_append.c +8 -2
index cb04b04a57..46cc74ee4e 100644
@@ -131,8 +131,10 @@ static void setup(void)
 
 static void cleanup(void)
 {
-	*run_child = 0;
-	SAFE_MUNMAP(run_child, sizeof(int));
+	if (run_child) {
+		*run_child = 0;
+		SAFE_MUNMAP(run_child, sizeof(int));
+	}
 }
 
 static void run(void)
@@ -177,6 +179,10 @@ static struct tst_test test = {
 		{"b:", &str_numaio, "Number of async IO blocks (default 16)"},
 		{}
 	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
 };
 #else
 TST_TEST_TCONF("test requires libaio and its development packages");
testcases/kernel/io/ltp-aiodio/dio_append.c +4 -0
index 59fd710e70..c099793f6c 100644
@@ -93,4 +93,8 @@ static struct tst_test test = {
 		{"c:", &str_appends, "Number of appends (default 1000)"},
 		{}
 	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
 };
testcases/kernel/io/ltp-aiodio/dio_read.c +4 -0
index 2c2ec4bce0..67a28147fd 100644
@@ -177,4 +177,8 @@ static struct tst_test test = {
 		{"s:", &str_filesize, "File size (default 128M)"},
 		{}
 	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
 };
testcases/kernel/io/ltp-aiodio/dio_sparse.c +8 -2
index 4ee2fbab18..39fc895d65 100644
@@ -83,8 +83,10 @@ static void setup(void)
 
 static void cleanup(void)
 {
-	*run_child = 0;
-	SAFE_MUNMAP(run_child, sizeof(int));
+	if (run_child) {
+		*run_child = 0;
+		SAFE_MUNMAP(run_child, sizeof(int));
+	}
 }
 
 static void run(void)
@@ -129,4 +131,8 @@ static struct tst_test test = {
 		{"o:", &str_offset, "File offset (default 0)"},
 		{}
 	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
 };
testcases/kernel/io/ltp-aiodio/dio_truncate.c +8 -2
index 4bf11c9588..1fbf83de06 100644
@@ -107,8 +107,10 @@ static void setup(void)
 
 static void cleanup(void)
 {
-	*run_child = 0;
-	SAFE_MUNMAP(run_child, sizeof(int));
+	if (run_child) {
+		*run_child = 0;
+		SAFE_MUNMAP(run_child, sizeof(int));
+	}
 }
 
 static void run(void)
@@ -163,4 +165,8 @@ static struct tst_test test = {
 		{"c:", &str_numwrites, "Number of append & truncate (default 100)"},
 		{}
 	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
 };
Signature · 5 lines
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#1 lore raw

Hi all,

[Cc Li ]

Quoted 1 line

tmpfs does not support it.

Verifying with .all_filesystems, that only tmpfs is problematic
- tested on exfat, ntfs over FUSE, vfat (common linux filesystems obviously work)

That's why I avoided opening file with O_DIRECT in setup().

BTW I wonder what is the reason of duplicate entries in ltp-aiodio.part4? i.e. dio_sparse, aiodio_append, dio_append, dio_truncate... To create bigger load?

IMHO it'd make sense to run at least one test on .all_filesystems to check more filesystems (dio_append seems to be quick), but I wouldn't done it when there are duplicate entries.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi!

Quoted 6 lines
Quoted 1 line

tmpfs does not support it.

Verifying with .all_filesystems, that only tmpfs is problematic
- tested on exfat, ntfs over FUSE, vfat (common linux filesystems obviously work)

That's why I avoided opening file with O_DIRECT in setup().

Quoted 7 lines

BTW I wonder what is the reason of duplicate entries in ltp-aiodio.part4? i.e. dio_sparse, aiodio_append, dio_append, dio_truncate... To create bigger load?

IMHO it'd make sense to run at least one test on .all_filesystems to check more filesystems (dio_append seems to be quick), but I wouldn't done it when there are duplicate entries.

Historicall mess I guess. We will clean that up in the next development cycle.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
In reply to Petr Vorel

Hi!

Quoted 5 lines · Petr Vorel

Hi all,

[Cc Li ]

Quoted 1 line

tmpfs does not support it.

Quoted 8 lines

Verifying with .all_filesystems, that only tmpfs is problematic
- tested on exfat, ntfs over FUSE, vfat (common linux filesystems obviously work)

That's why I avoided opening file with O_DIRECT in setup().

BTW I wonder what is the reason of duplicate entries in ltp-aiodio.part4? i.e. dio_sparse, aiodio_append, dio_append, dio_truncate... To create bigger load?

To duplicate entries in ltp-aiodio.part4 doesn't make much sense and I perfectly agree with you. Once the aiodio testing suite is finished, we do need to change runtest file in order to have multiple scenarios with different files/buffers size with a different number of sub-processes.

Quoted 8 lines

IMHO it'd make sense to run at least one test on .all_filesystems to check more filesystems (dio_append seems to be quick), but I wouldn't done it when there are duplicate entries.

Kind regards,
Petr

Signature · 2 lines
-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
In reply to Petr Vorel

Hi!

Quoted 16 lines · Petr Vorel

tmpfs does not support it.

---
  testcases/kernel/io/ltp-aiodio/aiodio_append.c | 10 ++++++++--
  testcases/kernel/io/ltp-aiodio/dio_append.c    |  4 ++++
  testcases/kernel/io/ltp-aiodio/dio_read.c      |  4 ++++
  testcases/kernel/io/ltp-aiodio/dio_sparse.c    | 10 ++++++++--
  testcases/kernel/io/ltp-aiodio/dio_truncate.c  | 10 ++++++++--
  5 files changed, 32 insertions(+), 6 deletions(-)
testcases/kernel/io/ltp-aiodio/aiodio_append.c +0 -0
index cb04b04a57..46cc74ee4e 100644

testcases/kernel/io/ltp-aiodio/aiodio_append.c static void setup(void) · line 136

Quoted 8 lines
testcases/kernel/io/ltp-aiodio/aiodio_append.c +3 -2
@@ -131,8 +131,10 @@ static void setup(void)
 
  static void cleanup(void)
  {
-	*run_child = 0;
-	SAFE_MUNMAP(run_child, sizeof(int));
+	if (run_child) {
+		*run_child = 0;
+		SAFE_MUNMAP(run_child, sizeof(int));

SAFE_MUNMAP should be called always, even if *run_child == 0 (which happens if run() completed successfully).

Quoted 85 lines
testcases/kernel/io/ltp-aiodio/aiodio_append.c +5 -0
+	}
  }
 
  static void run(void)
@@ -177,6 +179,10 @@ static struct tst_test test = {
  		{"b:", &str_numaio, "Number of async IO blocks (default 16)"},
  		{}
  	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
  };
  #else
  TST_TEST_TCONF("test requires libaio and its development packages");
testcases/kernel/io/ltp-aiodio/dio_append.c +4 -0
index 59fd710e70..c099793f6c 100644
@@ -93,4 +93,8 @@ static struct tst_test test = {
  		{"c:", &str_appends, "Number of appends (default 1000)"},
  		{}
  	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
  };
testcases/kernel/io/ltp-aiodio/dio_read.c +4 -0
index 2c2ec4bce0..67a28147fd 100644
@@ -177,4 +177,8 @@ static struct tst_test test = {
  		{"s:", &str_filesize, "File size (default 128M)"},
  		{}
  	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
  };
testcases/kernel/io/ltp-aiodio/dio_sparse.c +8 -2
index 4ee2fbab18..39fc895d65 100644
@@ -83,8 +83,10 @@ static void setup(void)
 
  static void cleanup(void)
  {
-	*run_child = 0;
-	SAFE_MUNMAP(run_child, sizeof(int));
+	if (run_child) {
+		*run_child = 0;
+		SAFE_MUNMAP(run_child, sizeof(int));
+	}
  }
 
  static void run(void)
@@ -129,4 +131,8 @@ static struct tst_test test = {
  		{"o:", &str_offset, "File offset (default 0)"},
  		{}
  	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
  };
testcases/kernel/io/ltp-aiodio/dio_truncate.c +4 -2
index 4bf11c9588..1fbf83de06 100644
@@ -107,8 +107,10 @@ static void setup(void)
 
  static void cleanup(void)
  {
-	*run_child = 0;
-	SAFE_MUNMAP(run_child, sizeof(int));
+	if (run_child) {
+		*run_child = 0;
+		SAFE_MUNMAP(run_child, sizeof(int));
+	}
  }
 
  static void run(void)

testcases/kernel/io/ltp-aiodio/dio_truncate.c static struct tst_test test = { · line 172

Quoted 8 lines
testcases/kernel/io/ltp-aiodio/dio_truncate.c +4 -0
@@ -163,4 +165,8 @@ static struct tst_test test = {
  		{"c:", &str_numwrites, "Number of append & truncate (default 100)"},
  		{}
  	},
+	.skip_filesystems = (const char *[]) {
+		"tmpfs",
+		NULL
+	},
  };

Kind regards,

Andrea

Signature · 2 lines
-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#5 lore raw

Hi!

Quoted 1 line

SAFE_MUNMAP should be called always, even if *run_child == 0 (which happens if run() completed successfully).

This is actually if (run_child) not if (*run_child) and it fixes the case where the test is skipped even before the run_child has been mmaped.

Signature · 5 lines
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#6 lore raw
Quoted 6 lines

Hi!

Quoted 1 line

SAFE_MUNMAP should be called always, even if *run_child == 0 (which happens if run() completed successfully).

This is actually if (run_child) not if (*run_child) and it fixes the case where the test is skipped even before the run_child has been mmaped.

Yes, that's needed for tmpfs.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author
#8 lore raw
Quoted 3 lines

Hi!
Looks good to me, but since we are right before release I would be more happier if this gets more than one review before it gets pushed.

Definitely. Li, Andrea, Martin, could you please have a look?

Kind regards,
Petr

Quoted 1 line
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#9 lore raw

It makes sense to avoid running tests using O_DIRECT on tmpfs, so patch looks good to me.

Quoted 9 lines · Petr Vorel
Quoted 3 lines

Hi!
Looks good to me, but since we are right before release I would be more happier if this gets more than one review before it gets pushed.

Definitely. Li, Andrea, Martin, could you please have a look?

Kind regards,
Petr

Quoted 1 line

Kind regards,

Andrea

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by on v1 1/1
#10 lore raw
In reply to Petr Vorel

Hi,
one tiny nit below, otherwise:

Quoted 1 line · Petr Vorel

tmpfs does not support it.

What's "it"? ^

Quoted 11 lines
---
 testcases/kernel/io/ltp-aiodio/aiodio_append.c | 10 ++++++++--
 testcases/kernel/io/ltp-aiodio/dio_append.c    |  4 ++++
 testcases/kernel/io/ltp-aiodio/dio_read.c      |  4 ++++
 testcases/kernel/io/ltp-aiodio/dio_sparse.c    | 10 ++++++++--
 testcases/kernel/io/ltp-aiodio/dio_truncate.c  | 10 ++++++++--
 5 files changed, 32 insertions(+), 6 deletions(-)
testcases/kernel/io/ltp-aiodio/aiodio_append.c +0 -0
Signature · 10 lines
Martin Doucha   [email protected]
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#11 lore raw

Hi!

Quoted 3 lines
Quoted 1 line

tmpfs does not support it.

What's "it"? ^

Should be replaced by O_DIRECT I guess.

Signature · 5 lines
Cyril Hrubis
[email protected]

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