From patchwork Tue Sep 25 02:08:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10613227 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DAADC913 for ; Tue, 25 Sep 2018 02:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0E172A12F for ; Tue, 25 Sep 2018 02:08:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B52782A13B; Tue, 25 Sep 2018 02:08:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 434FA2A12F for ; Tue, 25 Sep 2018 02:08:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 21C038E0057; Mon, 24 Sep 2018 22:08:45 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1A46E8E0041; Mon, 24 Sep 2018 22:08:45 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0449A8E0057; Mon, 24 Sep 2018 22:08:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by kanga.kvack.org (Postfix) with ESMTP id C743B8E0041 for ; Mon, 24 Sep 2018 22:08:44 -0400 (EDT) Received: by mail-ot1-f69.google.com with SMTP id e69-v6so8987850ote.17 for ; Mon, 24 Sep 2018 19:08:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=uDCC5dCzSm3R3Ghg1BmgC88h7+mfZilbEiz1C6llNpw=; b=hSO0qF3xz9AYmOFrwPe/mML5xUlgziJXCl7r7Mqr6NcXYrlTniI40KOsPcoCS64eWQ d+h82RG+SzQKNMykrk7IBQOeD4z+V7vVpd009mTMbHos+sv6Bx4IWNS9EK1I3vu2wGGk ODwzZoc47CT63YqQjmm8m4xkPzPzfcZ2w74yHIB4Ws/to28HSWqtVQPkFOth81jb2tA/ DfAkK+6oUO2Xv54UWkqT0RbQ9ZWRCMIu4/SAZ1/kV8Elxi7k4f4g3FhR3pKfjNWHhiBw 41yXGsIwiIszI1odRALzMf6mm6fF2Nh7aE9RmCGTlHjvhxxy7h1vY0P3Zg8UAbx7RIjq 6efw== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-Gm-Message-State: ABuFfoia2uQuQTG0dnfAzk9i7SOf+IIMZ8ZKor8OyPNcl3Rmpb3zK7Bg FECKoag+P7b0Cc8iwYAPjiQuP2t//jwi5ti6JY6xzgpMFDZXQwWUDpiFIGv/GorN/6Yba5dFmY0 Bg31BvtKseVkp8XhcAv36T6O9T8y1oOsCTqvKO9vL3eFTX0w0HKJ2RJe+d48IAMhvWw== X-Received: by 2002:a9d:a8a:: with SMTP id 10-v6mr1193115otq.16.1537841324568; Mon, 24 Sep 2018 19:08:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV63S6VhJFc2EU2bLldy+j/T64sSBlEN2m6sszKrQl9NIOYdsNO8ZNThTqtZZK4wcd/JT7Zme X-Received: by 2002:a9d:a8a:: with SMTP id 10-v6mr1193086otq.16.1537841323736; Mon, 24 Sep 2018 19:08:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537841323; cv=none; d=google.com; s=arc-20160816; b=IDcgN0Em0YGOIB/Nd/q7IuQozUDfWmkGGLR8PMkrmdU6tKnBk3O41NE9lD/t3yXxzT eEOaTSANnOC5oOrmQaSmMgFFwnOoKVqZwgIYrErZ5xTUbwKQdg0B8+05G4yPh+FCAHmR Mm6V+gLmWumg/ABVd/JJo2/NwVczySTqedZif02F9JxPKPwzV8qMCXSV6tCDYGz9oMu9 QtwlIAKmzMKMw7aZN9vdOf+FHZHdWJfu1MTVwIyGd6OcljXtf8ZosJMO1bRIFKE5Vx8t kYhorQedh5n8b4CCoD7Ym1+h3PqZotITufOyACfh6xZpU1J4ZRtweYPTUJ2S+PH0Egha NZRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=uDCC5dCzSm3R3Ghg1BmgC88h7+mfZilbEiz1C6llNpw=; b=HRz/GW6Oyz72ZAs9d9yq2gbuN7c5aaMGy8ZFmSw8hpeWH7E4j9S7yAdeKfN0Biv39Y qnIBCPqBUkxCDdMUXCQB+shSgYiLxmHy7uMlRyW6nneWlO42KewUnE3K4mQkFSkb8P0V ukxh6f5FGRGp2nMckssns6/3tuouXW9tI2bYVFl7UjOgG0KrxP9fYgOVKv2ZyRM8MxN2 ARVKTufFIdOLwgD4lHcZ5hmT9WDfkVxqoKZwheYzgWwuqGasBuFIkO2pXfFpPkBbpjoI hqCONWmWu+341EoCNNgXOX0O7FquuHwaEOVW0HNbk6csFghhSkDSUzWGVLUSb39HEs/B eeLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id y31-v6si501393ota.295.2018.09.24.19.08.43 for ; Mon, 24 Sep 2018 19:08:43 -0700 (PDT) Received-SPF: pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) client-ip=217.140.101.70; Authentication-Results: mx.google.com; spf=pass (google.com: domain of anshuman.khandual@arm.com designates 217.140.101.70 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65CED7A9; Mon, 24 Sep 2018 19:08:42 -0700 (PDT) Received: from p8cg001049571a15.arm.com (unknown [10.163.1.125]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3E4E53F5B3; Mon, 24 Sep 2018 19:08:40 -0700 (PDT) From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: mike.kravetz@oracle.com, mhocko@kernel.org, punit.agrawal@arm.com, will.deacon@arm.com, akpm@linux-foundation.org Subject: [PATCH V2] mm/hugetlb: Add mmap() encodings for 32MB and 512MB page sizes Date: Tue, 25 Sep 2018 07:38:20 +0530 Message-Id: <1537841300-6979-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537797985-2406-1-git-send-email-anshuman.khandual@arm.com> References: <1537797985-2406-1-git-send-email-anshuman.khandual@arm.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP ARM64 architecture also supports 32MB and 512MB HugeTLB page sizes. This just adds mmap() system call argument encoding for them. Signed-off-by: Anshuman Khandual Acked-by: Punit Agrawal Acked-by: Mike Kravetz --- Changes in V2: - Updated SHM and MFD definitions per Mike include/uapi/asm-generic/hugetlb_encode.h | 2 ++ include/uapi/linux/memfd.h | 2 ++ include/uapi/linux/mman.h | 2 ++ include/uapi/linux/shm.h | 2 ++ 4 files changed, 8 insertions(+) diff --git a/include/uapi/asm-generic/hugetlb_encode.h b/include/uapi/asm-generic/hugetlb_encode.h index e4732d3..b0f8e87 100644 --- a/include/uapi/asm-generic/hugetlb_encode.h +++ b/include/uapi/asm-generic/hugetlb_encode.h @@ -26,7 +26,9 @@ #define HUGETLB_FLAG_ENCODE_2MB (21 << HUGETLB_FLAG_ENCODE_SHIFT) #define HUGETLB_FLAG_ENCODE_8MB (23 << HUGETLB_FLAG_ENCODE_SHIFT) #define HUGETLB_FLAG_ENCODE_16MB (24 << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_32MB (25 << HUGETLB_FLAG_ENCODE_SHIFT) #define HUGETLB_FLAG_ENCODE_256MB (28 << HUGETLB_FLAG_ENCODE_SHIFT) +#define HUGETLB_FLAG_ENCODE_512MB (29 << HUGETLB_FLAG_ENCODE_SHIFT) #define HUGETLB_FLAG_ENCODE_1GB (30 << HUGETLB_FLAG_ENCODE_SHIFT) #define HUGETLB_FLAG_ENCODE_2GB (31 << HUGETLB_FLAG_ENCODE_SHIFT) #define HUGETLB_FLAG_ENCODE_16GB (34 << HUGETLB_FLAG_ENCODE_SHIFT) diff --git a/include/uapi/linux/memfd.h b/include/uapi/linux/memfd.h index 015a4c0..7a8a267 100644 --- a/include/uapi/linux/memfd.h +++ b/include/uapi/linux/memfd.h @@ -25,7 +25,9 @@ #define MFD_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB #define MFD_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB #define MFD_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB +#define MFD_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB #define MFD_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB +#define MFD_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB #define MFD_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB #define MFD_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB #define MFD_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB diff --git a/include/uapi/linux/mman.h b/include/uapi/linux/mman.h index bfd5938..d0f515d 100644 --- a/include/uapi/linux/mman.h +++ b/include/uapi/linux/mman.h @@ -28,7 +28,9 @@ #define MAP_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB #define MAP_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB #define MAP_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB +#define MAP_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB #define MAP_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB +#define MAP_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB #define MAP_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB #define MAP_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB #define MAP_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB diff --git a/include/uapi/linux/shm.h b/include/uapi/linux/shm.h index dde1344..6507ad0 100644 --- a/include/uapi/linux/shm.h +++ b/include/uapi/linux/shm.h @@ -65,7 +65,9 @@ struct shmid_ds { #define SHM_HUGE_2MB HUGETLB_FLAG_ENCODE_2MB #define SHM_HUGE_8MB HUGETLB_FLAG_ENCODE_8MB #define SHM_HUGE_16MB HUGETLB_FLAG_ENCODE_16MB +#define SHM_HUGE_32MB HUGETLB_FLAG_ENCODE_32MB #define SHM_HUGE_256MB HUGETLB_FLAG_ENCODE_256MB +#define SHM_HUGE_512MB HUGETLB_FLAG_ENCODE_512MB #define SHM_HUGE_1GB HUGETLB_FLAG_ENCODE_1GB #define SHM_HUGE_2GB HUGETLB_FLAG_ENCODE_2GB #define SHM_HUGE_16GB HUGETLB_FLAG_ENCODE_16GB