memblock tests: update alloc_nid_api to test memblock_alloc_try_nid_raw
authorRebecca Mckeever <remckee0@gmail.com>
Sat, 27 Aug 2022 05:42:48 +0000 (00:42 -0500)
committerMike Rapoport <rppt@linux.ibm.com>
Tue, 30 Aug 2022 10:12:00 +0000 (13:12 +0300)
commitae544fd62c14265dc663a65b3f9c6c5a6134098a
tree4da98ed8a8537b12d33d81bf78e6d1d60725ecf2
parentdeee033e0f8ea66a9f4acfc1eb069fdef3013bec
memblock tests: update alloc_nid_api to test memblock_alloc_try_nid_raw

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 <shaoqin.huang@intel.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Link: https://lore.kernel.org/r/6fa8938f67872841c10a00afb042947d1d280a04.1661578349.git.remckee0@gmail.com
tools/testing/memblock/tests/alloc_nid_api.c