From patchwork Tue Dec 18 08:24:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10735111 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 A0D9C1399 for ; Tue, 18 Dec 2018 08:24:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9185B2A5F0 for ; Tue, 18 Dec 2018 08:24:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 852B72A644; Tue, 18 Dec 2018 08:24: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 88ABF2A5F0 for ; Tue, 18 Dec 2018 08:24:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 908008E0009; Tue, 18 Dec 2018 03:24:27 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 890878E0001; Tue, 18 Dec 2018 03:24:27 -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 732238E0009; Tue, 18 Dec 2018 03:24:27 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by kanga.kvack.org (Postfix) with ESMTP id 4625A8E0001 for ; Tue, 18 Dec 2018 03:24:27 -0500 (EST) Received: by mail-ot1-f71.google.com with SMTP id s12so8942120otc.12 for ; Tue, 18 Dec 2018 00:24:27 -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:in-reply-to:references; bh=EMrCg0VRRtTSEVtqoM5s24lPd3zzL6QCmzRXtbR1uv0=; b=nXOQifQEqU/AOc5UNK0gdjgW6BdmjIEvPEUP558h0Icrs9n+j6QkA52ijbsZkKE+TA zpY6wz/KCsU1aOXQyaTULwrwEx1hUSnJeJxgejBnhKEHPmhWwWxQOT8sQpy9a+4hf/px eypIxZfD5ZXYQTJEhlMcOGv0yqBFodWlVZP83IZr90G2risNI9wlwqZzfA6nBd4b+5jf 8VwR8oU90hyQa3M8QPhvlwd61J+pSAICd1zyRrazBnUJe+gyUY5ADTLkKo7lp3GLdmrG lbpG4F48kD65HKQ86yolPmWgkIbZIoexglKcTrwGqhf0GMUqdcwqYHa2xM+XaXsVehA0 aqzA== 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+aEWaUIusIZiVv7fvnV33AUeWSEQ4fWs8x95d2oq/fCWoUnA8FUIVl 7+txDQPrJh8EgnlhLLBW0w8c4eOJF88/nHlwM0cRijp0YfPVlyw2GSZXtfMow+igx8zqFszu8Tq mQPEaz1eazMQov5l8WmvGVNuN3rNEr9OJ8MISM/NEbNFtIeOLlSTRNXhPj7GDmCu6Sg== X-Received: by 2002:aca:4909:: with SMTP id w9mr6878361oia.203.1545121467007; Tue, 18 Dec 2018 00:24:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/XaQEwwPq5If+7sehhCJMo/uk8xLNh2rpmWXFK4snim4yH4C7U1aJY2EupxtHNr1UHa+tIZ X-Received: by 2002:aca:4909:: with SMTP id w9mr6878334oia.203.1545121465855; Tue, 18 Dec 2018 00:24:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121465; cv=none; d=google.com; s=arc-20160816; b=uRZaCQz+q5iQ4s9hSLKArZjtRVnrsLXy+k8fsbQYY19sj5H78oO9g4CkZ6WxPqg/FF 2G/MdwucwGEfQcJLlX7Ovow0UTnqTOavY6Y4cTdU0cXqK+wAwZjmr9jx9OdjOQG3c3MG uK8WPFSZ0LjRKB8YEqpMSJJXkXqhIOZBj1j27wl3r9QPKZgdKa8HsLaZSYj6OiCI/DRQ xc8pPs34VvJLtRX5jwF4ad5rrN7IiOr1Dm6TJEBOlD8mDjT58yRqiwStV2TRt5dsyiqe 5C384rIT3v86WMmi0K5gYOOMkOP8gwYnAYxcG325iUgLwNsVSTeDPkxBTvkIr5apD1oU R+UQ== 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=EMrCg0VRRtTSEVtqoM5s24lPd3zzL6QCmzRXtbR1uv0=; b=b6ocByxXB3OYj8wu1L+ZhBhYiMZkraXoEwdLc4iQopzirkn50FZY0h0Qf4GEHIXiE5 QsdL7do5T89aEjAWIHvUiXkjLRZ5S7eHDsUbHLOoHvLhHZGjcdzymJfoQDv8REZYs6MJ l76nLv+5zFyBZspIYsAztOiMpbTW3FD6j3GLSRodjDF4AhFoZ/c32+FQ+OETT6UcCMpe fAMs5ARtFmr5nQpQ3aDqlTuKIrRQD5gm5MNFasvjndfDA2JjJ+AoBLPqZAuZ+jtYVDm0 j9FfZKSwK9FcMbWE2GGdEsz1IhUSNuYM8Y/zkjZautHJrUrShMXFI+d0wGYpP3qgz4MQ l92w== 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 i20si6888514oto.71.2018.12.18.00.24.25 for ; Tue, 18 Dec 2018 00:24:25 -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 4C81615BF; Tue, 18 Dec 2018 00:24:25 -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 693CC3F575; Tue, 18 Dec 2018 00:24:21 -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 5/5] arm64/mm: Enable HugeTLB migration for contiguous bit HugeTLB pages Date: Tue, 18 Dec 2018 13:54:10 +0530 Message-Id: <1545121450-1663-6-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1545121450-1663-1-git-send-email-anshuman.khandual@arm.com> References: <1545121450-1663-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 Let arm64 subscribe to the previously added framework in which architecture can inform whether a given huge page size is supported for migration. This just overrides the default function arch_hugetlb_migration_supported() and enables migration for all possible HugeTLB page sizes on arm64. With this, HugeTLB migration support on arm64 now covers all possible HugeTLB options. CONT PTE PMD CONT PMD PUD -------- --- -------- --- 4K: 64K 2M 32M 1G 16K: 2M 32M 1G 64K: 2M 512M 16G Reviewed-by: Naoya Horiguchi Reviewed-by: Steve Capper Acked-by: Catalin Marinas Signed-off-by: Anshuman Khandual --- arch/arm64/include/asm/hugetlb.h | 5 +++++ arch/arm64/mm/hugetlbpage.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/arch/arm64/include/asm/hugetlb.h b/arch/arm64/include/asm/hugetlb.h index fb66098..c6a07a3 100644 --- a/arch/arm64/include/asm/hugetlb.h +++ b/arch/arm64/include/asm/hugetlb.h @@ -20,6 +20,11 @@ #include +#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION +#define arch_hugetlb_migration_supported arch_hugetlb_migration_supported +extern bool arch_hugetlb_migration_supported(struct hstate *h); +#endif + #define __HAVE_ARCH_HUGE_PTEP_GET static inline pte_t huge_ptep_get(pte_t *ptep) { diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index f58ea50..e445500 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c @@ -27,6 +27,26 @@ #include #include +#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION +bool arch_hugetlb_migration_supported(struct hstate *h) +{ + size_t pagesize = huge_page_size(h); + + switch (pagesize) { +#ifdef CONFIG_ARM64_4K_PAGES + case PUD_SIZE: +#endif + case PMD_SIZE: + case CONT_PMD_SIZE: + case CONT_PTE_SIZE: + return true; + } + pr_warn("%s: unrecognized huge page size 0x%lx\n", + __func__, pagesize); + return false; +} +#endif + int pmd_huge(pmd_t pmd) { return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);