From c5b6b184135b898a22c2a5ab9690c570c3def603 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Thu, 2 Dec 2021 11:29:59 +0000 Subject: Standby memory pages are accounted for as overhead in show memory command --- sysdep/unix/io-loop.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sysdep') diff --git a/sysdep/unix/io-loop.c b/sysdep/unix/io-loop.c index a9927b39..0611e096 100644 --- a/sysdep/unix/io-loop.c +++ b/sysdep/unix/io-loop.c @@ -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 * -- cgit v1.2.3