<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/memblock/tests/basic_api.c, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-04-07T06:28:01+00:00</updated>
<entry>
<title>memblock tests: add test for memblock_set_node</title>
<updated>2025-04-07T06:28:01+00:00</updated>
<author>
<name>Wei Yang</name>
<email>richard.weiyang@gmail.com</email>
</author>
<published>2025-03-18T07:19:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b394dff15e14550a26b133fc7b556b5b526f6a5'/>
<id>urn:sha1:3b394dff15e14550a26b133fc7b556b5b526f6a5</id>
<content type='text'>
Add a test to check memblock_set_node() behavior.

And create a corner case in which the memblock.reserved array is doubled
during memblock_set_node(). And finally make sure all regions in
memblock.reserved are with valid node id.

Signed-off-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
CC: Mike Rapoport &lt;rppt@kernel.org&gt;
CC: Yajun Deng &lt;yajun.deng@linux.dev&gt;
Link: https://lore.kernel.org/r/20250318071948.23854-4-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (Microsoft) &lt;rppt@kernel.org&gt;
</content>
</entry>
<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: add memblock_reserve_all_locations_check()</title>
<updated>2024-06-05T07:22:21+00:00</updated>
<author>
<name>Wei Yang</name>
<email>richard.weiyang@gmail.com</email>
</author>
<published>2024-05-07T07:58:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3d3165193776ddacf59f101f0fa05cfab9f1a9ba'/>
<id>urn:sha1:3d3165193776ddacf59f101f0fa05cfab9f1a9ba</id>
<content type='text'>
Instead of adding 129th memory block at the last position, let's try all
possible position.

Signed-off-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
Link: https://lore.kernel.org/r/20240507075833.6346-2-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (IBM) &lt;rppt@kernel.org&gt;
</content>
</entry>
<entry>
<title>mm/memblock: remove empty dummy entry</title>
<updated>2024-06-05T07:21:47+00:00</updated>
<author>
<name>Wei Yang</name>
<email>richard.weiyang@gmail.com</email>
</author>
<published>2024-04-05T01:58:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=721f4a6526daafca15634f30c9865e880da3e1d1'/>
<id>urn:sha1:721f4a6526daafca15634f30c9865e880da3e1d1</id>
<content type='text'>
The dummy entry is introduced in the initial implementation of lmb in
commit 7c8c6b9776fb ("powerpc: Merge lmb.c and make MM initialization
use it.").

As the comment says the empty dummy entry is to simplify the code.

	/* Create a dummy zero size LMB which will get coalesced away later.
         * This simplifies the lmb_add() code below...
         */

While current code is reimplemented by Tejun in commit 784656f9c680
("memblock: Reimplement memblock_add_region()"). This empty dummy entry
seems not benefit the code any more.

Let's remove it.

Signed-off-by: Wei Yang &lt;richard.weiyang@gmail.com&gt;
CC: Paul Mackerras &lt;paulus@ozlabs.org&gt;
CC: Tejun Heo &lt;tj@kernel.org&gt;
CC: Mike Rapoport &lt;rppt@kernel.org&gt;
Link: https://lore.kernel.org/r/20240405015821.13411-1-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 test: Add test to memblock_reserve() 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:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5b27dd7968b9c916da4af48d0310f94152744f8e'/>
<id>urn:sha1:5b27dd7968b9c916da4af48d0310f94152744f8e</id>
<content type='text'>
Reserve 129th region in 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 valid memory region.
At the same time, reserve 128 faked memory region, and make sure these
reserved region not intersect with the valid memory region. So
memblock_double_array() will choose the valid memory region, and it will
success.

Also need to restore the reserved.regions after memblock_double_array(),
to make sure the subsequent tests can run as normal.

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-3-shaoqin.huang@intel.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 tests for memblock_trim_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:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dcd45ad2ad784c35bfba8ae93c285574bc2a8a1e'/>
<id>urn:sha1:dcd45ad2ad784c35bfba8ae93c285574bc2a8a1e</id>
<content type='text'>
Add tests for memblock_trim_memory() for the following scenarios:
- all regions aligned
- one unaligned region that is smaller than the alignment
- one unaligned region that is unaligned at the base
- one unaligned region that is unaligned at the end

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/0e5f55154a3b66581e04ba3717978795cbc08a5b.1661578349.git.remckee0@gmail.com
</content>
</entry>
<entry>
<title>memblock tests: add tests for memblock_*bottom_up functions</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:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a541c6d428f775efcfe25236062c96b59e31b57a'/>
<id>urn:sha1:a541c6d428f775efcfe25236062c96b59e31b57a</id>
<content type='text'>
Add simple tests for memblock_set_bottom_up() and memblock_bottom_up().

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/b03701d2faeaf00f7184e4b72903de4e5e939437.1661578349.git.remckee0@gmail.com
</content>
</entry>
</feed>
