summaryrefslogtreecommitdiff
path: root/sysdep/unix/io-loop.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@jmq.cz>2021-12-02 11:29:59 +0000
committerMaria Matejka <mq@jmq.cz>2021-12-02 11:29:59 +0000
commitc5b6b184135b898a22c2a5ab9690c570c3def603 (patch)
tree52b55c426e6885ed5eec6c087edfa3d61d13f7ad /sysdep/unix/io-loop.c
parent38278d94ba0a179d5eeb061a59850a4e1c150e5b (diff)
Standby memory pages are accounted for as overhead in show memory command
Diffstat (limited to 'sysdep/unix/io-loop.c')
-rw-r--r--sysdep/unix/io-loop.c11
1 files changed, 11 insertions, 0 deletions
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 *