From: Rebecca Mckeever <remckee0@gmail.com>
To: Mike Rapoport <rppt@kernel.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Cc: David Hildenbrand <david@redhat.com>,
Rebecca Mckeever <remckee0@gmail.com>
Subject: [PATCH 7/8] memblock tests: add tests for memblock_*bottom_up functions
Date: Sun, 14 Aug 2022 00:53:59 -0500 [thread overview]
Message-ID: <69524966ac92d93b45a8a8e739434d5fb31e3084.1660454730.git.remckee0@gmail.com> (raw)
In-Reply-To: <cover.1660454730.git.remckee0@gmail.com>
Add simple tests for memblock_set_bottom_up() and memblock_bottom_up().
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
---
tools/testing/memblock/tests/basic_api.c | 45 ++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/tools/testing/memblock/tests/basic_api.c b/tools/testing/memblock/tests/basic_api.c
index ef5642d0863b..d7f008e7a12a 100644
--- a/tools/testing/memblock/tests/basic_api.c
+++ b/tools/testing/memblock/tests/basic_api.c
@@ -1679,6 +1679,50 @@ static int memblock_free_checks(void)
return 0;
}
+static int memblock_set_bottom_up_check(void)
+{
+ prefix_push("memblock_set_bottom_up");
+
+ memblock_set_bottom_up(false);
+ ASSERT_EQ(memblock.bottom_up, false);
+ memblock_set_bottom_up(true);
+ ASSERT_EQ(memblock.bottom_up, true);
+
+ reset_memblock_attributes();
+ test_pass_pop();
+
+ return 0;
+}
+
+static int memblock_bottom_up_check(void)
+{
+ prefix_push("memblock_bottom_up");
+
+ memblock_set_bottom_up(false);
+ ASSERT_EQ(memblock_bottom_up(), memblock.bottom_up);
+ ASSERT_EQ(memblock_bottom_up(), false);
+ memblock_set_bottom_up(true);
+ ASSERT_EQ(memblock_bottom_up(), memblock.bottom_up);
+ ASSERT_EQ(memblock_bottom_up(), true);
+
+ reset_memblock_attributes();
+ test_pass_pop();
+
+ return 0;
+}
+
+static int memblock_bottom_up_checks(void)
+{
+ test_print("Running memblock_*bottom_up tests...\n");
+
+ prefix_reset();
+ memblock_set_bottom_up_check();
+ prefix_reset();
+ memblock_bottom_up_check();
+
+ return 0;
+}
+
int memblock_basic_checks(void)
{
memblock_initialization_check();
@@ -1686,6 +1730,7 @@ int memblock_basic_checks(void)
memblock_reserve_checks();
memblock_remove_checks();
memblock_free_checks();
+ memblock_bottom_up_checks();
return 0;
}
--
2.25.1
next prev parent reply other threads:[~2022-08-14 5:54 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 5:53 [PATCH 0/8] memblock tests: update and extend memblock simulator Rebecca Mckeever
2022-08-14 5:53 ` [PATCH 1/8] memblock tests: update tests to check if memblock_alloc zeroed memory Rebecca Mckeever
2022-08-15 8:50 ` Huang, Shaoqin
2022-08-16 2:15 ` Rebecca Mckeever
2022-08-16 2:24 ` Huang, Shaoqin
2022-08-14 5:53 ` [PATCH 2/8] memblock tests: update zeroed memory check for memblock_alloc_* tests Rebecca Mckeever
2022-08-15 8:59 ` Huang, Shaoqin
2022-08-14 5:53 ` [PATCH 3/8] memblock tests: add labels to verbose output for generic alloc tests Rebecca Mckeever
2022-08-15 9:15 ` Huang, Shaoqin
2022-08-16 2:39 ` Rebecca Mckeever
2022-08-16 3:08 ` Huang, Shaoqin
2022-08-19 5:03 ` Rebecca Mckeever
2022-08-19 8:39 ` Huang, Shaoqin
2022-08-14 5:53 ` [PATCH 4/8] memblock tests: add additional tests for basic api and memblock_alloc Rebecca Mckeever
2022-08-15 10:19 ` Huang, Shaoqin
2022-08-14 5:53 ` [PATCH 5/8] memblock tests: update alloc_api to test memblock_alloc_raw Rebecca Mckeever
2022-08-14 5:53 ` [PATCH 6/8] memblock tests: update alloc_nid_api to test memblock_alloc_try_nid_raw Rebecca Mckeever
2022-08-16 1:24 ` Huang, Shaoqin
2022-08-14 5:53 ` Rebecca Mckeever [this message]
2022-08-16 1:46 ` [PATCH 7/8] memblock tests: add tests for memblock_*bottom_up functions Huang, Shaoqin
2022-08-14 5:54 ` [PATCH 8/8] memblock tests: add tests for memblock_trim_memory Rebecca Mckeever
2022-08-16 1:46 ` Huang, Shaoqin
2022-08-20 8:40 ` Rebecca Mckeever
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=69524966ac92d93b45a8a8e739434d5fb31e3084.1660454730.git.remckee0@gmail.com \
--to=remckee0@gmail.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rppt@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;
as well as URLs for NNTP newsgroup(s).