[<prev] [next>] [day] [month] [year] [list]
Message-ID: <238915be-22f4-4ea3-addf-0e06700f3c1e@redhat.com>
Date: Wed, 21 Jun 2017 20:28:48 +0200
From: Denys Vlasenko <dvlasenk@...hat.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Radim Krčmář <rkrcmar@...hat.com>
Subject: Can avic_vm_id_bitmap be made smaller? 2 mbytes feels too large
#define AVIC_VM_ID_BITS 24
#define AVIC_VM_ID_NR (1 << AVIC_VM_ID_BITS)
...
static DECLARE_BITMAP(avic_vm_id_bitmap, AVIC_VM_ID_NR);
The above results in a data object which is 2 megabytes large.
avic_vm_init() -> avic_get_next_vm_id() allocates a new vm_id
by looking for a free bit there. That's the whole purpose
for that bitmap existing.
Is there a way to do this less wastefully? Say, such as
iterating over all existing VMs and picking an id which is
not taken.
I imagine VM creation operation is not that frequent, no need
to make new vm_id selection super fast.
Powered by blists - more mailing lists