All of lore.kernel.org
 help / color / mirror / Atom feed
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 v6 0/4] memblock tests: add NUMA tests for memblock_alloc_try_nid*
Date: Tue, 13 Sep 2022 00:21:08 -0500	[thread overview]
Message-ID: <cover.1663046060.git.remckee0@gmail.com> (raw)

These patches add additional tests for memblock_alloc_try_nid() and
memblock_alloc_try_nid_raw() that use a simulated physical
memory that is set up with multiple NUMA nodes. Additionally, most of
these tests set nid != NUMA_NO_NODE.

To set up a simulated physical memory with multiple NUMA nodes, patch 1
introduces setup_numa_memblock(). This function uses a previously
allocated dummy physical memory. It can be used in place of
setup_memblock() in tests that need to simulate a NUMA system.

These tests are run twice, once for memblock_alloc_try_nid() and once
for memblock_alloc_try_nid_raw(), so that both functions are tested with
the same set of tests. When the tests run memblock_alloc_try_nid(), they
test that the entire memory region is zero. When the tests run
memblock_alloc_try_nid_raw(), they test that the entire memory region is
nonzero.

---
Changelog

v5 -> v6
Based on feedback from David Hildenbrand:
PATCH 1:
- tests/common.c, tests/common.h:
    + setup_numa_memblock():
        * Change nodes[] from const int to const unsigned int
        * Remove "&& node_fracs[i] > 0" from the assert()
PATCH 2:
- tests/alloc_nid_api.c:
    + Update node_fractions[] type to static const unsigned int to
      reflect changes in PATCH 1

v4 -> v5
Based on feedback from David Hildenbrand:
PATCH 1:
- tests/common.c:
    + setup_numa_memblock():
        * Change nodes[] to int basis points (one hundredth of 1% or
          1/10000) instead of phys_addr_t fraction denominators
        * Rename parameter nodes[] to node_fracs[]
PATCH 2:
- tests/alloc_nid_api.c:
    + Update node_fractions[] to reflect changes in PATCH 1

v3 -> v4
Based on feedback from David Hildenbrand:
PATCH 1:
- tests/common.h:
    + Remove #define MEM_FACTOR
PATCH 2:
- tests/alloc_nid_api.c:
    + Add missing blank line after alloc_nid_test_flags = flags;
PATCH 2, PATCH 3, PATCH 4:
- tests/alloc_nid_api.c:
    + Define variables in new tests in a single block
    + Change "cleared memory region" to "memory region" in comment
      blocks for new tests

Based on feedback from Mike Rapoport:
PATCH 1:
- tests/common.c:
    + Remove node_sizes[] array
- tests/common.c, tests/common.h:
    + Combine setup_numa_memblock_generic() and setup_numa_memblock():
        * Remove setup_numa_memblock(void)
        * Change setup_numa_memblock_generic() to setup_numa_memblock()
          and remove the factor and node_cnt parameters
        * Change nodes[] parameter to an array containing the
        * denominators
          of the fractions of MEM_SIZE contained in each node
          e.g., if nodes[0] = SZ_8, node 0 will contain 1/8th of
MEM_SIZE    
PATCH 2:
- tests/alloc_nid_api.c:
    + Add node_fractions[] array:
        * Based on values from node_sizes[] array previously in PATCH 1
        * Update to fit the new nodes[] parameter of
        * setup_numa_memblock()

v2 -> v3
PATCH 2, PATCH 3, PATCH 4:
- tests/alloc_nid_api.c:
    + Edits for consistency between tests and test naming styles:
        * Change "numa_top_down" to "top_down_numa"
        * Change "numa_bottom_up" to "bottom_up_numa"
        * Move "generic" to immediately before "check"
        * alloc_try_nid_bottom_up_numa_small_node_check() and
          alloc_try_nid_bottom_up_numa_node_reserved_check():
            - Separate size definition from its declaration

Updates based on changes to the dependent patch set noted above:
PATCH 2, PATCH 3, PATCH 4:
- tests/alloc_nid_api.c:
    + get_func_testing():
        * Rename to get_memblock_alloc_try_nid_name().
    + Update calls to verify_mem_content() to assert_mem_content().

v1 -> v2
Updates based on changes to the dependent patch set noted above:
PATCH 2, PATCH 3, PATCH 4:
- tests/alloc_nid_api.c:
    + Update calls to verify_mem_content() to include the flags parameter
      required by the new, common verify_mem_content() function.
---

Rebecca Mckeever (4):
  memblock tests: add simulation of physical memory with multiple NUMA
    nodes
  memblock tests: add top-down NUMA tests for memblock_alloc_try_nid*
  memblock tests: add bottom-up NUMA tests for memblock_alloc_try_nid*
  memblock tests: add generic NUMA tests for memblock_alloc_try_nid*

 .../testing/memblock/scripts/Makefile.include |    2 +-
 tools/testing/memblock/tests/alloc_nid_api.c  | 1466 ++++++++++++++++-
 tools/testing/memblock/tests/alloc_nid_api.h  |   16 +
 tools/testing/memblock/tests/common.c         |   31 +
 tools/testing/memblock/tests/common.h         |   22 +-
 5 files changed, 1524 insertions(+), 13 deletions(-)

-- 
2.25.1



             reply	other threads:[~2022-09-13  5:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-13  5:21 Rebecca Mckeever [this message]
2022-09-13  5:21 ` [PATCH v6 1/4] memblock tests: add simulation of physical memory with multiple NUMA nodes Rebecca Mckeever
2022-09-13  5:21 ` [PATCH v6 2/4] memblock tests: add top-down NUMA tests for memblock_alloc_try_nid* Rebecca Mckeever
2022-09-13  5:21 ` [PATCH v6 3/4] memblock tests: add bottom-up " Rebecca Mckeever
2022-09-13  5:21 ` [PATCH v6 4/4] memblock tests: add generic " Rebecca Mckeever
2022-09-18  7:32 ` [PATCH v6 0/4] memblock tests: add " Mike Rapoport

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=cover.1663046060.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.