From patchwork Fri Oct 12 03:59:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10637817 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 58A3F933 for ; Fri, 12 Oct 2018 04:00:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 485A52BDF0 for ; Fri, 12 Oct 2018 04:00:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C5C72BE0B; Fri, 12 Oct 2018 04:00:33 +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 B61182BDF0 for ; Fri, 12 Oct 2018 04:00:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96AB46B0008; Fri, 12 Oct 2018 00:00:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 91B436B000A; Fri, 12 Oct 2018 00:00:31 -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 79A526B000C; Fri, 12 Oct 2018 00:00:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by kanga.kvack.org (Postfix) with ESMTP id 4E14A6B0008 for ; Fri, 12 Oct 2018 00:00:31 -0400 (EDT) Received: by mail-oi1-f200.google.com with SMTP id v188-v6so7632486oie.3 for ; Thu, 11 Oct 2018 21:00:31 -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=MuojBUk0nL/v+mqV1BNv2M4agha44zd3BlcKFLfrz0A=; b=fSLTB+suE4jQDkzNmxoT/5zFhEjA42OfsiF/vmuVUcr4l5Q4YKy1Mx3PH0gfrBRzYC Pi9AQX9xvvDYBVP/j1Ee36uY+T/Plt5r0zj6dCsPSO+QyzL9DYtEUOgz5P7syTM0sfbT iB3V6IA3v7ge7b9iOgcW9WMWGRJX1FBO2irJPgJKsbstQrNldYbEGKoiohsL9pqTjDvl LlUsMsYgHVpuDihr3cZEHRfm9MWQgFFWUGQnfqXLod3p2BEhgZF993OSJxbfOzH9sPJ+ uiE1nAewE5ulE6PteV+4OgP/J/6We9JaKHCv79rMiWLissbMajNNC8zIpr5+rO7q8/+o w2MQ== 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: ABuFfoj92xmpiA5uWFtiWLe+pQQZa4cbuq2A2PNy47qm0GaDg44h+rtp IcP+ZFvCo6T0XDR572SGQI17bf+5EeMqdaweJGcMXMDndtcxE6J6jFgHyhx0+Wso4BAAbaW4UW6 CfcIN78gsu+wP0csLah0PStM20ylvw7izHweD1lNFPRvzoCsrhu211+sR5WNANtQP3A== X-Received: by 2002:aca:ce07:: with SMTP id e7-v6mr2522712oig.54.1539316831060; Thu, 11 Oct 2018 21:00:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV60YS8MQEOsu+BLboijT7AuZhloGr+zKDl/Kmdr1dC2LGm5ueCcE8BH7WCAqkXttA7+/SvLP X-Received: by 2002:aca:ce07:: with SMTP id e7-v6mr2522682oig.54.1539316830280; Thu, 11 Oct 2018 21:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539316830; cv=none; d=google.com; s=arc-20160816; b=dYug4H2AC7SFpg7tdwyGYf1Gh6UFVbM3e+AKsNsvRvaXRGj3oktwOjO15pDbimP9uw VI6Rp7fI/A+HkaAo0J+ANYnMLCUtbpE6cqN+UtwFJPQt78quUrNgRWFm/wpJooyu0MKE wOL9JvIIvh6+7bjXoR3G2GY/Fwwx0qVlOuB/gziI20Pcz9PlHXlfSWL7YRaf1IbyMT4J izUbAZNgnNlO69lFq/8wKRjafxxpDi4O7EAKv7LglIJpBcQDLgF/DzeH8INwxl2mvXWp XrFUTpVLfH4GbKsyDw0x0AXVQsi1KFbLFVXePxQqEJGeot7sUwm3vZNlS1+6vAgkUPCl JDRA== 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=MuojBUk0nL/v+mqV1BNv2M4agha44zd3BlcKFLfrz0A=; b=hvoBcmxdQu5YEnmoW7X3iUifgVVVRugmN6611/Su6hAdXHV0EDF2qlhT4JyhWPQQIr Lux1//VH++KrtOY9GmQNafwQDUULU6hJqO1MXYw3xlegnGxhJrqYPPwH2tSMh32aJhLe dBIe7ILI+qjVSvYWJrJv0j5BZOhWNGTqdT94Z7BQqguDDsQOiSYyAA36sSYkrfSDB2Yl IwegABKbgrp1JVcuwrPWF+CJrYIvKp/OQ/ZF1UH5ytUMuMY3yigxAr3o2mKZxV8dIFO5 /NcBcRPRiL+NcMf1nGeXDVPPKIbI2Z+H348vQNvmM9aQpThLXnzzPow1KmJhwW/Pq2CG UhIg== 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 p4si4526070otc.88.2018.10.11.21.00.30 for ; Thu, 11 Oct 2018 21:00:30 -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 CE81B15BF; Thu, 11 Oct 2018 21:00:29 -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 087C03F5B7; Thu, 11 Oct 2018 21:00:25 -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 1/5] mm/hugetlb: Enable PUD level huge page migration Date: Fri, 12 Oct 2018 09:29:55 +0530 Message-Id: <1539316799-6064-2-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 Architectures like arm64 have PUD level HugeTLB pages for certain configs (1GB huge page is PUD based on ARM64_4K_PAGES base page size) that can be enabled for migration. It can be achieved through checking for PUD_SHIFT order based HugeTLB pages during migration. Signed-off-by: Anshuman Khandual --- include/linux/hugetlb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 6b68e34..9c1b77f 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -483,7 +483,8 @@ static inline bool hugepage_migration_supported(struct hstate *h) { #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION if ((huge_page_shift(h) == PMD_SHIFT) || - (huge_page_shift(h) == PGDIR_SHIFT)) + (huge_page_shift(h) == PUD_SHIFT) || + (huge_page_shift(h) == PGDIR_SHIFT)) return true; else return false; From patchwork Fri Oct 12 03:59:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10637819 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 8A33113AD for ; Fri, 12 Oct 2018 04:00:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 766C02BDF0 for ; Fri, 12 Oct 2018 04:00:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ABFD2BE0B; Fri, 12 Oct 2018 04:00:37 +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 EB8F12BDF0 for ; Fri, 12 Oct 2018 04:00:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CED7D6B000C; Fri, 12 Oct 2018 00:00:35 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C9BD76B000D; Fri, 12 Oct 2018 00:00:35 -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 B8C7B6B000E; Fri, 12 Oct 2018 00:00:35 -0400 (EDT) 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 8B0856B000C for ; Fri, 12 Oct 2018 00:00:35 -0400 (EDT) Received: by mail-ot1-f71.google.com with SMTP id l92so190830otc.12 for ; Thu, 11 Oct 2018 21:00:35 -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=RNAdn3wYKVi/N1Y7JjNeXQzPvgKFl3FZbSOyBDv5avM=; b=jdnmnyX9nqKwVoEwfmZUeJyXYQU+Cj9bbA3YfTTmsAMeLoLe9PpFJN/v/jiIdtyD64 y49/ZAOuubI9/UWznK5BveTKufNMq9rzcskfMuUKb7pAwSejqg4dWZkET+QKwLHUf2Ub aqZeH5NGDjpsnbaD1/nwFUZGngDmEfVtfcqfhEMRq2/0SU6WyOXMvWygfIcoWc0PJ2ea DfaT4CDoU8v065y8xTBzBQw4gKlmTADh+jSdfzPVjlpoOt04j2MlomZL2XKlVaJLwYti iKNUemmRMVIZNVOAaioZw++nRTaOKpLrfj1fT1pavDWB8uZ2xxZhgkxwkXe4oU4V8JB8 KuWw== 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: ABuFfog9RXovaYBYFLxLsy9AqJxOjALvM9bP7ROt9tQ1GwyzA64sBf0p mi//N3T8rQwX9HIfNoLCIRhybeyWqs6fXRpO78g8dnvD+ms7WsXCF4/4SleT6z5P7Bi8x4F6+eU 9e6YjRRsAvOY9zhCzuBdnT71KP24SEi4c42THaNQ+1uwIiV/m3biB6WgSJWkC+OEd4g== X-Received: by 2002:aca:add8:: with SMTP id w207-v6mr2234892oie.112.1539316835229; Thu, 11 Oct 2018 21:00:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV63ImQuEjJB87HGi4NTmjqem7fsSc/I7c5BzR8434Z6781te9oo5OwftXhnbrkRtiny2Gfeb X-Received: by 2002:aca:add8:: with SMTP id w207-v6mr2234865oie.112.1539316834472; Thu, 11 Oct 2018 21:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539316834; cv=none; d=google.com; s=arc-20160816; b=AS6vCFaeWWYlDWD+gKIXO3ZgtVvz69EF4Mz9sqtGD96ISAaM9XOB9U4wH3uTt8KqXC sTEkUT/nGGSctQBvNhGr1CIT70X3bjlFMSz3WiBMf5w6HVNY9VXPSPqB0UwTq7di17fv B5a88CQg4ce/5T+SKeae2hs6xzMiasIGWsbFceicndRp57Jq1B+lvSlchI/d2u2rRXRP OQ1N6GuUjqf7W9UNfnN8pxk4eOZnuP8NuIWmQBZNBTGL4332e8WO2qo9MUa88mFcXYtr zYO8DYFQSW5pITGGQLxi5mwEUPzkR4cVU9wtWHEyQfCgIqZyr9NWDWpY1GvRFrKN1Poj CYHQ== 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=RNAdn3wYKVi/N1Y7JjNeXQzPvgKFl3FZbSOyBDv5avM=; b=w1M8di2q9DangfSon25XSSkHmjk3AdT6ga7xnkotLYnRriz4257Dh+4QyJvOJzvsUD O4/oLeJkPGnR1mxpqRM58SLfQFOqSY6cgYzrmHX/hL6rS73V66sBBvu6AdDTgOyYcFLV sR889UYgtf8a3JttQTdMC6N/6fixHONBKHHhQYit5YGDPIr9CayRZ/9B0TUoRvl6AnEC 3N9c/ZzfH64aL201ymaPXRogsEAj7FaGxcrkWbcOtvrEXvx8jBHdL/VnPAiF0THgnCa0 sAQrA+B3YxlVA6yhmrCFofT3x6UvX/9l1xic/AgyYpSFjuIlsweRBfO+pBCJD/7dJB5m afTA== 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 k91-v6si14781371otc.259.2018.10.11.21.00.34 for ; Thu, 11 Oct 2018 21:00:34 -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 017761650; Thu, 11 Oct 2018 21:00:34 -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 423A43F5B7; Thu, 11 Oct 2018 21:00:30 -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 2/5] mm/hugetlb: Distinguish between migratability and movability Date: Fri, 12 Oct 2018 09:29:56 +0530 Message-Id: <1539316799-6064-3-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 During huge page allocation it's migratability is checked to determine if it should be placed under movable zones with GFP_HIGHUSER_MOVABLE. But the movability aspect of the huge page could depend on other factors than just migratability. Movability in itself is a distinct property which should not be tied with migratability alone. This differentiates these two and implements an enhanced movability check which also considers huge page size to determine if it is feasible to be placed under a movable zone. At present it just checks for gigantic pages but going forward it can incorporate other enhanced checks. Suggested-by: Michal Hocko Signed-off-by: Anshuman Khandual --- include/linux/hugetlb.h | 30 ++++++++++++++++++++++++++++++ mm/hugetlb.c | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 9c1b77f..456cb60 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -493,6 +493,31 @@ static inline bool hugepage_migration_supported(struct hstate *h) #endif } +/* + * Movability check is different as compared to migration check. + * It determines whether or not a huge page should be placed on + * movable zone or not. Movability of any huge page should be + * required only if huge page size is supported for migration. + * There wont be any reason for the huge page to be movable if + * it is not migratable to start with. Also the size of the huge + * page should be large enough to be placed under a movable zone + * and still feasible enough to be migratable. Just the presence + * in movable zone does not make the migration feasible. + * + * So even though large huge page sizes like the gigantic ones + * are migratable they should not be movable because its not + * feasible to migrate them from movable zone. + */ +static inline bool hugepage_movable_supported(struct hstate *h) +{ + if (!hugepage_migration_supported(h)) + return false; + + if (hstate_is_gigantic(h)) + return false; + return true; +} + static inline spinlock_t *huge_pte_lockptr(struct hstate *h, struct mm_struct *mm, pte_t *pte) { @@ -589,6 +614,11 @@ static inline bool hugepage_migration_supported(struct hstate *h) return false; } +static inline bool hugepage_movable_supported(struct hstate *h) +{ + return false; +} + static inline spinlock_t *huge_pte_lockptr(struct hstate *h, struct mm_struct *mm, pte_t *pte) { diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 3c21775..a5a111d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -919,7 +919,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, /* Movability of hugepages depends on migration support. */ static inline gfp_t htlb_alloc_mask(struct hstate *h) { - if (hugepage_migration_supported(h)) + if (hugepage_movable_supported(h)) return GFP_HIGHUSER_MOVABLE; else return GFP_HIGHUSER; From patchwork Fri Oct 12 03:59:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10637821 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 76A6813AD for ; Fri, 12 Oct 2018 04:00:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6650C2BDF0 for ; Fri, 12 Oct 2018 04:00:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A9572BE0B; Fri, 12 Oct 2018 04:00:41 +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 E87432BDF0 for ; Fri, 12 Oct 2018 04:00:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C9DC36B000E; Fri, 12 Oct 2018 00:00:39 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C4C8D6B0010; Fri, 12 Oct 2018 00:00:39 -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 B180B6B0266; Fri, 12 Oct 2018 00:00:39 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by kanga.kvack.org (Postfix) with ESMTP id 83D036B000E for ; Fri, 12 Oct 2018 00:00:39 -0400 (EDT) Received: by mail-oi1-f197.google.com with SMTP id d23-v6so7575287oib.6 for ; Thu, 11 Oct 2018 21:00:39 -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=zCPHxGOshzy5k42z2TRpHkM0RKgtw+KCKPngt8Us5fo=; b=qP5H48Zqz3j8AJml5iEKHBzSeTG7wO+CLnAfnh0IXf4NFxmiOCGD0Fhgb4IVGCxPGY opVEbu4f1PSvnAIRoG14hpmRGQRRSiFsURx9f0lgJEMVF5xGLwmoQn9F6pvcD50JPvam MMKYJKBLIUHvEq4SeMxTjELvDC6tNTaMFyAClwbBI6UT0f5/3yUaANbqnm4H0JkR43l5 +elgG7BFQ84F9ZnQ3YADabBBZgU4x5J2l/MIn4gIigzERlKeu8mvO2f0biodtzDE/TYd 0O2hZsDa9prjCKXPleNshKN2l63xZEXY02frB1RH+TbKIbPZqvTga3oG9hhFBKqvlciY hA/g== 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: ABuFfoijVxDHgjHzaBbb2UiWf6lr63yVPrVU2jL2GUt7MJr48R/w1f2d OXiLDak+kKyOthCn3Y6rUhUvkRovE7FECGEnqYsfJmGDoKCHcXhonnc9fyjjUcYH1Zj7GfdPIH1 mu59YFGlvJuh2mzYbxFwSI2adqKGc/V8oBZz7fGZKkw0eizQoF505kReu+WuElj9aGA== X-Received: by 2002:a54:4e0f:: with SMTP id a15-v6mr2426014oiy.346.1539316839288; Thu, 11 Oct 2018 21:00:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV63B8HLrH/dwoQ1UTXJEjQa+5Hhdh7aRd+LA9OeGTcoc6BQAYo5DcLyWSDEwYO2aTHBYm8c5 X-Received: by 2002:a54:4e0f:: with SMTP id a15-v6mr2425996oiy.346.1539316838630; Thu, 11 Oct 2018 21:00:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539316838; cv=none; d=google.com; s=arc-20160816; b=PXqZ5CJuIkrxjUb8N7E7EXhtCqmTFm5J39dt/+QBEDe6w4DC4SzCq2ZJYBSV6oW5aP 4FD/wdg8GCGT+3seN2EJmJ6+gea5MPYtRRgKo+5ehPUqWnpCFrjYCJAlfSjHZlEWlvst PUg1C0grqvO5E2Ovze11CbM5MrS062c4vYGYVVqj5HDfZVz5Hk+6qwfswJ+AINFvQhA+ eeI6ZEdOtC7Y4ZGGM5LzS6XvlSRnRdKYJ3sBDFHKu9S8YTRhYN+ngCWZz2vXBSY2lsz9 LUyqXr4MoiXR5ZCdo30IpLFp1lGljqI/0nJufWukiPoG+VBIBwKEAcDwKodfoL/cewlt Y0Nw== 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=zCPHxGOshzy5k42z2TRpHkM0RKgtw+KCKPngt8Us5fo=; b=pj2bu+PFr7DDuVuBWoJuU4fQmEM9LuJO5kdauYqabsQeD+GN3eE1bYAfxea38OOsZN hxZYuE8teeoz2KkdL7WQ3wxt9DhglFlFZQW2/WF11YNFhJsiUCwnYRqXURR9gy8RsFot OTOPYtgPcDRFLVkA2UEriTobNrUSeXgvhlm1Lk19KXT38UR8KRgSAnzT7ZJlmY+J+nR+ p+G9tLMRVRTQSU7IvLgOqp0E3axjMaJIqdE/Vs0HXaLx8zkMqY0oYFJP7CZlXJjGecng ffcJndXjUh6Td3LxSiWxucq/ZuH62MVgUdUy+5AWEKo9YchHsxFM/8yafMLgh6IFLHkf 4HJA== 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 b6si15514427otj.236.2018.10.11.21.00.38 for ; Thu, 11 Oct 2018 21:00:38 -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 332E71682; Thu, 11 Oct 2018 21:00:38 -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 73BD73F5B7; Thu, 11 Oct 2018 21:00:34 -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 3/5] mm/hugetlb: Enable arch specific huge page size support for migration Date: Fri, 12 Oct 2018 09:29:57 +0530 Message-Id: <1539316799-6064-4-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 Architectures like arm64 have HugeTLB page sizes which are different than generic sizes at PMD, PUD, PGD level and implemented via contiguous bits. At present these special size HugeTLB pages cannot be identified through macros like (PMD|PUD|PGDIR)_SHIFT and hence chosen not be migrated. Enabling migration support for these special HugeTLB page sizes along with the generic ones (PMD|PUD|PGD) would require identifying all of them on a given platform. A platform specific hook can precisely enumerate all huge page sizes supported for migration. Instead of comparing against standard huge page orders let hugetlb_migration_support() function call a platform hook arch_hugetlb_migration_support(). Default definition for the platform hook maintains existing semantics which checks standard huge page order. But an architecture can choose to override the default and provide support for a comprehensive set of huge page sizes. Signed-off-by: Anshuman Khandual --- include/linux/hugetlb.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 456cb60..97a2fdb 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -479,18 +479,29 @@ static inline pgoff_t basepage_index(struct page *page) extern int dissolve_free_huge_page(struct page *page); extern int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn); -static inline bool hugepage_migration_supported(struct hstate *h) -{ + #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION +#ifndef arch_hugetlb_migration_supported +static inline bool arch_hugetlb_migration_supported(struct hstate *h) +{ if ((huge_page_shift(h) == PMD_SHIFT) || (huge_page_shift(h) == PUD_SHIFT) || (huge_page_shift(h) == PGDIR_SHIFT)) return true; else return false; +} +#endif #else +static inline bool arch_hugetlb_migration_supported(struct hstate *h) +{ return false; +} #endif + +static inline bool hugepage_migration_supported(struct hstate *h) +{ + return arch_hugetlb_migration_supported(h); } /* From patchwork Fri Oct 12 03:59:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10637823 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 5ABA1933 for ; Fri, 12 Oct 2018 04:00:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A7692BDF0 for ; Fri, 12 Oct 2018 04:00:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ECFB2BE0B; Fri, 12 Oct 2018 04:00:45 +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 C96772BDF0 for ; Fri, 12 Oct 2018 04:00:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A7C1B6B0266; Fri, 12 Oct 2018 00:00:43 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A2A4C6B0269; Fri, 12 Oct 2018 00:00:43 -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 8F3816B026B; Fri, 12 Oct 2018 00:00:43 -0400 (EDT) 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 64CDE6B0266 for ; Fri, 12 Oct 2018 00:00:43 -0400 (EDT) Received: by mail-ot1-f71.google.com with SMTP id m91so2716409otc.17 for ; Thu, 11 Oct 2018 21:00:43 -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=WftKFTrMoKocwRhcofDhWa/D5kJv43PxT1BODIQgSFE=; b=gDRmm+THLs86rCAPEzgcrmNYOwhMqielB7TOVFJui0vsiBWNPORyIo8GAuZ9LdOKkg gBWInmP5xlbrNODgK2JcIxYxoPEL0iQwBalGwpk9cuJIag7/VJ6V/zwyaW/dEQHi49Mm eLLBU+ojk7Q+qUconA2u6NpZjAzdT1f97TsCHx+n4NvX85OCTaovJaz6WKZxGO3qPF9n JTnOgejNTmH7N4KsSdRvDxkSMtVcNZmLrZg1txBuA7no9WTIhboNpnZzz56716wWrEMr RwslH+m9vGjvCUew676qKcCl+3h2HjzdnZG8bqJUYpmmn4hSF0m4TUHx4HFPADMNtwQ8 TNQA== 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: ABuFfog9iLQk96wDK4C4LSjZbxSVni6aLhmIZVCg0C0kjkb89z9zPFMw 3b2iWmYNXLXyrXmlv13xlGlR5CsMESXqh4dlLrqexfZSMgQrAzvW8Mxljaspk2zJOLg72P20a0+ jvTuaWwJHMib1OEAwanQL5wvA+es9eCWG1GNwwknuz3j1XSw5r3EFfXw1xyzY2r4KYA== X-Received: by 2002:a9d:97:: with SMTP id w23mr2597215oti.185.1539316843218; Thu, 11 Oct 2018 21:00:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV61YXL574Z1eys78vURieQuUStxEvaiCBcBo1LmtU11cVIJKLbk2BqTzQPvDcIZi0AuXbhUK X-Received: by 2002:a9d:97:: with SMTP id w23mr2597191oti.185.1539316842752; Thu, 11 Oct 2018 21:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539316842; cv=none; d=google.com; s=arc-20160816; b=rqcKmBV0NqlpMp+CtGHrRvykOKknymb+79iJ8lKBhcDfjU6s5OLJir+97ak8ZMgArA FrTW4YwJ1b4f6517wmw6qQJBd8RqUsvCogBkA4UnnDhfQNq59oMr52tl+UicrNA1pIJ3 VeSCO9/STjZEoiW8n8sD1tdUWAcfEakPyQAH+P7ESmjpb+6M8azKXoQs8tNnR+1fNHiM LQujfQ5nrIJ1tnbHMZ6BFRioL/11AnpSTRSgaJQC79y1wftwLqe8TEd0FcCUdlPIb4D1 LILtvIZ/qcLWAKBMtoc91KleNBuMB3ou633f40J1qDjnIVvIR563qt7ZG3WdzBg48Urc Gd4g== 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=WftKFTrMoKocwRhcofDhWa/D5kJv43PxT1BODIQgSFE=; b=TPkeXOarFDkGuP2b12WyM9zoLt++anor8w8jZ4qSlt6TV0Hue/YHkVrVE4UuxKSeaR tC4TbMmmXl6hx12ti3tX3oyjdYxAC9sqXmfSRjlTqq7JixVHj3/1glbPmARyxdMzNDun 4PyKRX+u/2AzA052jJmC9QWbxB6D5eloJUIy9Kv7lgz0Y+QsKB2TfknOm/bfj5Ohqgz7 1VKxn7pctjH/OzkS8z0vAbabsJRGbyx2TvSXqBJsRxGvPkM+TUnvVgkq7lS9AKWXHSlX ejcGA4ltYg27Lkep3/iih5pJ5WmmiFjkMiEjKiB+uPpQIXDi0mWd05JkTRtPd9F6dq5y uMfg== 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 g60si6041631otg.312.2018.10.11.21.00.42 for ; Thu, 11 Oct 2018 21:00:42 -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 6B9331684; Thu, 11 Oct 2018 21:00:42 -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 A3B183F5B7; Thu, 11 Oct 2018 21:00:38 -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 4/5] arm64/mm: Enable HugeTLB migration Date: Fri, 12 Oct 2018 09:29:58 +0530 Message-Id: <1539316799-6064-5-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 generic HugeTLB page migration framework. Right now this only works on the following PMD and PUD level HugeTLB page sizes with various kernel base page size combinations. CONT PTE PMD CONT PMD PUD -------- --- -------- --- 4K: NA 2M NA 1G 16K: NA 32M NA 64K: NA 512M NA Signed-off-by: Anshuman Khandual --- arch/arm64/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1b1a0e9..e54350f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1305,6 +1305,10 @@ config SYSVIPC_COMPAT def_bool y depends on COMPAT && SYSVIPC +config ARCH_ENABLE_HUGEPAGE_MIGRATION + def_bool y + depends on HUGETLB_PAGE && MIGRATION + menu "Power management options" source "kernel/power/Kconfig" 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);