diff mbox series

[5/6] selftests/mm: Print some details when uffd-stress gets bad params

Message ID 20250220-mm-selftests-v1-5-9bbf57d64463@google.com (mailing list archive)
State New
Headers show
Series selftests/mm: Some cleanups from trying to run them | expand

Commit Message

Brendan Jackman Feb. 20, 2025, 3:03 p.m. UTC
So this can be debugged more easily.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 tools/testing/selftests/mm/uffd-stress.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Brendan Jackman Feb. 20, 2025, 3:17 p.m. UTC | #1
On Thu, 20 Feb 2025 at 16:03, Brendan Jackman <jackmanb@google.com> wrote:
>         nr_pages_per_cpu = bytes / page_size / nr_cpus;
>         if (!nr_pages_per_cpu) {
> -               _err("invalid MiB");
> +               _err("invalid MiB %lu (%lu / %lu / %lu)",
> +                       nr_pages_per_cpu, bytes, page_size, nr_cpus);

Oh this is actually wrong - the number it's printing isn't MiB.

Assuming there's a v2 I'll fix that up. Otherwise honestly this patch
could just be dropped, it's not important.
diff mbox series

Patch

diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c
index db5366b4766e5bfa2d1150d2f3c2d32469a6e28b..1facfb79e09aa4113e344d7d90dec06a37264058 100644
--- a/tools/testing/selftests/mm/uffd-stress.c
+++ b/tools/testing/selftests/mm/uffd-stress.c
@@ -456,7 +456,8 @@  int main(int argc, char **argv)
 
 	nr_pages_per_cpu = bytes / page_size / nr_cpus;
 	if (!nr_pages_per_cpu) {
-		_err("invalid MiB");
+		_err("invalid MiB %lu (%lu / %lu / %lu)",
+			nr_pages_per_cpu, bytes, page_size, nr_cpus);
 		usage();
 	}