From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 22 19:57:49 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 F0E46106564A for ; Thu, 22 Mar 2012 19:57:49 +0000 (UTC) (envelope-from eric.saintetienne@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id A77C28FC12 for ; Thu, 22 Mar 2012 19:57:49 +0000 (UTC) Received: by ggnk4 with SMTP id k4so2621923ggn.13 for ; Thu, 22 Mar 2012 12:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=2dE+vMPUWGXP5cDte6poQDgVHJrRMwI1xmZCc34nItk=; b=Je2hveELowlHTptazNIOjJqaGcdSH/+euaqDAePFgaS6WguOV7OPJcjCiRWLJ7uE5H jgptl112DCiraQBV2MH7PhtunlphOwO5a/2rYWnanq8uuHJwFZhUyVXfNSWE1Y5fqO4I qGALwmFCPFnSaLxu9bD0jHwRDvMkqAQA56h0OVNmdhxl8I/SnE2CVpHCO6i3tR8KtfYJ QKlYo6v7bXVkO6t9jk1Q5X842AV3jKyEgmMmC4lRCa6Zr87GYxaV+faVQ1lCKZC6XOnO MfbfZFraS/Fx9v+Ln/t7oma156ms3P0mSF477RZpZlbLFF/ixsYkL6yfRIdJ3I5V44AX 8W6w== Received: by 10.68.237.1 with SMTP id uy1mr8110507pbc.151.1332446262575; Thu, 22 Mar 2012 12:57:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.47.129 with HTTP; Thu, 22 Mar 2012 12:57:11 -0700 (PDT) In-Reply-To: References: From: Eric Saint-Etienne Date: Thu, 22 Mar 2012 19:57:11 +0000 Message-ID: To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: malloc pages map to user space 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: Thu, 22 Mar 2012 19:57:50 -0000 > If your kernel module creates a device in /dev that implements the > mmap method, then you don't need to worry about mucking around with > vm_maps and objects and whatnot. =C2=A0Your mmap method just needs to be > able to convert offsets into the device into physical memory > addresses, Yes I'm aware of this facility, thank you. > and the vm infrastructure will do the rest for you. Since this mapping is on the main path of the driver, I'm worried that the overhead on each access of a page fault and a function call (the pager associated with a cdev mmap) is too much to bear. So I'd like to do it the "hard" way which I feel is the most optimized. Thanks!