From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHqZ5-0000fn-1r for qemu-devel@nongnu.org; Tue, 28 Jun 2016 06:48:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHqZ0-00031P-U4 for qemu-devel@nongnu.org; Tue, 28 Jun 2016 06:48:22 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:34793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHqZ0-00031L-Mb for qemu-devel@nongnu.org; Tue, 28 Jun 2016 06:48:18 -0400 Received: by mail-wm0-x243.google.com with SMTP id 187so4841328wmz.1 for ; Tue, 28 Jun 2016 03:48:18 -0700 (PDT) Sender: Paolo Bonzini References: <1467104499-27517-1-git-send-email-pl@kamp.de> <1467104499-27517-7-git-send-email-pl@kamp.de> From: Paolo Bonzini Message-ID: <75c05b2d-ced4-cc67-0b22-7f8a34390685@redhat.com> Date: Tue, 28 Jun 2016 12:48:15 +0200 MIME-Version: 1.0 In-Reply-To: <1467104499-27517-7-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/15] exec: use mmap for subpages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, kraxel@redhat.com On 28/06/2016 11:01, Peter Lieven wrote: > a lot of subpages are created and freed at startup, but RCU delays > the freeing so the heap gets fragmented. > > Signed-off-by: Peter Lieven I agree that subpages are bad for malloc because they are large (> 4KiB). It is worth doing something special about them. However, on 32-bit systems mmap-ing them has the same risk of fragmenting the process address space, as malloc has of fragmenting the brk heap. Allocation and freeing of subpages always happens under the BQL, so perhaps a simple freelist is better? Another interesting (but harder) possibility could be to build the radix tree lazily. Paolo