<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/memblock/tests/alloc_nid_api.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-09-18T07:30:20+00:00</updated>
<entry>
<title>memblock tests: add generic NUMA tests for memblock_alloc_try_nid*</title>
<updated>2022-09-18T07:30:20+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-09-13T05:21:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e4519b7afc2f9d99f9303468ee0b23f88399c8d'/>
<id>urn:sha1:3e4519b7afc2f9d99f9303468ee0b23f88399c8d</id>
<content type='text'>
Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw()
where the simulated physical memory is set up with multiple NUMA nodes.
Additionally, two of these tests set nid != NUMA_NO_NODE. All tests are
run for both top-down and bottom-up allocation directions.

The tested scenarios are:

Range unrestricted:
- region cannot be allocated:
      + none of the nodes have enough memory to allocate the region

Range restricted:
- region can be allocated in the specific node requested without dropping
  min_addr:
      + the range fully overlaps with the node, and there are adjacent
        reserved regions
- region cannot be allocated:
      + nid is set to NUMA_NO_NODE and the total range can fit the region,
        but the range is split between two nodes and everything else is
        reserved

Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/4b2c7e6e5f3a9837939e99293c77e0e6fc3ae4f9.1663046060.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: add bottom-up NUMA tests for memblock_alloc_try_nid*</title>
<updated>2022-09-18T07:30:20+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-09-13T05:21:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4b41046e7c6bd999c1519a8bf2771573bcecf52b'/>
<id>urn:sha1:4b41046e7c6bd999c1519a8bf2771573bcecf52b</id>
<content type='text'>
Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw()
where the simulated physical memory is set up with multiple NUMA nodes.
Additionally, all of these tests set nid != NUMA_NO_NODE. These tests are
run with a bottom-up allocation direction.

The tested scenarios are:

Range unrestricted:
- region can be allocated in the specific node requested:
      + there are no previously reserved regions
      + the requested node is partially reserved but has enough space
- the specific node requested cannot accommodate the request, but the
  region can be allocated in a different node:
      + there are no previously reserved regions, but node is too small
      + the requested node is fully reserved
      + the requested node is partially reserved and does not have
        enough space

Range restricted:
- region can be allocated in the specific node requested after dropping
  min_addr:
      + range partially overlaps with two different nodes, where the first
        node is the requested node
      + range partially overlaps with two different nodes, where the
        requested node ends before min_addr
- region cannot be allocated in the specific node requested, but it can be
  allocated in the requested range:
      + range overlaps with multiple nodes along node boundaries, and the
        requested node ends before min_addr
      + range overlaps with multiple nodes along node boundaries, and the
        requested node starts after max_addr
- region cannot be allocated in the specific node requested, but it can be
  allocated after dropping min_addr:
      + range partially overlaps with two different nodes, where the
        second node is the requested node

Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/00c4810daaf5d050abc71915b24ed7419bb16b51.1663046060.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: add top-down NUMA tests for memblock_alloc_try_nid*</title>
<updated>2022-09-18T07:30:20+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-09-13T05:21:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50c80241f15890a64b9302187faaeb7cfe78b4b8'/>
<id>urn:sha1:50c80241f15890a64b9302187faaeb7cfe78b4b8</id>
<content type='text'>
Add tests for memblock_alloc_try_nid() and memblock_alloc_try_nid_raw()
where the simulated physical memory is set up with multiple NUMA nodes.
Additionally, all of these tests set nid != NUMA_NO_NODE. These tests are
run with a top-down allocation direction.

The tested scenarios are:

Range unrestricted:
- region can be allocated in the specific node requested:
      + there are no previously reserved regions
      + the requested node is partially reserved but has enough space
- the specific node requested cannot accommodate the request, but the
  region can be allocated in a different node:
      + there are no previously reserved regions, but node is too small
      + the requested node is fully reserved
      + the requested node is partially reserved and does not have
        enough space

Range restricted:
- region can be allocated in the specific node requested after dropping
  min_addr:
      + range partially overlaps with two different nodes, where the first
        node is the requested node
      + range partially overlaps with two different nodes, where the
        requested node ends before min_addr
- region cannot be allocated in the specific node requested, but it can be
  allocated in the requested range:
      + range overlaps with multiple nodes along node boundaries, and the
        requested node ends before min_addr
      + range overlaps with multiple nodes along node boundaries, and the
        requested node starts after max_addr
- region cannot be allocated in the specific node requested, but it can be
  allocated after dropping min_addr:
      + range partially overlaps with two different nodes, where the
        second node is the requested node

Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/84009c5b3969337ccf89df850db56d364f8c228b.1663046060.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock_tests: move variable declarations to single block</title>
<updated>2022-09-04T10:50:35+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-09-04T04:24:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42c3ba86581896be8dd7fb88ed075b600fd57fa1'/>
<id>urn:sha1:42c3ba86581896be8dd7fb88ed075b600fd57fa1</id>
<content type='text'>
Move variable declarations to a single block at the beginning of each
testing function.

Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/e61431e73977f305fdd027bca99d1dc119e96d84.1662264355.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: remove 'cleared' from comment blocks</title>
<updated>2022-09-04T10:49:33+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-09-04T04:23:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=35e49953c31d85d5d942af611d5b9090b0dc8cfa'/>
<id>urn:sha1:35e49953c31d85d5d942af611d5b9090b0dc8cfa</id>
<content type='text'>
The tests in alloc_nid_api can now run either memblock_alloc_try_nid()
or memblock_alloc_try_nid_raw(). The comment blocks for these tests
should not refer to a 'cleared' region since that only applies to
memblock_alloc_try_nid(). Remove 'cleared' from the comment blocks so
that the comments are accurate for either memblock function.

Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/e8be24137e54e9f81a06af969ded82b319114d7a.1662264347.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: update alloc_nid_api to test memblock_alloc_try_nid_raw</title>
<updated>2022-08-30T10:12:00+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-08-27T05:42:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ae544fd62c14265dc663a65b3f9c6c5a6134098a'/>
<id>urn:sha1:ae544fd62c14265dc663a65b3f9c6c5a6134098a</id>
<content type='text'>
Update memblock_alloc_try_nid() tests so that they test either
memblock_alloc_try_nid() or memblock_alloc_try_nid_raw() depending on the
value of alloc_nid_test_flags. Run through all the existing tests in
alloc_nid_api twice: once for memblock_alloc_try_nid() and once for
memblock_alloc_try_nid_raw().

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. The content of the
memory region is initialized to nonzero, and we expect it to remain
unchanged if running memblock_alloc_try_nid_raw().

Reviewed-by: Shaoqin Huang &lt;shaoqin.huang@intel.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/6fa8938f67872841c10a00afb042947d1d280a04.1661578349.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: add labels to verbose output for generic alloc tests</title>
<updated>2022-08-30T10:12:00+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-08-27T05:42:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb2e97fe853ff515df473d4acec6707816e05d87'/>
<id>urn:sha1:fb2e97fe853ff515df473d4acec6707816e05d87</id>
<content type='text'>
Generic tests for memblock_alloc*() functions do not use separate
functions for testing top-down and bottom-up allocation directions.
Therefore, the function name that is displayed in the verbose testing
output does not include the allocation direction.

Add an additional prefix when running generic tests for
memblock_alloc*() functions that indicates which allocation direction is
set. The prefix will be displayed when the tests are run in verbose mode.

Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Reviewed-by: Shaoqin Huang &lt;shaoqin.huang@intel.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/fb76a42253d2a196a7daea29dd8121a69904f58e.1661578349.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: update zeroed memory check for memblock_alloc_* tests</title>
<updated>2022-08-30T10:12:00+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-08-27T05:42:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=25b9defb5bc4aee8beb51ded07838e12745426f9'/>
<id>urn:sha1:25b9defb5bc4aee8beb51ded07838e12745426f9</id>
<content type='text'>
Update the assert in memblock_alloc_try_nid() and memblock_alloc_from()
tests that checks whether the memory is cleared so that it checks the
entire chunk of allocated memory instead of just the first byte.

Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Reviewed-by: Shaoqin Huang &lt;shaoqin.huang@intel.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/24b3271751756100142e65b75284d43b4d30c9b7.1661578349.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: add verbose output to memblock tests</title>
<updated>2022-07-04T16:58:28+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-07-04T04:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=76586c00e74d189964d2fde26345a4a15f2ea02e'/>
<id>urn:sha1:76586c00e74d189964d2fde26345a4a15f2ea02e</id>
<content type='text'>
Add and use functions and macros for printing verbose testing output.

If the Memblock simulator was compiled with VERBOSE=1:
- prefix_push(): appends the given string to a prefix string that will be
  printed in test_fail() and test_pass*().

- prefix_pop(): removes the last prefix from the prefix string.

- prefix_reset(): clears the prefix string.

- test_fail(): prints a message after a test fails containing the test
  number of the failing test and the prefix.

- test_pass(): prints a message after a test passes containing its test
  number and the prefix.

- test_print(): prints the given formatted output string.

- test_pass_pop(): runs test_pass() followed by prefix_pop().

- PREFIX_PUSH(): runs prefix_push(__func__).

If the Memblock simulator was not compiled with VERBOSE=1, these
functions/macros do nothing.

Add the assert wrapper macros ASSERT_EQ(), ASSERT_NE(), and ASSERT_LT().
If the assert condition fails, these macros call test_fail() before
executing assert().

Acked-by: David Hildenbrand &lt;david@redhat.com&gt;
Reviewed-by: Shaoqin Huang &lt;shaoqin.huang@intel.com&gt;
Signed-off-by: Rebecca Mckeever &lt;remckee0@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/f234d443fe154d5ae8d8aa07284aff69edfb6f61.1656907314.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: Add memblock_alloc_try_nid tests for bottom up</title>
<updated>2022-03-09T13:55:35+00:00</updated>
<author>
<name>Karolina Drobnik</name>
<email>karolinadrobnik@gmail.com</email>
</author>
<published>2022-02-28T14:46:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9d8f6abe980f98ffccad80b11d46df2116d7a5fc'/>
<id>urn:sha1:9d8f6abe980f98ffccad80b11d46df2116d7a5fc</id>
<content type='text'>
Add checks for memblock_alloc_try_nid for bottom up allocation direction.
As the definition of this function is pretty close to the core
memblock_alloc_range_nid, the test cases implemented here cover most of
the code paths related to the memory allocations.

The tested scenarios are:
  - Region can be allocated within the requested range (both with aligned
    and misaligned boundaries)
  - Region can be allocated between two already existing entries
  - Not enough space between already reserved regions
  - Memory at the range boundaries is reserved but there is enough space
    to allocate a new region
  - The memory range is too narrow but memory can be allocated before
    the maximum address
  - Edge cases:
      + Minimum address is below memblock_start_of_DRAM()
      + Maximum address is above memblock_end_of_DRAM()

Add test case wrappers to test both directions in the same context.

Signed-off-by: Karolina Drobnik &lt;karolinadrobnik@gmail.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/1c0ba11b8da5dc8f71ad45175c536fa4be720984.1646055639.git.karolinadrobnik@gmail.com
</content>
</entry>
</feed>
