From patchwork Tue Dec 18 08:24:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10735101 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 CB7061399 for ; Tue, 18 Dec 2018 08:24:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB7682A5F0 for ; Tue, 18 Dec 2018 08:24:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFF2D2A644; Tue, 18 Dec 2018 08:24:08 +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 41A8F2A5F0 for ; Tue, 18 Dec 2018 08:24:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5853B8E0004; Tue, 18 Dec 2018 03:24:07 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 50FA78E0001; Tue, 18 Dec 2018 03:24:07 -0500 (EST) 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 3FD3D8E0004; Tue, 18 Dec 2018 03:24:07 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by kanga.kvack.org (Postfix) with ESMTP id 0DED38E0001 for ; Tue, 18 Dec 2018 03:24:07 -0500 (EST) Received: by mail-ot1-f70.google.com with SMTP id g4so9101150otl.14 for ; Tue, 18 Dec 2018 00:24:07 -0800 (PST) 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=5ZBYDo4as6ZvStWUy4h2Kbzx9hI+uc4AtBwQUqL7tig=; b=iZDlXMzEiOzkjKkzpo+rAzsUUk1a5kSG0scpC8RvdYKTnvbaX/OJ6nnoWKWeS0x2Ni vgklCGoHtFxZF+pim9r/sbo7hxDvo6gvr7PcoVsvlCEjqbxquhicsttyY467wW8/t9A0 tNpfaXO32is98Ggr+eJiSLiaS5FAmHP3eLz1Wf0BVvCPw2a6wJLm35nahlvtkqIb/qhA j+VBha0TOasEAhOkXgYGSBQeuK8BG59IhHFNaebxVsNOVNvQZGEkBwLutXJH3cank8f7 pTfA/ECZqZpNTVW6Mzlogz4pQsLrfvCFIw0FjEGLpmsxRBnAVCE3Bd/B9JUwBU0MNwyv CDhw== 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: AA+aEWasgBzda+ho4K//dX+QpAlyo+EJBPl41D26vYUL95s55jxeIrUZ B/9vfxdV7CeL5/wiCqmNgT/EZ9VZbipqNHFtczhk1SSqOPBktPzILRGMS47dlqM7S8gRI5B30Ny 2poFBwLehs1olbUuwt1wom3IJnqvuWf6SvnM2iR4lsl+InuKRr2vG3AVNb25FACbF8Q== X-Received: by 2002:aca:c715:: with SMTP id x21mr6908479oif.139.1545121446723; Tue, 18 Dec 2018 00:24:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/WNoHBjq9wAhxFwjW4opIxxJsCvzVxiVa2dEMD4M/znWXn51W2nJoYd8BWB7VpId8K3eMs9 X-Received: by 2002:aca:c715:: with SMTP id x21mr6908462oif.139.1545121445930; Tue, 18 Dec 2018 00:24:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121445; cv=none; d=google.com; s=arc-20160816; b=k84ipFRSM8R8HfL+rKCJSqL2CCEh+mu7cEG6QnRTTaz+nQARJ6BRl3eTj9oqcBHSqM Zi5gvPE6T6ZF2O85SoWs0vEyqHl1jluTsW3ZSSqtfBmKEMLuTMz2w98otJOTp/mojVKG WD3UaOwLaqnpvyqxSXlBBOo35lpWEOiEOGLzf3AJZ8+kt1JEiVP6exkVvCfYz3MRZv9f Fdwkb0LhiOe7TL1ZYTNv3rgk5G27jjIv/aFG32RrD36SC9B2y6vNQrPZjYy6xnJAL5JR Lj+/nU9oxbD3V7Wuj7/Bou5nDEZvMxn1rCvNAmfL7gxneqh4CppIsYjXsoC3abgMCCqH +biQ== 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=5ZBYDo4as6ZvStWUy4h2Kbzx9hI+uc4AtBwQUqL7tig=; b=veSEm8K26hbZ2YdDogjZEvXx3gukPE5v1+bODFTmMVDzoTDPz5yLHG6njMdLjYZA4I IoDkLu5rnpla5DaiyXye1KYQ/z5Mw8trJSd3+4OQMpeLTzAjLERg36tsqkbeQAyfmCcx zWfxwU7TRltHwSgwjCneL9fuBHlWQTcAEFTDS7TOJqwMto9wD0dOuQXd+kPjt1jJh3eP UKYa92+AXCYbUlmnHHHYwHsyjjZ4TmE9P6YrGau6ZBzciYuTxVxRlruxVLdgzW1KKB+Q UTTiOI3KL/QLaAIbOB36Y0DXeULGp8f27xRCxqvZbDN2vQ/xKrNGUgWtmigc98r+HYV3 NkwA== 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 a19si6614607otl.162.2018.12.18.00.24.05 for ; Tue, 18 Dec 2018 00:24:05 -0800 (PST) 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 E9BC880D; Tue, 18 Dec 2018 00:24:04 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (p8cg001049571a15.blr.arm.com [10.162.41.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6525A3F575; Tue, 18 Dec 2018 00:24:01 -0800 (PST) From: Anshuman Khandual To: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: suzuki.poulose@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: [RESEND PATCH V3 0/5] arm64/mm: Enable HugeTLB migration Date: Tue, 18 Dec 2018 13:54:05 +0530 Message-Id: <1545121450-1663-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. This is just a resend for the previous version (V3) after the rebase on current mainline kernel. Also added all the tags previous version had received. Changes in V3: - Re-ordered patches 1 and 2 per Michal - s/Movability/Migratability/ in unmap_and_move_huge_page() per Naoya Changes in V2: (https://lkml.org/lkml/2018/10/12/190) - 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: Distinguish between migratability and movability mm/hugetlb: Enable PUD level huge page migration 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 +- mm/migrate.c | 2 +- 6 files changed, 76 insertions(+), 5 deletions(-)