vhost: support upto 509 memory regions
Subsystems (4)
PATCH 1/1 vhost: support upto 509 memory regions
since commit
1d4e7e3 kvm: x86: increase user memory slots to 509
it became possible to use a bigger amount of memory slots, which is used by memory hotplug for registering hotplugged memory.
However QEMU aborts if it's used with more than ~60 pc-dimm devices and vhost-net since host kernel in module vhost-net refuses to accept more than 65 memory regions.
Increasing VHOST_MEMORY_MAX_NREGIONS from 65 to 509 to match KVM_USER_MEM_SLOTS fixes issue for vhost-net.
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vhost.c +1 -1
@@ -29,7 +29,7 @@#include "vhost.h" enum { -VHOST_MEMORY_MAX_NREGIONS =64 , +VHOST_MEMORY_MAX_NREGIONS =509 ,VHOST_MEMORY_F_LOG =0x1 , };
Signature · 1 line
1.8.3.1
Michael S. Tsirkin
maintainerQuoted 11 lines · Igor Mammedov
since commit
1d4e7e3 kvm: x86: increase user memory slots to 509it became possible to use a bigger amount of memory slots, which is used by memory hotplug for registering hotplugged memory.
However QEMU aborts if it's used with more than ~60 pc-dimm devices and vhost-net since host kernel in module vhost-net refuses to accept more than 65 memory regions.
Quoted 4 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Signed-off-by Igor Mammedov <[email protected]>
This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
How does kvm handle this issue?
Quoted 19 lines
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vhost.c +1
-1@@ -29,7 +29,7 @@#include "vhost.h" enum { -VHOST_MEMORY_MAX_NREGIONS =64 , +VHOST_MEMORY_MAX_NREGIONS =509 ,VHOST_MEMORY_F_LOG =0x1 , };Signature · 1 line
1.8.3.1
Paolo Bonzini
maintainerQuoted 7 lines · Michael S. Tsirkin
Quoted 4 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
Michael S. Tsirkin
maintainerQuoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11
To avoid libc reusing the memory holes, reserve them with MAP_NORESERVE or something like this.
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
Signature · 1 line
MST
Paolo Bonzini
maintainerQuoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
If memory is _that_ fragmented I think you have much bigger problems than vhost.
Quoted 1 line
I'm guessing kvm doesn't do memory scans on data path, vhost does.
It does for MMIO memory-to-memory writes, but that's not a particularly fast path.
KVM doesn't access the memory map on fast paths, but QEMU does, so I don't think it's beyond the expectations of the kernel. For example you can use a radix tree (not lib/radix-tree.c unfortunately), and cache GVA->HPA translations if it turns out that lookup has become a hot path.
The addressing space of x86 is in practice 44 bits or fewer, and each slot will typically be at least 1 GiB, so you only have 14 bits to
dispatch on. It's probably possible to only have two or three levels
in the radix tree in the common case, and beat the linear scan real quick.
The radix tree can be tuned to use order-0 allocations, and then your worries about fragmentation go away too.
Paolo
Michael S. Tsirkin
maintainerQuoted 22 lines · Paolo Bonzini
Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
If memory is _that_ fragmented I think you have much bigger problems than vhost.
Quoted 7 lines
Quoted 1 line
I'm guessing kvm doesn't do memory scans on data path, vhost does.
It does for MMIO memory-to-memory writes, but that's not a particularly fast path.
KVM doesn't access the memory map on fast paths, but QEMU does, so I don't think it's beyond the expectations of the kernel.
QEMU has an elaborate data structure to deal with that.
Quoted 3 lines
For example you
can use a radix tree (notlib/radix-tree.cunfortunately), and cacheGVA->HPAtranslations if it turns out that lookup has become a hot path.
All vhost lookups are hot path.
Quoted 4 lines
The addressing space of x86 is in practice 44 bits or fewer, and each slot will typically be at least 1 GiB, so you only have 14 bits to
dispatch on. It's probably possible to only have two or three levels
in the radix tree in the common case, and beat the linear scan real quick.
Not if there are about 6 regions, I think.
Quoted 4 lines
The radix tree can be tuned to use order-0 allocations, and then your worries about fragmentation go away too.
Paolo
Increasing the number might be reasonable for workloads such as nested virt. But depending on this in userspace when you don't have to is not a good idea IMHO.
Signature · 1 line
MST
Paolo Bonzini
maintainerQuoted 25 lines · Michael S. Tsirkin
Quoted 24 lines · Paolo Bonzini
Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
If memory is _that_ fragmented I think you have much bigger problems than vhost.
Quoted 1 line
I'm guessing kvm doesn't do memory scans on data path, vhost does.
Quoted 7 lines
Quoted 5 lines
It does for MMIO memory-to-memory writes, but that's not a particularly fast path.
KVM doesn't access the memory map on fast paths, but QEMU does, so I don't think it's beyond the expectations of the kernel.
QEMU has an elaborate data structure to deal with that.
It's not elaborate, it's just a radix tree. The complicated part is building the flat view and computing what changed in the memory map, but none of this would have to be done in vhost. vhost gets the flat memory map in VHOST_SET_MEM_TABLE.
A lookup is basically:
#define LOG_TRIE_WIDTH (PAGE_SHIFT - LOG_BITS_PER_LONG)
unsigned long node_val = (unsigned long) trie_root; /* log of highest valid address in the memory map */ if (addr & (-1U << vhost_address_space_bits))
return NULL;
addr <<= 64 - vhost_address_space_bits;
do {
struct memmap_trie_node *node;
unsigned i = addr >> (64 - LOG_TRIE_WIDTH);
addr = addr << LOG_TRIE_WIDTH;
node = (struct memmap_trie_node *) (node_val - 1);
node_val = (unsigned long) node[i];
} while (node_val & 1);return (struct vhost_mem_slot *)node_val;
bit 0: 0 if leaf
if leaf:
bits 1-63: pointer to mem table entry
if not leaf:
bits 1-63: pointer to next level
Quoted 5 lines
Quoted 3 lines
For example you
can use a radix tree (notlib/radix-tree.cunfortunately), and cacheGVA->HPAtranslations if it turns out that lookup has become a hot path.All vhost lookups are hot path.
What % is lookup vs the networking stuff? Also, adding a simple MRU cache might make lookups less prominent in the profile.
Quoted 6 lines
Quoted 4 lines
The addressing space of x86 is in practice 44 bits or fewer, and each slot will typically be at least 1 GiB, so you only have 14 bits to
dispatch on. It's probably possible to only have two or three levels
in the radix tree in the common case, and beat the linear scan real quick.Not if there are about 6 regions, I think.
It depends on many factors including branch prediction, MRU cache hits, etc.
Quoted 2 lines
Increasing the number might be reasonable for workloads such as nested virt.
Why does nested virt matter?
Paolo
Quoted 37 lines · On Tue, 17 Feb 2015 14:29:31 +0100 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 22 lines · Paolo Bonzini
Quoted 7 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
If memory is _that_ fragmented I think you have much bigger problems than vhost.
Quoted 7 lines
Quoted 1 line
I'm guessing kvm doesn't do memory scans on data path, vhost does.
It does for MMIO memory-to-memory writes, but that's not a particularly fast path.
KVM doesn't access the memory map on fast paths, but QEMU does, so I don't think it's beyond the expectations of the kernel.
QEMU has an elaborate data structure to deal with that.
Quoted 3 lines
For example you
can use a radix tree (notlib/radix-tree.cunfortunately), and cacheGVA->HPAtranslations if it turns out that lookup has become a hot path.
Quoted 8 lines
All vhost lookups are hot path.
Quoted 4 lines
The addressing space of x86 is in practice 44 bits or fewer, and each slot will typically be at least 1 GiB, so you only have 14 bits to
dispatch on. It's probably possible to only have two or three levels
in the radix tree in the common case, and beat the linear scan real quick.Not if there are about 6 regions, I think.
When memslots where increased to 509 and look up of them was replaced on binary search results were on par with linear search for a default 13 memslots VM.
Adding LRU cache helped to shave ~40% of cycles for sequential lookup workloads.
Quoted 11 lines
Quoted 5 lines
The radix tree can be tuned to use order-0 allocations, and then your worries about fragmentation go away too.
Paolo
Increasing the number might be reasonable for workloads such as nested virt. But depending on this in userspace when you don't have to is not a good idea IMHO.
Paolo Bonzini
maintainerQuoted 6 lines · Igor Mammedov
Quoted 2 lines
Quoted 2 lines
Not if there are about 6 regions, I think.
When memslots where increased to 509 and look up of them was replaced on binary search results were on par with linear search for a default 13 memslots VM.
Adding LRU
You mean MRU. :)
Quoted 1 line
cache helped to shave ~40% of cycles for sequential lookup workloads.
It's a bit different for vhost because you can have up to four "things" being looked up at the same time:
- the s/g list that will end up in the skb
- the avail/used ring
- the virtio buffers
- the virtio indirect buffers
So you probably need multiple MRU caches. But yes, MRU can help a lot.
Paolo
Quoted 27 lines · On Tue, 17 Feb 2015 13:32:12 +0100 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Quoted 8 lines
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11To avoid libc reusing the memory holes, reserve them with
MAP_NORESERVEor something like this.
Lets suppose that we add API to reserve whole memory hotplug region with MAP_NORESERVE and passed it as memslot to KVM.
Then what will happen to guest accessing not really mapped region? This memslot will also be passed to vhost as region, is it really ok? I don't know what else it might break.
As alternative:
we can filter out hotplugged memory and vhost will continue to work with only initial memory.
So question is id we have to tell vhost about hotplugged memory?
Quoted 6 lines
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
Paolo Bonzini
maintainerQuoted 4 lines · Igor Mammedov
As alternative:
we can filter out hotplugged memory and vhost will continue to work with only initial memory.
So question is id we have to tell vhost about hotplugged memory?
Yes, I think so.
Paolo
Quoted 27 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Quoted 8 lines
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11To avoid libc reusing the memory holes, reserve them with
MAP_NORESERVEor something like this.
This works beautifully when host virtual address bits are more plentiful than guest physical address bits. Not all architectures have that property, though.
Quoted 11 lines
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
--
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Michael S. Tsirkin
maintainerQuoted 34 lines · Eric Northup
Quoted 33 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11
Quoted 6 lines
Quoted 2 lines
To avoid libc reusing the memory holes, reserve them with
MAP_NORESERVEor something like this.This works beautifully when host virtual address bits are more plentiful than guest physical address bits. Not all architectures have that property, though.
AFAIK this is pretty much a requirement for both kvm and vhost, as we require each guest page to also be mapped in qemu memory.
Quoted 11 lines
Quoted 11 lines
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
--
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 56 lines · Michael S. Tsirkin
Quoted 34 lines · Eric Northup
Quoted 33 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11Quoted 6 lines
Quoted 2 lines
To avoid libc reusing the memory holes, reserve them with
MAP_NORESERVEor something like this.This works beautifully when host virtual address bits are more plentiful than guest physical address bits. Not all architectures have that property, though.
AFAIK this is pretty much a requirement for both kvm and vhost, as we require each guest page to also be mapped in qemu memory.
Quoted 11 lines
Quoted 11 lines
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
--
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello,
any chance of getting the proposed patch in the mainline? Though it seems that most users will not suffer from relatively slot number ceiling (they can decrease slot 'granularity' for larger VMs and vice-versa), fine slot size, 256M or even 128M, with the large number of slots can be useful for a certain kind of tasks for an orchestration systems. I`ve made a backport series of all seemingly interesting memslot-related improvements to a 3.10 branch, is it worth to be tested with straighforward patch like one from above, with simulated fragmentation of allocations in host?
Michael S. Tsirkin
maintainerQuoted 65 lines · Andrey Korolyov
Quoted 56 lines · Michael S. Tsirkin
Quoted 34 lines · Eric Northup
Quoted 33 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11Quoted 6 lines
Quoted 2 lines
To avoid libc reusing the memory holes, reserve them with
MAP_NORESERVEor something like this.This works beautifully when host virtual address bits are more plentiful than guest physical address bits. Not all architectures have that property, though.
AFAIK this is pretty much a requirement for both kvm and vhost, as we require each guest page to also be mapped in qemu memory.
Quoted 11 lines
Quoted 11 lines
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
--
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlHello,
Quoted 9 lines
any chance of getting the proposed patch in the mainline? Though it seems that most users will not suffer from relatively slot number ceiling (they can decrease slot 'granularity' for larger VMs and vice-versa), fine slot size, 256M or even 128M, with the large number of slots can be useful for a certain kind of tasks for an orchestration systems. I`ve made a backport series of all seemingly interesting memslot-related improvements to a 3.10 branch, is it worth to be tested with straighforward patch like one from above, with simulated fragmentation of allocations in host?
I'd rather people worked on the 1:1 mapping, it will also speed up lookups. I'm concerned if I merge this one, motivation for people to work on the right fix will disappear.
Signature · 1 line
MST
Quoted 65 lines · On Mon, 18 May 2015 19:22:34 +0300 Andrey Korolyov <[email protected]> wrote:
Quoted 56 lines · Michael S. Tsirkin
Quoted 34 lines · Eric Northup
Quoted 33 lines · Michael S. Tsirkin
Quoted 6 lines · Paolo Bonzini
Quoted 3 lines · Michael S. Tsirkin
Quoted 3 lines
Increasing
VHOST_MEMORY_MAX_NREGIONSfrom 65 to 509 to matchKVM_USER_MEM_SLOTSfixes issue for vhost-net.Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Igor Mammedov <[email protected]>This scares me a bit: each region is 32byte, we are talking a 16K allocation that userspace can trigger.
What's bad with a 16K allocation?
It fails when memory is fragmented.
Quoted 5 lines
Quoted 1 line
How does kvm handle this issue?
It doesn't.
Paolo
I'm guessing kvm doesn't do memory scans on data path, vhost does.
qemu is just doing things that kernel didn't expect it to need.
Instead, I suggest reducing number of GPA<->HVA mappings:
you have GPA 1,5,7
map them at HVA 11,15,17
then you can have 1 slot: 1->11Quoted 6 lines
Quoted 2 lines
To avoid libc reusing the memory holes, reserve them with
MAP_NORESERVEor something like this.This works beautifully when host virtual address bits are more plentiful than guest physical address bits. Not all architectures have that property, though.
AFAIK this is pretty much a requirement for both kvm and vhost, as we require each guest page to also be mapped in qemu memory.
Quoted 11 lines
Quoted 11 lines
We can discuss smarter lookup algorithms but I'd rather userspace didn't do things that we then have to work around in kernel.
--
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlQuoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlHello,
Quoted 9 lines
any chance of getting the proposed patch in the mainline? Though it seems that most users will not suffer from relatively slot number ceiling (they can decrease slot 'granularity' for larger VMs and vice-versa), fine slot size, 256M or even 128M, with the large number of slots can be useful for a certain kind of tasks for an orchestration systems. I`ve made a backport series of all seemingly interesting memslot-related improvements to a 3.10 branch, is it worth to be tested with straighforward patch like one from above, with simulated fragmentation of allocations in host?
I'm almost done with approach suggested by Paolo, i.e. replace linear search with faster/scalable lookup alg. Hope to post it soon.
Quoted 4 lines
--
To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html