From patchwork Wed Mar 17 06:23:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12144877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72CAFC433DB for ; Wed, 17 Mar 2021 06:24:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C1A7764F96 for ; Wed, 17 Mar 2021 06:24:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C1A7764F96 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EFBA86B0071; Wed, 17 Mar 2021 02:24:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAD056B0073; Wed, 17 Mar 2021 02:24:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D24E88D0001; Wed, 17 Mar 2021 02:24:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id B4BBB6B0071 for ; Wed, 17 Mar 2021 02:24:18 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 714758249980 for ; Wed, 17 Mar 2021 06:24:18 +0000 (UTC) X-FDA: 77928376596.11.DC76751 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf24.hostedemail.com (Postfix) with ESMTP id 09A26A0000FC for ; Wed, 17 Mar 2021 06:24:15 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id a22-20020a17090aa516b02900c1215e9b33so2634379pjq.5 for ; Tue, 16 Mar 2021 23:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JFW8/FgTFdT7uvRPjc6Otagd8anfs+Ol34lApL1vupo=; b=DBS9GbjcOW9+Rbw4XpKBiucRZGyfcZBNzGjjrnOlguKd4ql9Hvmnuk3+7IXUnQM2c/ iKDk7u4FrjFqde+y6JmRnLhHdwdhyp9DEzQl+9lO/hHt/FNCFqCpiir9dgeisSVkzncI ZZy6zAJa6lOLrffaM8SrO3d64RpYflUD2a014EeFmVPyWnRSJ/gj1u8OdsjKWX5O8//Y kWyFtT4xfeeS3h62Wng1k2aZndewPi8jwZ3+l72I2Op5eDHuOxE4uQw2zlusBqp/tuga OLoauXUxw5PwFXWQn5thCCVULBMOC5mIHN6Z3JUHPzZopDhXxf3mA/p25DqG6FVXrIEM Rpvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JFW8/FgTFdT7uvRPjc6Otagd8anfs+Ol34lApL1vupo=; b=GI0/rJvhAzNoIYd3EhOTOsqv5saSEYOPqD67zDBLTcTQDH5nsOumZqGpyvGopTpun3 AvlYXaPbNEDtoxiDqENn5xuBrB7NBDSIEHwXY7KmIOMX1iNOmomSVhS5Wgws+fjAP9D5 cBCZxikqJ/6glsCnkgF4lfPlQf42LJnpXWJxpucE9KVS2vryJBo6cGe1iJHd+gdABsFr A20Jhs10IgZUWXUbF+pthDPJomESN9AYnjHOVk5SmCgPfVQoruiyLXEhe7UiPl1Sj17T 1ZVVCYuSy1Fw06G0+tH9oaKPG/XKzcGGNJOSZNpna69t97hfDJ9KrcvDDB5iq8kYhl5W 8BTA== X-Gm-Message-State: AOAM5333k8WYz1WtHlXpocN+YsCjrCPwcJPd4BkcoikAnwGcP5hT6BZw YJBC5EHHqxZuqIBzfd6NGBlyxvQngl0= X-Google-Smtp-Source: ABdhPJwFKdxetbaIOTS0SrvcvdqurekRwLM/u2w5nDyR2H5MRVWMYl1WBScSVdD0LMXytHcjROewxA== X-Received: by 2002:a17:90a:1509:: with SMTP id l9mr2921447pja.163.1615962254531; Tue, 16 Mar 2021 23:24:14 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (58-6-239-121.tpgi.com.au. [58.6.239.121]) by smtp.gmail.com with ESMTPSA id s19sm17959620pfh.168.2021.03.16.23.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Mar 2021 23:24:13 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Rick Edgecombe , Ding Tianhong Subject: [PATCH v13 00/14] huge vmalloc mappings Date: Wed, 17 Mar 2021 16:23:48 +1000 Message-Id: <20210317062402.533919-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Stat-Signature: 9rmoyeprj7fcgpak61itcr3r5s8kkb6b X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 09A26A0000FC Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=mail-pj1-f50.google.com; client-ip=209.85.216.50 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615962255-207963 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: Important compound page fix thanks to Ding Tianhong. Thanks, Nick Since v12: - Use compound pages so it works with remap_vmalloc_range [noticed by Ding] - Fix debug_vm_pgtable.c compile error. Since v11: - ARM compile fix (patch 1) - debug_vm_pgtable compile fix Since v10: - Fixed code style, most > 80 colums, tweak patch titles, etc [thanks Christoph] - Made huge vmalloc code and data structure compile away if unselected [Christoph] - Archs only have to provide arch_vmap_p?d_supported for levels they implement [Christoph] Since v9: - Fixed intermediate build breakage on x86-32 !PAE [thanks Ding] - Fixed small page fallback case vm_struct double-free [thanks Ding] Since v8: - Fixed nommu compile. - Added Kconfig option help text - Added VM_NOHUGE which should help archs implement it [suggested by Rick] Since v7: - Rebase, added some acks, compile fix - Removed "order=" from vmallocinfo, it's a bit confusing (nr_pages is in small page size for compatibility). - Added arch_vmap_pmd_supported() test before starting to allocate the large page, rather than only testing it when doing the map, to avoid unsupported configs trying to allocate huge pages for no reason. Since v6: - Fixed a false positive warning introduced in patch 2, found by kbuild test robot. Since v5: - Split arch changes out better and make the constant folding work - Avoid most of the 80 column wrap, fix a reference to lib/ioremap.c - Fix compile error on some archs *** BLURB HERE *** Nicholas Piggin (14): ARM: mm: add missing pud_page define to 2-level page tables mm/vmalloc: fix HUGE_VMAP regression by enabling huge pages in vmalloc_to_page mm: apply_to_pte_range warn and fail if a large pte is encountered mm/vmalloc: rename vmap_*_range vmap_pages_*_range mm/ioremap: rename ioremap_*_range to vmap_*_range mm: HUGE_VMAP arch support cleanup powerpc: inline huge vmap supported functions arm64: inline huge vmap supported functions x86: inline huge vmap supported functions mm/vmalloc: provide fallback arch huge vmap support functions mm: Move vmap_range from mm/ioremap.c to mm/vmalloc.c mm/vmalloc: add vmap_range_noflush variant mm/vmalloc: Hugepage vmalloc mappings powerpc/64s/radix: Enable huge vmalloc mappings .../admin-guide/kernel-parameters.txt | 2 + arch/Kconfig | 11 + arch/arm/include/asm/pgtable-3level.h | 2 - arch/arm/include/asm/pgtable.h | 3 + arch/arm64/include/asm/vmalloc.h | 24 + arch/arm64/mm/mmu.c | 26 - arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/vmalloc.h | 20 + arch/powerpc/kernel/module.c | 22 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 21 - arch/x86/include/asm/vmalloc.h | 20 + arch/x86/mm/ioremap.c | 19 - arch/x86/mm/pgtable.c | 13 - include/linux/io.h | 9 - include/linux/vmalloc.h | 46 ++ init/main.c | 1 - mm/debug_vm_pgtable.c | 4 +- mm/ioremap.c | 225 +------- mm/memory.c | 66 ++- mm/page_alloc.c | 5 +- mm/vmalloc.c | 485 +++++++++++++++--- 21 files changed, 621 insertions(+), 404 deletions(-)