From patchwork Tue Dec 18 08:24:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10735103 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 2598C1399 for ; Tue, 18 Dec 2018 08:24:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 15CB22A5F0 for ; Tue, 18 Dec 2018 08:24:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09DFA2A643; Tue, 18 Dec 2018 08:24:14 +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 BBA4E2A5F0 for ; Tue, 18 Dec 2018 08:24:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDA228E0005; Tue, 18 Dec 2018 03:24:11 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C3A228E0001; Tue, 18 Dec 2018 03:24:11 -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 AB7508E0005; Tue, 18 Dec 2018 03:24:11 -0500 (EST) 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 7DE7D8E0001 for ; Tue, 18 Dec 2018 03:24:11 -0500 (EST) Received: by mail-oi1-f200.google.com with SMTP id p131so927610oia.21 for ; Tue, 18 Dec 2018 00:24:11 -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=nMn47GRWVxf/krOr7Ln0IXxIashwj0EQ1ZKiy+lxvjM=; b=Mtp/4UVlU8wQDxsWElA2cV+nGvG6YhWM1yxWsNr9rh1/4SNAu38fdlD1iiaPoYctaT pvyXXpkvV4LNPDidrwcf0/CqV2iXFBJJUAkqcUrQfvrbwnBmTbJATg1nzwFIebGyyyzF lf6kHxae35fqcuyB8f2arJPyl/7K/j4F2ludXpfcaxQ8dp6kuMYCpk4TIV/G8ui1AJh4 5Bz4hxQgcAsjkllk3qo8soB8mtzUlwclSimwMArxAkaoy1/+Frr1TYCjReD4U3tjTLP8 qWPzBmE6+EzVy/Qw0lhmm0ZcCX2tjfV3CXgB+zjvcGAGkVMh7v6dHvWZeQMHBe5dhx1q iNYA== 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+aEWai4nay3Z75wS+8qf5Xqnr6JHTTReXLD8IwqFjwDXDjYCK9YiTR xwNJdv09CD0h92/Viz7miMPMSR1TuCFCYtIZvD1ATKw2wFHusIGUtpKXv+oKGM4jv2YC5DAWz59 sj0PCWSrG034ruBpvdj4ycVP/ZSqVJgs+K34OLBjjhATfsY8stGIt/UzZY6rnnWqjdg== X-Received: by 2002:a9d:5249:: with SMTP id q9mr11306551otg.160.1545121451229; Tue, 18 Dec 2018 00:24:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/W5Zdi5X25k6nKVtKaTg6MPcAFOktysR23hqWRZA4yZsvPEE9czGwjYkpf+5mFzvYHDyNe2 X-Received: by 2002:a9d:5249:: with SMTP id q9mr11306530otg.160.1545121450430; Tue, 18 Dec 2018 00:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121450; cv=none; d=google.com; s=arc-20160816; b=EtnaraOsrUz7YIyTVt7h6zGEZENfEUMkqqvUAOCssFEb3qERQJGwWlDo6uero9vkl/ czq5v9rwo1/hL0w5h8Z9VXDkXxyaw6us8LDVAyWPDg5/sH++ph8xuFiWb74eGJsRqioQ 1rKsOAC0OvS2RwjOblhr9xsMv19hKIQImos7uj5lo3QX+u6vHbsiUoXE1xojsRRiLjU7 jqe3ciHFbScOP8UeaYGjbXqIfmMywIkoYNO+NkFy+NW+yB7I70AOb7ZrXvFV+ZaCe+Ma a62If3MqtQLLowJbYhO0GejC8aujKElngkC7yTG05bJ9pwLE9eMX2d1F9AtOS/qDhT/1 Dx7Q== 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=nMn47GRWVxf/krOr7Ln0IXxIashwj0EQ1ZKiy+lxvjM=; b=Ex83y1rfBiOinmP/6X0gBcuYuxecJpGQUOuMzlqF3XJmWiC3MemWtx3tU04YTTHfYd uL3sNPF9Xqi7jUfn744sccUJzOBu744jfACIJ8ljjiGJjHBY8QJMmXM+//AcH45oVIOn FfbjRP6Ik+ss2lWDOqnQcuf+fBUqxnRl9FtgoXyCZFFXAHFBb8I4pF7vJ40RN/oHDIQB XqA3flPPO7pWHEzFT4eOSHHeh2Visf+eVPKlQq31VTPyb+cOWoEVGqIqCnzouK7e8EGD YmNR67uqpvx/ZQRVc5ZPbyebC9zAC9wNmPQs/KQxsmCnyM4sh6OUAhBrukVqrleEZnhM VcGQ== 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 p126si859562oih.133.2018.12.18.00.24.09 for ; Tue, 18 Dec 2018 00:24:09 -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 F0DC215AB; Tue, 18 Dec 2018 00:24:08 -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 63D783F575; Tue, 18 Dec 2018 00:24:05 -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 1/5] mm/hugetlb: Distinguish between migratability and movability Date: Tue, 18 Dec 2018 13:54:06 +0530 Message-Id: <1545121450-1663-2-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 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. Reviewed-by: Steve Capper Reviewed-by: Naoya Horiguchi Suggested-by: Michal Hocko Acked-by: Michal Hocko Signed-off-by: Anshuman Khandual --- include/linux/hugetlb.h | 30 ++++++++++++++++++++++++++++++ mm/hugetlb.c | 2 +- mm/migrate.c | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 087fd5f4..1b858d7 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -506,6 +506,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) { @@ -602,6 +627,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 705a3e9c..795f745 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; diff --git a/mm/migrate.c b/mm/migrate.c index f7e4bfd..3020a06 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1262,7 +1262,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, struct anon_vma *anon_vma = NULL; /* - * Movability of hugepages depends on architectures and hugepage size. + * Migratability of hugepages depends on architectures and their size. * This check is necessary because some callers of hugepage migration * like soft offline and memory hotremove don't walk through page * tables or check whether the hugepage is pmd-based or not before From patchwork Tue Dec 18 08:24:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10735105 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 47FC514E2 for ; Tue, 18 Dec 2018 08:24:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37EEE2A640 for ; Tue, 18 Dec 2018 08:24:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C4F62A644; Tue, 18 Dec 2018 08:24:19 +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 C01B52A640 for ; Tue, 18 Dec 2018 08:24:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E12C08E0006; Tue, 18 Dec 2018 03:24:17 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D9A2B8E0001; Tue, 18 Dec 2018 03:24:17 -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 C634A8E0006; Tue, 18 Dec 2018 03:24:17 -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 A065F8E0001 for ; Tue, 18 Dec 2018 03:24:17 -0500 (EST) Received: by mail-ot1-f70.google.com with SMTP id s12so8941958otc.12 for ; Tue, 18 Dec 2018 00:24:17 -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=HFpFpNsMXDamKcXKNvB8nUQzeCgTMjPcA+nZ0NzhBTI=; b=AFCt7UP6MOC7TcKBJJfXoY6DJ2/2IRwrtUol46Tt7Iv3JkxMtYveT93XJZ++X/MA7t ZMfFV5ZBn/KJo6Esdw1Uy4UigzpW9mH1bXf+98StbBZMMQV0jHbqTyvHQabx7iKTubUQ 6HZUg1PHVhkwwWaXv4UA/+O1o98a4jyokH2dX2CEoe6jVdEJ+yZ77bGgwnNTRz/fqUov RPf9D32yy2LRcgY7KqcW44K3bhGv1Z5ccGQpyw+EX4V6RbSEHw6qe29jSi6OlOAHZwws hrnqt0cc9N5uDcuN+2XmX6dsglG7RNtF1PdDjdGxl4JKss+zt4wvbWrFgFaBte1i4iOm GCww== 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+aEWb2j3Ub/WkZAn4KM7CieYwzSJLvDL8A49fgz4fxEF/tlj1eZNDM tLsKCF0zYuhNJiEVFNH6ey41d5pFSwMyaBvAVK9sYVTwTBZ4Wo0CmnIvIte7oi3gygeAfkq24Y3 oV7hGfMeOcan1y8bxtWCRH2y7xcIQxb5P51uaKIwqaPA+nbV71+nY6+u7ssT6AocfFQ== X-Received: by 2002:aca:cc:: with SMTP id 195mr7376886oia.297.1545121455962; Tue, 18 Dec 2018 00:24:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wf8Wj/fF1k022R/Fza/1688CHfYWrAIc3lPCEArwAj3nyVETfKgl5kewBcwzHgK4jHgeDO X-Received: by 2002:aca:cc:: with SMTP id 195mr7376825oia.297.1545121453652; Tue, 18 Dec 2018 00:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121453; cv=none; d=google.com; s=arc-20160816; b=TfmYHUxb8OBdQOPUePfStnu2lPjwe3f0ctVM4i+hc2A+EflDgRbo48aqfu45Um0v3D wCZenohfYMcJDH12Y5lebMRX7I2/pxvmS6uyv04IZuX2lQR6Q0S26N5m+as3qO5SuGZS uAJg5RGHD64QLw2QKKihuLG2bVGCfM5dGw7cB2hCSuUloZdwa9/xpS6tnYY39hAFLxxn tfxxS21liULP//Fp9HGzNwYMlQFibC8EGGMtT7lL6kEF2THnE6pnWMKtKaAC2Qk5MRmO 7jd2IaczFuc3YKJfnUBAtPsP4ZzIbNmvRTDvv3k/fyGTkE8hxq9F7QtvYkm56/3weCT3 VU4Q== 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=HFpFpNsMXDamKcXKNvB8nUQzeCgTMjPcA+nZ0NzhBTI=; b=vT2ZrcGwGpzTFS98Cd6iPvjvKAoCH5jVKW5fRVXqYg5/Tm/jC+Gvjt14Y5xxa3JG+c M0bBmVLzR7y494RS/nT6NKd5vgIAQkvCHLc4ByMb1JZDtAHH/Kdxi2sGqGk8X17wDs37 dVnpKhetUkLmnuRtvpMpyxS2pAxwiIuN8204dzx+BwkClIIoP560CdkI6N2i7ii3HhNf O8RhbIVTjmczw+bCZS0kQ5gM+ZZ/eZ7KBezbYtxXKztWVk1lqM7Rylwbki7pklT/ErS1 QuiR/hfk3keNylFdgFnRug7Sydm5xePnUhzXN4pZmwdBHfl7BXumXQM6L6uNYC88IxEg Wu0g== 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 96si6996056otq.153.2018.12.18.00.24.13 for ; Tue, 18 Dec 2018 00:24:13 -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 0123C15BF; Tue, 18 Dec 2018 00:24:13 -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 6BAF93F575; Tue, 18 Dec 2018 00:24:09 -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 2/5] mm/hugetlb: Enable PUD level huge page migration Date: Tue, 18 Dec 2018 13:54:07 +0530 Message-Id: <1545121450-1663-3-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 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. Reviewed-by: Naoya Horiguchi Reviewed-by: Steve Capper Acked-by: Michal Hocko 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 1b858d7..70bcd89 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -497,7 +497,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 Tue Dec 18 08:24:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10735107 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 20C0914E2 for ; Tue, 18 Dec 2018 08:24:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 112612A5F0 for ; Tue, 18 Dec 2018 08:24:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0525C2A643; Tue, 18 Dec 2018 08:24:22 +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 DDADD2A5F0 for ; Tue, 18 Dec 2018 08:24:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB1F38E0007; Tue, 18 Dec 2018 03:24:18 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C3CBA8E0001; Tue, 18 Dec 2018 03:24:18 -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 A939E8E0007; Tue, 18 Dec 2018 03:24:18 -0500 (EST) 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 7B73C8E0001 for ; Tue, 18 Dec 2018 03:24:18 -0500 (EST) Received: by mail-oi1-f198.google.com with SMTP id r82so941816oie.14 for ; Tue, 18 Dec 2018 00:24:18 -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=EdWy3L98kjLuKz23TRsdSnkAJ6GJGnEU9rbkwmKHh+8=; b=G2iT25KlIYkxkBod0I05s+KljNJCIfW0JIjyi4Pi/JhNbJJG20hYaFaIykrUn7gmzU vnekYRUzy5iWyAyHURYXvJWKwDte35w7Wj+nOVQ+GNi5FbC6bzc1v4BNR059DCtW6Omg dxG4sdpiIHU3ZoBzv0e/EoZLGqWYS7YwN+ninYtGx2QY08XTZHoNRtSnRrT6pGdgvdSx 3ZTm596U3EFnvwxd5Pf9ibFvxZtKeSnDwQ3JYuZPHc/xNoT41oessRII92nu4SKS/UHM r3gGQHqW+7/HDQERn7vlHWk8Gc2Qz61361minSj9g/agyOxdIW5ppaw6S1EhiGb8de8/ 35Rg== 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+aEWZYaIKYYV2/8lsQG5h/27r2wM7G5T8Q0vesaTQPKCZpSdNg50ai +t4EtbiRmrDCXUxi2kIuIl8eHFql/1Q+GWMg1tLEy2uww1kG2/cMXfPRagnSsIwMVfJxhM/u7EW 5pP5BMaCsW5UhjuuLKvf3HtoiPF+0J6XVLmFFVhKa/O3neD1DGFA8j1ctrrNGjSyQXQ== X-Received: by 2002:aca:ce86:: with SMTP id e128mr7647754oig.247.1545121458269; Tue, 18 Dec 2018 00:24:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/X5w662Wzb40LADifooV9deG1Yes74zDueTTLC3sFSMVEROpGYDxoQP6rt64VlbTA5x29VC X-Received: by 2002:aca:ce86:: with SMTP id e128mr7647730oig.247.1545121457547; Tue, 18 Dec 2018 00:24:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121457; cv=none; d=google.com; s=arc-20160816; b=lAmo+I15uSvUsQ5jk6TbHjfFQaya+7Fvyf+lA+eQtRTonIxulbqrr/TzztxLYaNyNe yGTNGVGeqZpuw3CoQGf5xcOljXZzwgJy3Frb1BKRD1KLLGPDabgVnfENVc+8eYWd1OKl IN7samt4RiF/p2bpRqHYDGEQLT6t3+RQtyBwkRj0QMGqkb9rUS/sICx40H3Ly7WK2+tC 2rp+rT83P9aQiMrs6gO+Ma+yeA9NHgLLKFU9kcOngcY8zKW92M4LjI7psytKDzXnP7w6 qxVh3Lzsta29IOWhrpk7byhph0sdtvnW79YF7d8o9GDGhYjJOavL2b7gCPWbmLmi9H+i /LCw== 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=EdWy3L98kjLuKz23TRsdSnkAJ6GJGnEU9rbkwmKHh+8=; b=VuuxtaO0iFg3eXUVvojEqruXyDWDhmi6qo9W2MdiuemaQMVcgaAEg4YocxGoh7XGcU W9GGMgufRSiu3ihGxZ93VyepPfJYMIFIxv6nWaBViV5uWn9VSYMydU9/+yicygtZ8QN2 ZiXtH9nNPLfMJbFzlOVlzGUqZKbcqXXoHT4CBswTCNRm1tBXMgQh0baNhYOllmV46f+A JfnBIKn88erCtnNzAzjUC8XoN2v5kr4SWa/2ev1TneFV+FkqSdM0yc4fzZiu5rE1yZ4M TFCSorStEpF22gzXIZmrDi1UblyMcYi8ZxNe7m8V5SsyaDBzbet/m1lPVNjg2KejLCo5 TkYQ== 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 z88si6727421ota.151.2018.12.18.00.24.17 for ; Tue, 18 Dec 2018 00:24:17 -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 EDB631650; Tue, 18 Dec 2018 00:24:16 -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 6D4F53F575; Tue, 18 Dec 2018 00:24:13 -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 3/5] mm/hugetlb: Enable arch specific huge page size support for migration Date: Tue, 18 Dec 2018 13:54:08 +0530 Message-Id: <1545121450-1663-4-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 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. Reviewed-by: Naoya Horiguchi Reviewed-by: Steve Capper Acked-by: Michal Hocko 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 70bcd89..4cc3871 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -493,18 +493,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 Tue Dec 18 08:24:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 10735109 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 12C0F1399 for ; Tue, 18 Dec 2018 08:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B2C2A5F0 for ; Tue, 18 Dec 2018 08:24:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB9C22A643; Tue, 18 Dec 2018 08:24:24 +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 BE6312A5F0 for ; Tue, 18 Dec 2018 08:24:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 982C08E0008; Tue, 18 Dec 2018 03:24:22 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8E0BE8E0001; Tue, 18 Dec 2018 03:24:22 -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 75E168E0008; Tue, 18 Dec 2018 03:24:22 -0500 (EST) 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 4BE818E0001 for ; Tue, 18 Dec 2018 03:24:22 -0500 (EST) Received: by mail-oi1-f200.google.com with SMTP id w128so932163oie.20 for ; Tue, 18 Dec 2018 00:24:22 -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=3yoLcaF9X0riWY3FZa+bGPKXBDWeiClM4vC0Hym+K/c=; b=YzIBl1bs2iYMw3fDdj2XhVQp76vuIQCGUbhM5VMf164374fu3sQFJ5AKp+W4GEjtG1 sekPqYDMcX37Hr6LRc43yaJkrAxf7kwW2Ny/sMvbNfQ+9DMM5/1VnJFLsVoGqzn1f7S9 mjpOXs37u98kQBDAb9YR5Y7HvhFbcKOUiXNKtbN/8RXXg5ZG2DoW/q+Ds7C+MXHzaTtf yW/x8vCRlXDFJ1e9IpU4IGkionDFUVeh2rZ6q2pXVluz+9DPJkVfpTAEDpdvaG5r9q3E NcaW0Rg4sKjVTX9IdTa7njLdjPJzsPXNTDFBXnXxHhwGYPjDTwjgpB3isB2ZeEHBRwKo v4Mw== 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+aEWYVGi2gHx1KK3IklT7Aq75LFyYEsVSDYKSz283a9nzpF5tIdOQn 5ES2O/z8ct+7ngZHOi+pzTqX8m5wG6zu56PT7PBbeWJq10e40sItOUbvGkdBcAcYXZ0DclJK7qg 0ZHuNNiGSdVEdzJYRxdOxzHQjfKALrPVW9tPOEpsoY/Y/qua7551P69Zulh7TPyig8w== X-Received: by 2002:aca:c43:: with SMTP id i3mr7635371oiy.157.1545121462078; Tue, 18 Dec 2018 00:24:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xp36mhrcPqW1WCpI76pNuwbs0SQXB8tmg9cV83NF/PmNci7zQqjtmegQkMzVPJZ0v1dAW2 X-Received: by 2002:aca:c43:: with SMTP id i3mr7635348oiy.157.1545121461478; Tue, 18 Dec 2018 00:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545121461; cv=none; d=google.com; s=arc-20160816; b=JLElb7BA7ELymbPNivMfd0cVGpHoXorpWZ/9/aCk9+lU1vygByqS3uTJ/8mpVb4Wx1 SGEXTkriEwmaKbMiv4yiGqR81aGivJp1L90/JQ7cAiOEntkgKy1hs3MkYqVapie6DKSp 6vA2LEB7y3+i3CXDmtwU+ZSougCghDHWcRpg7RlWgANsalFPWwUewFR/suTTxX20+Zo0 VaGfQNOZQx+u9vLukDjquEocnCDCatFPmcC381BmgTF4K+260aPyg7nZNSVNjfhITzTI QcSQOSToHb39AmYMkrLe7O7JL4PdzxAAqt7S2rmYqzvNoxvqxv3RIczRhmjFAz0CmZdX gklQ== 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=3yoLcaF9X0riWY3FZa+bGPKXBDWeiClM4vC0Hym+K/c=; b=oQstvG2/d/4I29fy01qS3F6oFKMjNySrX38cAQbUCXGszNzyvWeB+DmnUFQNANvm2O 5mZ+DhznYeX8Hn+exnGep7WxyTDxIYuToVjdYQQ7jp3zdC2dS/SPZKDGOIkSDCoN+gC7 ODqXOqA6phkiSYbnggEYjzH9o8lKUMGqQTCDF/VnGqzmpiOaFN9pCCysFds4I2UMTAG7 9LnRrEhqQS860WG3VAbXu45QcP9AAV0ngKauUNo1WOFRCJfCu/erhJjFZ2E5CnQA3HDl 6n6BPJj7ONqaQqoxuZYLDMoeBeeqR4hLM6VsZCezSQKq7bxyPvBk2oIXLtRN7FxsWHsZ 5q2w== 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 h1si6875386oti.258.2018.12.18.00.24.21 for ; Tue, 18 Dec 2018 00:24:21 -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 F10D715AB; Tue, 18 Dec 2018 00:24:20 -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 6828E3F575; Tue, 18 Dec 2018 00:24:17 -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 4/5] arm64/mm: Enable HugeTLB migration Date: Tue, 18 Dec 2018 13:54:09 +0530 Message-Id: <1545121450-1663-5-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 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 Reviewed-by: Naoya Horiguchi Reviewed-by: Steve Capper Acked-by: Catalin Marinas 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 ea2ab03..57d0c4bf 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1359,6 +1359,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 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);