From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL7dD-0003rw-Aq for qemu-devel@nongnu.org; Wed, 05 Mar 2014 03:56:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WL7d7-0004uM-C1 for qemu-devel@nongnu.org; Wed, 05 Mar 2014 03:56:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WL7d7-0004uH-3c for qemu-devel@nongnu.org; Wed, 05 Mar 2014 03:56:45 -0500 Message-ID: <5316E6C3.3030502@redhat.com> Date: Wed, 05 Mar 2014 09:56:35 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC] support memory reserved feature and optimize mlock guest memory propose List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhanghailiang , "quintela@redhat.com" , "edgar.iglesias@xilinx.com" , Stefan Hajnoczi , "kwolf@redhat.com" , "qemu-devel@nongnu.org" , "libvir-list@redhat.com" Cc: Zhouxiangjiu , Huazhiqiang , Huangzhichao , "Huangpeng (Peter)" Il 05/03/2014 09:01, Zhanghailiang ha scritto: > Hi all=A3=BA >=20 > Currently, we use cgroup(memory) to support memory QoS on KVM platform, > and use "mlock" on qemu to support "memory reserved". >=20 > The "mlock" seems to be not appropriate. >=20 > Now qemu "mlock" memory in the main thread, which would lock iothread > (qemu_mutex_lock_iothread), if the memory size is large, that will > consume lots of time. >=20 > It means whenever we want to set a new 'mlock', the VM would be blocked > for a while. I'm not sure I understand how the mlock-ed memory is used. Are you using a custom malloc, for example with g_mem_set_vtable? Paolo