mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Can avic_vm_id_bitmap be made smaller? 2 mbytes feels too large
@ 2017-06-21 18:28 Denys Vlasenko
  0 siblings, 0 replies; only message in thread
From: Denys Vlasenko @ 2017-06-21 18:28 UTC (permalink / raw)
  To: Suravee Suthikulpanit; +Cc: LKML, Radim Krčmář

#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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-21 18:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21 18:28 Can avic_vm_id_bitmap be made smaller? 2 mbytes feels too large Denys Vlasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®