Received: by 10.192.165.148 with SMTP id m20csp2211854imm; Thu, 26 Apr 2018 07:33:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrBtpkfK4K+OhArFdID1+j4d+sz6LFJgGhIrnQhtKIoiLnDEeu2DJWa4u3uOX/uccFxmokN X-Received: by 10.98.152.29 with SMTP id q29mr10006262pfd.65.1524753201799; Thu, 26 Apr 2018 07:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524753201; cv=none; d=google.com; s=arc-20160816; b=K5/5IKbEsTLs6Pkx7Xn7Q/v+IXWOzUVHtUaZhLtye4Wk2ll129hNQUBR8qiK130SPe jjWHeg6ws6z1X4CcdoMAwZZorBtLas+xP6wJVUhggo5vJBBy+2JBsGLzg8tGlQME8EAY k09UeUKTZc8wICgPq1T4HFfCxBMLQWsq60U/68v93DQW9JUlzTsmgqj0BIlCyZ5xJfjM UUl+aotWdRbzJYn3mcZpHXTN05BFWBs8r4Q9Q0AhOE6RqKwOP9p4Lc5rqMF6wvdT4c4M u3djaNyUJ3kxqZIX+RtXIJWKFyL+Bbi9oPTGZsPc35AUPqydNWID6ZNmbX141bxGn3BI 52Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature:arc-authentication-results; bh=E3PNGaPY3F0M0e8EkFenEXv92XVCiiZdXpeNhL1n9G0=; b=h0TVN1znt/peR6Sj3kpt0iKb8a7lOLm5pBI+U/SFB8qblF0Ar3kmgcD53ZkvOqxf9p 7+DKdR80HNtjuq15a6F03ArO7dsD1uUpmrkSe4an6zgLbZYyqUl99lYOuFDEJB0FQByx A/w5JeSPFflijWgjuYp19he7FFoImaC8AwDSz3N4m0zRxyGTljIP4H/6xkH3icb1adlQ owykfDQjt+UsFx9r/QmGwj7oNBNz7jVYFEhTBI5Ts9yVIh98L08GMIPZJ4QWZAtnTb3O lYcS+RUB0EPelZEJo8bbrXcyDPJDFFsnLOq/CKFbRnj+T77vczvA41djW0QPEa7m/7AU DSPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=G3elfgiA; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=OytRFPk8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f31-v6si19369254plb.212.2018.04.26.07.33.07; Thu, 26 Apr 2018 07:33:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@sent.com header.s=fm3 header.b=G3elfgiA; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=OytRFPk8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932301AbeDZOaf (ORCPT + 99 others); Thu, 26 Apr 2018 10:30:35 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:54695 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756425AbeDZO2v (ORCPT ); Thu, 26 Apr 2018 10:28:51 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id BE320218C7; Thu, 26 Apr 2018 10:28:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 26 Apr 2018 10:28:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=cc :date:from:message-id:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=E3PNGaPY3F0M0e8EkFenEXv92XVCiiZdXpeNhL1n9 G0=; b=G3elfgiAVIAQADB3Holant1pjyQ0HgJAuXhfbp3RGMNt3jMbTLj74Gp5h SAY0YFHwxlHKX4lX33f/V1gwDZmjoI3QaowuG5sxvxJFXfpvmcpWe7l631GilvD9 0Pdo8SQx0zdUYHn+udcBAjfu9e2Bvo+jKIDtliQlZe63W8iy88nEpwbib9DftQ9d tKMNABXcwcJvLjnO8U6Vb/xMlkOB2T+9XaEnX7Gpg9IBLfthfT1lKwTSnmwnIkJR LJxGiq8yYtrb+poUNKulgOFAz28/lyIADdBMNpa7nsfamIE4lutSXqU3Z35Li/1x htuV2yvgCJDKkCS/9YCzzmDZrG5xQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=E3PNGaPY3F0M0e8Ek FenEXv92XVCiiZdXpeNhL1n9G0=; b=OytRFPk8rOxxkB++nXDW3NokaFEl8FUP6 jiyQLwhpB8ilytZ7tQURo10iTrDSB+ZjU+Cgz6u2St3QWCHyZLaq0Bk9jfPJl6If il1JmId59kLXWBoSnWpjDCo2EieFzSGPOpSUQmtnPEdE/FwVQH/vsibNLJ30Hoh9 jVH82CCMhQROxZdW+B2GQI6ytiLauGGs7ebBbolmgTxN/QKkZV8nPB9ursnlslYe iqpWtakGarexifNBQO/PexJ5cRS1PyVycBxp+xxsK/Xp6QOOgbr/PYvFLrzCDjEu 4bUSwja1/4FvNvSNMhUZ4AsZiIQPvpUa9VWT3tl1O6/diAahF6i2g== X-ME-Sender: Received: from tenansix.rutgers.edu (pool-165-230-225-59.nat.rutgers.edu [165.230.225.59]) by mail.messagingengine.com (Postfix) with ESMTPA id E9CB7E47A0; Thu, 26 Apr 2018 10:28:49 -0400 (EDT) From: Zi Yan To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Zi Yan , Vineet Gupta , linux-snps-arc@lists.infradead.org, Russell King , Christoffer Dall , Marc Zyngier , linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Steve Capper , Kristina Martsenko , Dan Williams , Thomas Gleixner , Ingo Molnar , "Kirill A. Shutemov" , x86@kernel.org, Ralf Baechle , James Hogan , Michal Hocko , linux-mips@linux-mips.org, Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , "Aneesh Kumar K.V" , Ram Pai , Balbir Singh , Naoya Horiguchi , linuxppc-dev@lists.ozlabs.org, Martin Schwidefsky , Heiko Carstens , Janosch Frank , linux-s390@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, "Huang, Ying" Subject: [RFC PATCH 0/9] Enable THP migration for all possible architectures Date: Thu, 26 Apr 2018 10:27:55 -0400 Message-Id: <20180426142804.180152-1-zi.yan@sent.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zi Yan Hi all, THP migration is only enabled on x86_64 with a special ARCH_ENABLE_THP_MIGRATION macro. This patchset enables THP migration for all architectures that uses transparent hugepage, so that special macro can be dropped. Instead, THP migration is enabled/disabled via /sys/kernel/mm/transparent_hugepage/enable_thp_migration. I grepped for TRANSPARENT_HUGEPAGE in arch folder and got 9 architectures that are supporting transparent hugepage. I mechanically add __pmd_to_swp_entry() and __swp_entry_to_pmd() based on existing __pte_to_swp_entry() and __swp_entry_to_pte() for all these architectures, except tile which is going to be dropped. I have successfully compiled all these architectures, but have NOT tested them due to lack of real hardware. I appreciate your help, if the maintainers of these architectures can do a quick test with the code from https://github.com/x-y-z/thp-migration-bench . Please apply patch 9 as well to enable THP migration. By enabling THP migration, migrating a 2MB THP on x86_64 machines takes only 1/3 time of migrating equivalent 512 4KB pages. Hi Naoya, I also add soft dirty support for powerpc and s390. It would be great if you can take a look at patch 6 & 7. Feel free to give comments. Thanks. Cc: linux-mm@kvack.org Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Cc: Russell King Cc: Christoffer Dall Cc: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas Cc: Will Deacon Cc: Steve Capper Cc: Kristina Martsenko Cc: Dan Williams Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "Kirill A. Shutemov" Cc: x86@kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Michal Hocko Cc: linux-mips@linux-mips.org Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: "Aneesh Kumar K.V" Cc: Ram Pai Cc: Balbir Singh Cc: Naoya Horiguchi Cc: linuxppc-dev@lists.ozlabs.org Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: Janosch Frank Cc: linux-s390@vger.kernel.org Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Cc: "Huang, Ying" Zi Yan (9): arc: mm: migrate: add pmd swap entry to support thp migration. arm: mm: migrate: add pmd swap entry to support thp migration. arm64: mm: migrate: add pmd swap entry to support thp migration. i386: mm: migrate: add pmd swap entry to support thp migration. mips: mm: migrate: add pmd swap entry to support thp migration. powerpc: mm: migrate: add pmd swap entry to support thp migration. s390: mm: migrate: add pmd swap entry to support thp migration. sparc: mm: migrate: add pmd swap entry to support thp migration. mm: migrate: enable thp migration for all possible architectures. arch/arc/include/asm/pgtable.h | 2 ++ arch/arm/include/asm/pgtable.h | 2 ++ arch/arm64/include/asm/pgtable.h | 2 ++ arch/mips/include/asm/pgtable-64.h | 2 ++ arch/powerpc/include/asm/book3s/32/pgtable.h | 2 ++ arch/powerpc/include/asm/book3s/64/pgtable.h | 17 ++++++++++++ arch/powerpc/include/asm/nohash/32/pgtable.h | 2 ++ arch/powerpc/include/asm/nohash/64/pgtable.h | 2 ++ arch/s390/include/asm/pgtable.h | 5 ++++ arch/sparc/include/asm/pgtable_32.h | 2 ++ arch/sparc/include/asm/pgtable_64.h | 2 ++ arch/x86/Kconfig | 4 --- arch/x86/include/asm/pgtable-2level.h | 2 ++ arch/x86/include/asm/pgtable-3level.h | 2 ++ arch/x86/include/asm/pgtable.h | 2 -- fs/proc/task_mmu.c | 2 -- include/asm-generic/pgtable.h | 21 ++------------- include/linux/huge_mm.h | 9 +++---- include/linux/swapops.h | 4 +-- mm/Kconfig | 3 --- mm/huge_memory.c | 27 +++++++++++++------- mm/migrate.c | 6 ++--- mm/rmap.c | 5 ++-- 23 files changed, 73 insertions(+), 54 deletions(-) -- 2.17.0