From patchwork Fri Oct 12 03:59:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10637815 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 BF229933 for ; Fri, 12 Oct 2018 04:00:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A64CB2BDF0 for ; Fri, 12 Oct 2018 04:00:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98D932BE0B; Fri, 12 Oct 2018 04:00:30 +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 F1C242BDF0 for ; Fri, 12 Oct 2018 04:00:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 265666B0006; Fri, 12 Oct 2018 00:00:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 214396B0007; Fri, 12 Oct 2018 00:00:28 -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 104666B0008; Fri, 12 Oct 2018 00:00:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) by kanga.kvack.org (Postfix) with ESMTP id D91CD6B0006 for ; Fri, 12 Oct 2018 00:00:27 -0400 (EDT) Received: by mail-oi1-f198.google.com with SMTP id o204-v6so7561130oif.10 for ; Thu, 11 Oct 2018 21:00:27 -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; bh=NXfcN6TE1EXEeykphs5zkypaDj/8ZR/uXQlIGTmLVcc=; b=VF+uKaxYq9BTWPJXkv6nBLEeRk/vVOlEu6CG89FnXYrdulKhvmz+wisI1LYc1iACcH OJlAnY9pPCnNyVfofIHIu3ItfDPPibmbIt8rG4QF/aficTQ2R1deL1Rahnf3aW0XGmDw kpVwm1t/Gx+HuVaHe3YKR+6eYbymVJG7aIMlmdYAub7wyZb7tGujG6di27Xqv8lmqBky im7Euvp04yFKo9VtakBye+tnXK0cg4v2PzFnXm1x95s3+qyaGTj65xNTFqiZ2MC20nNH DTnXKOlgPrHGc/69RQ/gafaZSJi4rkqmltT/pmSqz4aQbpKyP68M1JV4Cn8drk61iw+/ 8Wyg== 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: ABuFfogFHSTV9XVomKNYnfKV9tuVSebWX1i32oorSNfKjCyBCR8tyzW+ 3ev1/49z5/+WYay9FuvWWpyRlAd8yrGwXDCHlP2Pqu9EC20u15dJJ+11uO3xHeLfXpvF+U/ESat CtS0C60pGAqL56FCp9W7zhI/7kFIpeLttS2xjg1nr1myFNrX9ycbRxwh/lIJ5BuA+KQ== X-Received: by 2002:a9d:19ab:: with SMTP id k40mr2897205otk.66.1539316827620; Thu, 11 Oct 2018 21:00:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV63dhpQG1jOUQw1XSwHI7/5AyViIOaNS6AYoJELH9XcJBYuTP0LFFFkS2AjJ4z4StGBDQLgI X-Received: by 2002:a9d:19ab:: with SMTP id k40mr2897186otk.66.1539316826872; Thu, 11 Oct 2018 21:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539316826; cv=none; d=google.com; s=arc-20160816; b=t3gC24vKmDvdG4HjDkKX27GhVo53ZSJKKw+6RIOhHWKC7ZaiRx1GMi4fSLilnACzKx FQ++UZXDaLN4QFuog3+1fMoQ2ZM8mQCERETIhtzuj1JAvUUSc2XqSkbl4HB8vD3z12Tx bvmVKtKWkwv2bnILQlWxFQ4REaJekoVydziK1sjy6SzMZvDX8A+lzqeJ6L4T5UhquYhh DnlFJSwsV6B+o0+PxM/1+YRrHJR1xJLxfqA6QiapKIx0YzcjniN8Q7bLydAs7453Z6zO Cl4aKAqpggDJ+tB46Nk2EmOxdP7ga0dIFMO7hscKpA71R86YvgSDZ/qhNFdZ7CQwUtf1 XH5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=NXfcN6TE1EXEeykphs5zkypaDj/8ZR/uXQlIGTmLVcc=; b=TPj4jRTRVOPp/ovlnEpbn7iWqI0UsgExi19hu0NZQ4a3eUdgsKAq7x8AhzijEpKbD7 1JpnGimGWfK4T6F694tNMw/WoJQjc8l3OkIjEMklwSnYEOFPD+xTLNuVKLhCaONK0OuL vYjmzlZoTbNRbqJ4Ae25ozo1GKuoRo/y22RXSjTPbuIIZ4HyfoDPVP47jCSkeqCt7YOA KDwuoP9+LmHV/2l82dJg26fxD89kl4FQ4cgd4doR1uP6VXRveaGw7ytcVGxcTl8H9vi6 JFIVmlmW7eJs2HyAu/Ae1UZGi3odGQRczv/O7JX+WD7bzrFvOPFldwi4we59eQz4Xjre ZZtg== 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 w26si8931351otl.265.2018.10.11.21.00.26 for ; Thu, 11 Oct 2018 21:00:26 -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 946C0EBD; Thu, 11 Oct 2018 21:00:25 -0700 (PDT) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.0.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id CA6653F5B7; Thu, 11 Oct 2018 21:00:21 -0700 (PDT) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: suzuki.poulose@arm.com, punit.agrawal@arm.com, will.deacon@arm.com, Steven.Price@arm.com, steve.capper@arm.com, catalin.marinas@arm.com, mhocko@kernel.org, akpm@linux-foundation.org, mike.kravetz@oracle.com, n-horiguchi@ah.jp.nec.com Subject: [PATCH V2 0/5] arm64/mm: Enable HugeTLB migration Date: Fri, 12 Oct 2018 09:29:54 +0530 Message-Id: <1539316799-6064-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 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 This patch series enables HugeTLB migration support for all supported huge page sizes at all levels including contiguous bit implementation. Following HugeTLB migration support matrix has been enabled with this patch series. All permutations have been tested except for the 16GB. CONT PTE PMD CONT PMD PUD -------- --- -------- --- 4K: 64K 2M 32M 1G 16K: 2M 32M 1G 64K: 2M 512M 16G First the series adds migration support for PUD based huge pages. It then adds a platform specific hook to query an architecture if a given huge page size is supported for migration while also providing a default fallback option preserving the existing semantics which just checks for (PMD|PUD|PGDIR)_SHIFT macros. The last two patches enables HugeTLB migration on arm64 and subscribe to this new platform specific hook by defining an override. The second patch differentiates between movability and migratability aspects of huge pages and implements hugepage_movable_supported() which can then be used during allocation to decide whether to place the huge page in movable zone or not. Changes in V2: - Added a new patch which differentiates migratability and movability of huge pages and implements hugepage_movable_supported() function as suggested by Michal Hocko. Anshuman Khandual (5): mm/hugetlb: Enable PUD level huge page migration mm/hugetlb: Distinguish between migratability and movability mm/hugetlb: Enable arch specific huge page size support for migration arm64/mm: Enable HugeTLB migration arm64/mm: Enable HugeTLB migration for contiguous bit HugeTLB pages arch/arm64/Kconfig | 4 ++++ arch/arm64/include/asm/hugetlb.h | 5 +++++ arch/arm64/mm/hugetlbpage.c | 20 +++++++++++++++++ include/linux/hugetlb.h | 48 +++++++++++++++++++++++++++++++++++++--- mm/hugetlb.c | 2 +- 5 files changed, 75 insertions(+), 4 deletions(-) Reviewed-by: Naoya Horiguchi