[Skiboot] Help with local_alloc unit tests

Oliver O'Halloran oohall at gmail.com
Fri Aug 28 15:25:29 AEST 2020


On Thu, Aug 27, 2020 at 7:21 AM Ryan Grimm <grimm at linux.vnet.ibm.com> wrote:
>
> Oliver,
>
> So, I was previously thinking we can stick some local_alloc and
> local_free unit test cases in an allocator test, like you suggest.  I
> thought run-mem_region.c would be the right place, since local_alloc
> uses mem regions.  I got stuck b/c this test case uses the skiboot_heap
> and local_alloc doesn't do that.
>
> Should I do something like in run-mem_region_init.c where we create a
> device tree, build up mem regions on various fake chips, and do
> local_alloc and local_frees?
>
> Maybe add this to run-mem_region_init.c?
>
> I think that's the right path,  I'll give it a go.

Yeah something like that would be good.

I'd use run-mem_region_release_unused as the basis rather than the
mem_region_init() since local_free() might have some fun interactions
with the release pass. That's where we generate reserved memory nodes
for the FW allocations and mark any unused memory as available for the
OS. I can see potential for local_free() screwing that up so having a
test case would be useful.

Oliver


More information about the Skiboot mailing list