0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-01-10 19:11:54 +00:00

Standby memory pages are accounted for as overhead in show memory command

This commit is contained in:
Maria Matejka 2021-12-02 11:29:59 +00:00
parent 38278d94ba
commit c5b6b18413

View File

@ -364,11 +364,22 @@ birdloop_dump(resource *r)
debug("%s\n", loop->pool->name);
}
struct resmem birdloop_memsize(resource *r)
{
struct birdloop *loop = (void *) r;
return (struct resmem) {
.effective = sizeof(struct birdloop) - sizeof(resource) - ALLOC_OVERHEAD,
.overhead = ALLOC_OVERHEAD + sizeof(resource) + page_size * list_length(&loop->pages.list),
};
}
struct resclass birdloop_class = {
.name = "IO Loop",
.size = sizeof(struct birdloop),
.free = birdloop_free,
.dump = birdloop_dump,
.memsize = birdloop_memsize,
};
struct birdloop *