From owner-freebsd-hackers@FreeBSD.ORG Sun May 20 07:01:51 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484E4106564A; Sun, 20 May 2012 07:01:51 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.zvne.fer.hr (mail.zvne.fer.hr [161.53.66.5]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7A78FC08; Sun, 20 May 2012 07:01:50 +0000 (UTC) Received: from munja.zvne.fer.hr (161.53.66.248) by mail.zvne.fer.hr (161.53.66.5) with Microsoft SMTP Server id 14.2.298.4; Sun, 20 May 2012 09:01:43 +0200 Received: from sluga.fer.hr ([161.53.66.244]) by munja.zvne.fer.hr with Microsoft SMTPSVC(6.0.3790.4675); Sun, 20 May 2012 09:01:43 +0200 Received: from localhost ([161.53.19.8]) by sluga.fer.hr with Microsoft SMTPSVC(6.0.3790.4675); Sun, 20 May 2012 09:01:42 +0200 From: Marko Zec To: Date: Sun, 20 May 2012 09:01:32 +0200 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <201205200901.32613.zec@fer.hr> X-OriginalArrivalTime: 20 May 2012 07:01:42.0696 (UTC) FILETIME=[69658280:01CD3656] Cc: freebsd-amd64@freebsd.org Subject: superpages and kmem on amd64 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2012 07:01:51 -0000 Hi all, I'm playing with an algorithm which makes use of large contiguous blocks of kernel memory (ranging from 1M to 1G in size), so it would be nice if those could be somehow forcibly mapped to superpages. I was hoping that the VM system would automagically map (merge) contiguous 4k pages to superpages, but apparently it doesn't: vm.pmap.pdpe.demotions: 2 vm.pmap.pde.promotions: 543 vm.pmap.pde.p_failures: 266253 vm.pmap.pde.mappings: 0 vm.pmap.pde.demotions: 31 I.e. I have 1G of kmem allocated using via malloc(1024 * 1024 * 1024, M_TEMP, M_NOWAIT); but vm.pmap.pde.mappings: 0 suggests that no superpages are in use. Is there an alternative kernel memory allocation method which might force superpages to be used for contiguous memory blocks? And how do I find more details about page mappings for a given kmem virtual address? I'm running 8.3-STABLE on amd64. Thanks, Marko