<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/memblock/tests/common.h, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-06-05T07:22:22+00:00</updated>
<entry>
<title>memblock tests: add memblock_overlaps_region_checks</title>
<updated>2024-06-05T07:22:22+00:00</updated>
<author>
<name>Wei Yang</name>
<email>richard.weiyang@gmail.com</email>
</author>
<published>2024-05-07T07:58:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1a879671bdfd14698a839f30de8e6d76e1e858fd'/>
<id>urn:sha1:1a879671bdfd14698a839f30de8e6d76e1e858fd</id>
<content type='text'>
Add a test case for memblock_overlaps_region().

Signed-off-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
Link: https://lore.kernel.org/r/20240507075833.6346-5-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) &lt;rppt@kernel.org&gt;
</content>
</entry>
<entry>
<title>memblock tests: add memblock_reserve_many_may_conflict_check()</title>
<updated>2024-06-05T07:22:22+00:00</updated>
<author>
<name>Wei Yang</name>
<email>richard.weiyang@gmail.com</email>
</author>
<published>2024-05-07T07:58:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6df89c3582a337090ae1f37c3648bdb35da29f7'/>
<id>urn:sha1:f6df89c3582a337090ae1f37c3648bdb35da29f7</id>
<content type='text'>
This may trigger the case fixed by commit 48c3b583bbdd ("mm/memblock:
fix overlapping allocation when doubling reserved array").

This is done by adding the 129th reserve region into memblock.memory. If
memblock_double_array() use this reserve region as new array, it fails.

Signed-off-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
Link: https://lore.kernel.org/r/20240507075833.6346-3-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) &lt;rppt@kernel.org&gt;
</content>
</entry>
<entry>
<title>memblock tests: fix warning ‘struct seq_file’ declared inside parameter list</title>
<updated>2023-09-14T07:51:28+00:00</updated>
<author>
<name>Mike Rapoport (IBM)</name>
<email>rppt@kernel.org</email>
</author>
<published>2023-09-14T07:45:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55122e0130e51eb71f5ec62d10525db0468f28e8'/>
<id>urn:sha1:55122e0130e51eb71f5ec62d10525db0468f28e8</id>
<content type='text'>
Building memblock tests produces the following warning:

cc -I. -I../../include -Wall -O2 -fsanitize=address -fsanitize=undefined -D CONFIG_PHYS_ADDR_T_64BIT   -c -o main.o main.c
In file included from tests/common.h:9,
                 from tests/basic_api.h:5,
                 from main.c:2:
./linux/memblock.h:601:50: warning: ‘struct seq_file’ declared inside parameter list will not be visible outside of this definition or declaration
  601 | static inline void memtest_report_meminfo(struct seq_file *m) { }
      |                                                  ^~~~~~~~

Add declaration of 'struct seq_file' to tools/include/linux/seq_file.h
to fix it.

Signed-off-by: Mike Rapoport (IBM) &lt;rppt@kernel.org&gt;
</content>
</entry>
<entry>
<title>memblock tests: introduce range tests for memblock_alloc_exact_nid_raw</title>
<updated>2022-11-08T07:50:24+00:00</updated>
<author>
<name>Rebecca Mckeever</name>
<email>remckee0@gmail.com</email>
</author>
<published>2022-11-07T06:28:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=61da03328a603d2d4a5b2e80cbe29bbf0122e6f8'/>
<id>urn:sha1:61da03328a603d2d4a5b2e80cbe29bbf0122e6f8</id>
<content type='text'>
Add TEST_F_EXACT flag, which specifies that tests should run
memblock_alloc_exact_nid_raw(). Introduce range tests for
memblock_alloc_exact_nid_raw() by using the TEST_F_EXACT flag to run the
range tests in alloc_nid_api.c, since memblock_alloc_exact_nid_raw() and
memblock_alloc_try_nid_raw() behave the same way when nid = NUMA_NO_NODE.

Rename tests and other functions in alloc_nid_api.c by removing "_try".
Since the test names will be displayed in verbose output, they need to
be general enough to refer to any of the memblock functions that the
tests may run.

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/5a4b6d1b6130ab7375314e1c45a6d5813dfdabbd.1667802195.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock test: Add test to memblock_add() 129th region</title>
<updated>2022-10-31T08:15:00+00:00</updated>
<author>
<name>Shaoqin Huang</name>
<email>shaoqin.huang@intel.com</email>
</author>
<published>2022-10-11T06:21:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=085bdaa6eb1476ec054164bdc4001bc3916ff5cb'/>
<id>urn:sha1:085bdaa6eb1476ec054164bdc4001bc3916ff5cb</id>
<content type='text'>
Add 129th region into the memblock, and this will trigger the
memblock_double_array() function, this needs valid memory regions. So
using dummy_physical_memory_init() to allocate a large enough memory
region, and split it into a large enough memory which can be choosed by
memblock_double_array(), and the left memory will be split into small
memory region, and add them into the memblock. It make sure the
memblock_double_array() will always choose the valid memory region that
is allocated by the dummy_physical_memory_init().
So memblock_double_array() must success.

Another thing should be done is to restore the memory.regions after
memblock_double_array(), due to now the memory.regions is pointing to a
memory region allocated by dummy_physical_memory_init(). And it will
affect the subsequent tests if we don't restore the memory region. So
simply record the origin region, and restore it after the test.

Signed-off-by: Shaoqin Huang &lt;shaoqin.huang@intel.com&gt;
Signed-off-by: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Link: https://lore.kernel.org/r/20221011062128.49359-2-shaoqin.huang@intel.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: add simulation of physical memory with multiple NUMA nodes</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:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b338bde5a3a9c4ccf6c83e0a20c8de3ad281ef02'/>
<id>urn:sha1:b338bde5a3a9c4ccf6c83e0a20c8de3ad281ef02</id>
<content type='text'>
Add function setup_numa_memblock() for setting up a memory layout with
multiple NUMA nodes in a previously allocated dummy physical memory.
This function can be used in place of setup_memblock() in tests that need
to simulate a NUMA system.

setup_numa_memblock():
- allows for setting up a memory layout by specifying the fraction of
  MEM_SIZE in each node

Set CONFIG_NODES_SHIFT to 4 when building with NUMA=1 to allow for up to
16 NUMA nodes.

Reviewed-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/4566d816a85f009268d4858d1ef06c7571a960f9.1663046060.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: update alloc_api to test memblock_alloc_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:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=deee033e0f8ea66a9f4acfc1eb069fdef3013bec'/>
<id>urn:sha1:deee033e0f8ea66a9f4acfc1eb069fdef3013bec</id>
<content type='text'>
Update memblock_alloc() tests so that they test either memblock_alloc()
or memblock_alloc_raw() depending on the value of alloc_test_flags. Run
through all the existing tests in memblock_alloc_api twice: once for
memblock_alloc() and once for memblock_alloc_raw().

When the tests run memblock_alloc(), they test that the entire memory
region is zero. When the tests run memblock_alloc_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_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/5a7cfb2f807ee2cb53ee77f9f5c910107b253d6e.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 tests to check if memblock_alloc zeroed memory</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:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac76d803c4f6c2a32c9c7436d14467e099fd2bfa'/>
<id>urn:sha1:ac76d803c4f6c2a32c9c7436d14467e099fd2bfa</id>
<content type='text'>
Add an assert in memblock_alloc() tests where allocation is expected to
occur. The assert checks whether the entire chunk of allocated memory is
cleared.

The current memblock_alloc() tests do not check whether the allocated
memory was zeroed. memblock_alloc() should zero the allocated memory since
it is a wrapper for memblock_alloc_try_nid().

Reviewed-by: Shaoqin Huang &lt;shaoqin.huang@intel.com&gt;
Reviewed-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/83ffb941b65074f40eb14552f8bfe5b71fe50abd.1661578349.git.remckee0@gmail.com
</content>
</entry>
</feed>
