that heap arena will have the 2mb bootmem
theeeen
after initialising everything there i would make pmm rely on slabs that gets backed by the heap arena
the heap will later expand itself with another span that covers the actual kernel heap region
and I'll have the pf handler back it with memory as needed
afterwards the pmm will get initialised
now the pmm itself doesnt rely on slabs for managing its free tags storage
instead it'll do it like vmem
aka
have a callback that snatches a page, maps it then initialise it as tags
and uses few of these to record everything
now all this might introduce an infinite recursion
say
vmem on heap has to allocate a region or maybe a span -> uses its last tag, bc a perfect fit wasnt available or to commit that span to the tags list, next time it'll have to allocate and back with memory -> pf on that region, so pmm is called to back it with memory -> pmm is out of tags, allocates a page -> calls the heap vmem to request a new page -> they dont have tags to record it -> pmm ...
sooo
to solve this I'll sort of have tag blocks on vmem leave few tags for like
emergency
which only the pmm can signal that they have to be used, on its own call to vmem
im still not fan of this solution tbh
but at least I wont pollute the vmem layer itself with it and Instead have this case local to a tag block creation callback function or whatever that applies to only the heap region
other vmem arenas will have callbacks that doesnt interact with the pmm and instead will use the heap or idk










