From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754445AbdJLBrG (ORCPT ); Wed, 11 Oct 2017 21:47:06 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:31544 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753059AbdJLBq6 (ORCPT ); Wed, 11 Oct 2017 21:46:58 -0400 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Cc: Marek Szyprowski , Michal Nazarewicz , "Aneesh Kumar K . V" , Joonsoo Kim , Guy Shattah , Christoph Lameter , Anshuman Khandual , Laura Abbott , Vlastimil Babka , Mike Kravetz Subject: [RFC PATCH 0/3] Add mmap(MAP_CONTIG) support Date: Wed, 11 Oct 2017 18:46:08 -0700 Message-Id: <20171012014611.18725-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <21f1ec96-2822-1189-1c95-79a2bb491571@oracle.com> References: <21f1ec96-2822-1189-1c95-79a2bb491571@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following is a 'possible' way to add such functionality. I just did what was easy and pre-allocated contiguous pages which are used to populate the mapping. I did not use any of the higher order allocators such as alloc_contig_range. Therefore, it is limited to allocations of MAX_ORDER size. Also, the allocations should probably be done outside mmap_sem but that was the easiest place to do it in this quick and easy POC. I just wanted to throw out some code to get further ideas. It is far from complete. Mike Kravetz (3): mm/map_contig: Add VM_CONTIG flag to vma struct mm/map_contig: Use pre-allocated pages for VM_CONTIG mappings mm/map_contig: Add mmap(MAP_CONTIG) support include/linux/mm.h | 1 + include/uapi/asm-generic/mman.h | 1 + kernel/fork.c | 2 +- mm/memory.c | 13 +++++- mm/mmap.c | 94 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 109 insertions(+), 2 deletions(-) -- 2.13.6