From patchwork Fri Oct 12 03:59:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10637825 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 1F05D13AD for ; Fri, 12 Oct 2018 04:00:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01F762BDFE for ; Fri, 12 Oct 2018 04:00:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA19F2BE43; Fri, 12 Oct 2018 04:00:49 +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 793372BDFE for ; Fri, 12 Oct 2018 04:00:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 683416B026B; Fri, 12 Oct 2018 00:00:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 633926B026C; Fri, 12 Oct 2018 00:00:48 -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 521CF6B026D; Fri, 12 Oct 2018 00:00:48 -0400 (EDT) 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 205BF6B026B for ; Fri, 12 Oct 2018 00:00:48 -0400 (EDT) Received: by mail-ot1-f70.google.com with SMTP id s2so7860230ote.13 for ; Thu, 11 Oct 2018 21:00:48 -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=dV4ZZ+OF10+FHjmP9McuZUPgFMx4CHiWj171IKMAXew=; b=gKnKVH+1uSx2SZGgPRUjGAYPcSN6LruOVxMNTw6MxVT+hse0ZF7FfAhxTPRWH1aQB3 HF4uDYtkyuMlAnp4XdDIcGCtOzyj2vrNstLibI6d3t5E3CllcAidxf+xJtS4yOJq0H1D cAd7X1inV0XSVVfJ3Guf6dqWgblZH4j4q/K4jWdlyKktpoXLoImkOQ3/uD8zXgQZcdX1 RjvzSMNfjdI2QSTBlzbmajoabChc8pIZHqDe63iEbygBOmOtRt+FClP7n3MYT4TW59WJ jJdHGv9wugZkkQNUTexeUkqiCx0FBoAKz9q4T6N8pyN5qXn3/3kvORZLZRDNxEm326Y/ ucaA== 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: ABuFfoiul+HklICuGHdj8JmuBXxxYN7dtvcyq2XI+PxsPQl7GVdUZMai Muindh8F4+tCSOBxBqjEoDPWdhBGAmUDvZ61cIYZBO+Il2p0+7MZARtirKy++b9ipcj4ZLewaLo wNS8hXyv7dbifLLCo70Hi+y5cEyEgDFJoLIzalGQckGDYYQ4nBhbhJeRhgvs+By0cqA== X-Received: by 2002:aca:6a81:: with SMTP id f123-v6mr2243651oic.50.1539316847862; Thu, 11 Oct 2018 21:00:47 -0700 (PDT) X-Google-Smtp-Source: ACcGV62mVi7LRxFLLALj+BKPtIvhe3Ov5SaYkZRm+C+6cYCBMWXtChaZ3jgU2fNR5pjqn23fUCv1 X-Received: by 2002:aca:6a81:: with SMTP id f123-v6mr2243617oic.50.1539316846961; Thu, 11 Oct 2018 21:00:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539316846; cv=none; d=google.com; s=arc-20160816; b=T5ilXCHcHwKHAFWXHqSEa5013EqmnqBGw7N+tiaQUgDRhLIlDCDWdtC/mZ3jqlaNIQ VOgmhofFTg4x8rXA5YXcjA17eCJoBDExMsCzxqjmoeWNo4ZkNgLnxDuumr5JGxfAT6Wy K9Iy0EzW+OnQ//KEnCqvy+n6/ekZjsBYSRXpJ3U2j0QOdLCCJn7i/fVXWTYHTyC4KBmt +AFAWM7EcV73oPfriDwmGwhYXV9jUjx8wtsHR03hP4s2Hb/t0Gsj56cOqB69XjOrjuTi AuzIrKSzaMR+163lPdzylmnHL2k1PQJebyi+tx6WtEylY3mMEHn9g7fH1IZv/63XsXt8 dZRA== 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=dV4ZZ+OF10+FHjmP9McuZUPgFMx4CHiWj171IKMAXew=; b=u/ZNgvbxwEB5dGBoh8EcYXloL44vgVHZsRUIO7j49v4zE3bRrSZHk8JNgi1hpc2i5w OuTl4KJh4AZFR4mUIPq5SR2heARunvFFXSUPVA/SmjjQMzRVXCVZDAy+JgKdt2fhFguS FRj9ftFGe977yyKNO4RLgEl0NPkMZ81/WWRYNfvJTb3K6BGm88s4VFscwtoFhA3Ybej9 aORYbly2ExNbqfq5b3F45jpwbYa1rAf/bDoeB2ROa+lb/Wn+0kH9HizMUBI0D9sjFvSJ vP6ihcDypoiFTyOPcLRvIUKJcK7ICmcU6iBmfCs4bZA8vmJZb2lvlEgCD58r6PmL5JRi +RRA== 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 (foss.arm.com. [217.140.101.70]) by mx.google.com with ESMTP id i64-v6si8934992oih.149.2018.10.11.21.00.46 for ; Thu, 11 Oct 2018 21:00:46 -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 9D3FFEBD; Thu, 11 Oct 2018 21:00:46 -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 DDA863F5B7; Thu, 11 Oct 2018 21:00:42 -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 5/5] arm64/mm: Enable HugeTLB migration for contiguous bit HugeTLB pages Date: Fri, 12 Oct 2018 09:29:59 +0530 Message-Id: <1539316799-6064-6-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539316799-6064-1-git-send-email-anshuman.khandual@arm.com> References: <1539316799-6064-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 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 e73f685..656f70e 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 + static inline pte_t huge_ptep_get(pte_t *ptep) { return READ_ONCE(*ptep); diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 4eafd9f..28f4795 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);