linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Brendan Jackman <jackmanb@google.com>,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>
Cc: Mateusz Guzik <mjguzik@gmail.com>,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] selftests/mm: Don't fail uffd-stress if too many CPUs
Date: Thu, 20 Feb 2025 21:18:42 +0530	[thread overview]
Message-ID: <da1c3dcb-5296-47bd-b5ed-9cb8833377cf@arm.com> (raw)
In-Reply-To: <20250220-mm-selftests-v1-6-9bbf57d64463@google.com>



On 20/02/25 8:33 pm, Brendan Jackman wrote:
> This calculation divides a fixed parameter by an environment-dependent
> parameter i.e. the number of CPUs.
> 
> The simple way to avoid machine-specific failures here is to just put a
> cap on the max value of the latter.

I haven't read the test, but if nr_cpus is being computed, then this 
value must be important to the test somehow? Would it potentially be 
wrong to let the test run for nr_cpus != actual number of cpus?

Also, if the patch is correct then will it be better to also print a 
diagnostic telling the user that the number of cpus is going to be 
capped for the test to run?

> 
> Suggested-by: Mateusz Guzik <mjguzik@gmail.com>
> Signed-off-by: Brendan Jackman <jackmanb@google.com>
> ---
>   tools/testing/selftests/mm/uffd-stress.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c
> index 1facfb79e09aa4113e344d7d90dec06a37264058..f306accbef255c79bc3eeba8b9e42161a88fc10e 100644
> --- a/tools/testing/selftests/mm/uffd-stress.c
> +++ b/tools/testing/selftests/mm/uffd-stress.c
> @@ -453,6 +453,10 @@ int main(int argc, char **argv)
>   	}
>   
>   	nr_cpus = sysconf(_SC_NPROCESSORS_ONLN);
> +	if (nr_cpus > 32) {
> +		/* Don't let calculation below go to zero. */
> +		nr_cpus = 32;
> +	}
>   
>   	nr_pages_per_cpu = bytes / page_size / nr_cpus;
>   	if (!nr_pages_per_cpu) {
> 



  reply	other threads:[~2025-02-20 15:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 15:03 [PATCH 0/6] selftests/mm: Some cleanups from trying to run them Brendan Jackman
2025-02-20 15:03 ` [PATCH 1/6] selftests/mm: Report errno when things fail Brendan Jackman
2025-02-20 15:32   ` Dev Jain
2025-02-20 15:03 ` [PATCH 2/6] selftests/mm: Fix assumption that sudo is present Brendan Jackman
2025-02-20 15:03 ` [PATCH 3/6] selftests/mm: Skip uffd-stress if userfaultfd not available Brendan Jackman
2025-02-20 18:06   ` Dev Jain
2025-02-20 18:17     ` Brendan Jackman
2025-02-20 15:03 ` [PATCH 4/6] selftests/mm: Skip uffd-wp-mremap " Brendan Jackman
2025-02-20 15:03 ` [PATCH 5/6] selftests/mm: Print some details when uffd-stress gets bad params Brendan Jackman
2025-02-20 15:17   ` Brendan Jackman
2025-02-20 15:03 ` [PATCH 6/6] selftests/mm: Don't fail uffd-stress if too many CPUs Brendan Jackman
2025-02-20 15:48   ` Dev Jain [this message]
2025-02-20 15:55     ` Brendan Jackman
2025-02-20 16:01       ` Brendan Jackman

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=da1c3dcb-5296-47bd-b5ed-9cb8833377cf@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=jackmanb@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mjguzik@gmail.com \
    --cc=shuah@kernel.org \
    /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