|
From: | Avi Kivity |
Subject: | Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region |
Date: | Tue, 26 Jul 2011 15:04:28 +0300 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc15 Thunderbird/3.1.11 |
On 07/26/2011 02:51 PM, Paolo Bonzini wrote:
On 07/26/2011 01:38 PM, Avi Kivity wrote:if (j != i) {+ memmove(&view->ranges[i], &view->ranges[j], + (view->nr - j) * sizeof(view->ranges[j])); + view->nr -= j - i; + }}Seems to work both ways?Sure, but you're pointlessly memmove-ing memory over itself. I'm not sure how many segments a single memory region will usually have, but it's better to be safe.
This will never be an issue in practice. We expect to have few FlatRanges (O(100)), simplify() will be called very rarely (never during normal operations; a few dozen times during boot; a few during hotplug); everything is in L1 cache; and the cost will be dwarfed by any calls to kvm (if enabled).
-- error compiling committee.c: too many arguments to function
[Prev in Thread] | Current Thread | [Next in Thread] |