WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH] xen: Avoid useless allocation in Xen case.

To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] xen: Avoid useless allocation in Xen case.
From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
Date: Tue, 02 Aug 2011 12:49:05 +0200
Cc: Alexander Graf <agraf@xxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, QEMU-devel <qemu-devel@xxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Tue, 02 Aug 2011 03:50:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E37052E.70707@xxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1312226782-26882-1-git-send-email-anthony.perard@xxxxxxxxxx> <4E37052E.70707@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666
On 2011-08-01 21:57, Jan Kiszka wrote:
> On 2011-08-01 21:26, Anthony PERARD wrote:
>> The code_gen_buffer is not use by Xen and can be really big (several
>> GB). Even if the host RAM is not used, this buffer just burn the address
>> space of the QEMU process.
>>
>> So to "avoid" this allocation, the asked tb_size is set to the minimum.
>>
>> The other way to do that would be to not call code_gen_alloc when Xen is
>> enabled.
>>
>> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
>> ---
>>  vl.c |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/vl.c b/vl.c
>> index d8c7c01..bd60a89 100644
>> --- a/vl.c
>> +++ b/vl.c
>> @@ -3106,6 +3106,14 @@ int main(int argc, char **argv, char **envp)
>>          }
>>      }
>>  
>> +    if (xen_enabled()) {
>> +        /* Allocate only the minimum amount of memory for the 
>> code_gen_buffer.
>> +         * Xen does not use it and we need the virtual address space for the
>> +         * MapCache.
>> +         */
>> +        tb_size = 1;
>> +    }
>> +
> 
> The same applies to kvm, please generalize.

Actually, qemu-kvm avoids this overhead today by making code_gen_alloc
return immediately when kvm is on. Also not very beautiful.

Can't we simply skip cpu_exec_init_all for any accel != TCG, e.g. by
moving that call to tcg_init?

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel