linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: akpm@linux-foundation.org, shuah@kernel.org
Cc: linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org, Anshuman.Khandual@arm.com,
	sjayaram@akamai.com, Dev Jain <dev.jain@arm.com>
Subject: [PATCH 0/2] Fixes for compaction_test
Date: Wed, 15 May 2024 15:06:31 +0530	[thread overview]
Message-ID: <20240515093633.54814-1-dev.jain@arm.com> (raw)

The compaction_test memory selftest introduces fragmentation in memory
and then tries to allocate as many hugepages as possible. This series
addresses some problems.

First off, correctly set the number of hugepages to zero before trying
to set a large number of them.

Now, consider a situation in which, at the start of the test, a non-zero
number of hugepages have been already set (while running the entire
selftests/mm suite, or manually by the admin). The test operates on 80%
of memory to avoid OOM-killer invocation, and because some memory is
already blocked by hugepages, it would increase the chance of OOM-killing.
Also, since mem_free used in check_compaction() is the value before we
set nr_hugepages to zero, the chance that the compaction_index will
be small is very high if the preset nr_hugepages was high, leading to a
bogus test success.

This series applies on top of the stable 6.9 kernel.
 
Dev Jain (2):
  selftests/mm: compaction_test: Fix incorrect write of zero to
    nr_hugepages
  selftests/mm: compaction_test: Fix trivial test success and reduce
    probability of OOM-killer invocation

 tools/testing/selftests/mm/compaction_test.c | 70 ++++++++++++++------
 1 file changed, 50 insertions(+), 20 deletions(-)

-- 
2.30.2


             reply	other threads:[~2024-05-15  9:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15  9:36 Dev Jain [this message]
2024-05-15  9:36 ` [PATCH 1/2] selftests/mm: compaction_test: Fix incorrect write of zero to nr_hugepages Dev Jain
2024-05-20  0:00   ` Andrew Morton
2024-05-20  5:28     ` Dev Jain
2024-05-15  9:36 ` [PATCH 2/2] selftests/mm: compaction_test: Fix trivial test success and reduce probability of OOM-killer invocation Dev Jain
2024-05-20  0:03   ` Andrew Morton
2024-05-20  5:33     ` Dev Jain

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=20240515093633.54814-1-dev.jain@arm.com \
    --to=dev.jain@arm.com \
    --cc=Anshuman.Khandual@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    --cc=sjayaram@akamai.com \
    /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;
as well as URLs for NNTP newsgroup(s).