From patchwork Sat Dec 5 06:57:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11952943 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 A0E09C4361A for ; Sat, 5 Dec 2020 06:57:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1417522D2A for ; Sat, 5 Dec 2020 06:57:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1417522D2A 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 067696B0036; Sat, 5 Dec 2020 01:57:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 018526B005D; Sat, 5 Dec 2020 01:57:38 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E485E6B0068; Sat, 5 Dec 2020 01:57:38 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id C9ED96B0036 for ; Sat, 5 Dec 2020 01:57:38 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 802178249980 for ; Sat, 5 Dec 2020 06:57:38 +0000 (UTC) X-FDA: 77558322996.21.trade43_271311e273cb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 5D827180442C2 for ; Sat, 5 Dec 2020 06:57:38 +0000 (UTC) X-HE-Tag: trade43_271311e273cb X-Filterd-Recvd-Size: 6623 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Sat, 5 Dec 2020 06:57:37 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id l23so4483313pjg.1 for ; Fri, 04 Dec 2020 22:57:37 -0800 (PST) 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=074wL6ZBgABmXkOs/NT61EJN0HBh0dhkxvXZ++X/yaI=; b=J39tLhFdiM/eYZNAhg85XVZeU7vlVYLTE2YpuzmX6S36rV2NljZYLQse33dtlTfU+D P0A9XxiD/TRZFku3U3uZmRO+9sMfVlrPdOrUY0ub9mOfSoaFbGi7KBycRjIRZ1I1f7G3 AOg0CwR2kDU4wX7GGBTPPl2qINMfeDZC+MT4uWns92NjqsKo/IZwtBmm7faHE4YvF91k XkzZVlYRiLabOUV2ZGcN1Y2QhSwfLCZwb3ldvzRkdexCD//G76XOV0MFbsjUrZ5g0ov+ SorgGaftGRsp0BWTZImGOqW1L2K+kHrJOBP8qwt2V6kfphRegH2pVENoKPosU6WKDL5u S8eA== 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=074wL6ZBgABmXkOs/NT61EJN0HBh0dhkxvXZ++X/yaI=; b=Uq48/LO3u+1p3BFVtg6/730cdlqO7Qhc1vLNlCOLszG642rw7BE3D3FvSle2l8vLXq O0NMz4DTNsdj2IM2rr3S8+g3FCCGJITK7VOq2ppIOHKgZfkcEvLKSrLX+16CO2IeS/bA fGTU4shXcU7+69oRAMAxIy+Vr854En2h6Pj9r0jgRtCft/QqLCID13ACBS9LbVSu2J88 1028TImD8ijcbkULEX4xMqi+tGjwD626TCJRPxObeMroD4KPxToyaZEZA+ZdMCbv5t3/ VRbd0LmZvNBHF9fH4nJr8FtDTc+mT9DD2Jo3+ev9ZVGm40VE7jpNO/8uB1P2D+LAvWsw 0yzQ== X-Gm-Message-State: AOAM530g+8bFoph5IgVvhojPii/KeCuaGBA0I1gaSIvAUpTwVjQOsCI8 uQ7U7uDofUdbfRIA6tIeocEoosJcub4= X-Google-Smtp-Source: ABdhPJwD8LBysVSEMi9XYXVOROVfRZw/7sF9SVYYn1E01iFvQoYVyH6bH0o2iaHCD6/K8Gh1B/sbWQ== X-Received: by 2002:a17:902:9b85:b029:da:1684:cc82 with SMTP id y5-20020a1709029b85b02900da1684cc82mr7368955plp.41.1607151456568; Fri, 04 Dec 2020 22:57:36 -0800 (PST) Received: from bobo.ozlabs.ibm.com ([1.129.145.238]) by smtp.gmail.com with ESMTPSA id a14sm1110848pfl.141.2020.12.04.22.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 22:57:35 -0800 (PST) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy , Rick Edgecombe Subject: [PATCH v9 00/12] huge vmalloc mappings Date: Sat, 5 Dec 2020 16:57:13 +1000 Message-Id: <20201205065725.1286370-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 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: Hi Andrew, A couple of things Rick noticed, he's working on huge module mappings to help iTLB pressure and seems to think this series will be useful infrastructure for his work. I think it finally should be just about ready. Thanks, Nick 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 Since v4: - Fixed an off-by-page-order bug in v4 - Several minor cleanups. - Added page order to /proc/vmallocinfo - Added hugepage to alloc_large_system_hage output. - Made an architecture config option, powerpc only for now. Since v3: - Fixed an off-by-one bug in a loop - Fix !CONFIG_HAVE_ARCH_HUGE_VMAP build fail - Hopefully this time fix the arm64 vmap stack bug, thanks Jonathan Cameron for debugging the cause of this (hopefully). Since v2: - Rebased on vmalloc cleanups, split series into simpler pieces. - Fixed several compile errors and warnings - Keep the page array and accounting in small page units because struct vm_struct is an interface (this should fix x86 vmap stack debug assert). [Thanks Zefan] Nicholas Piggin (12): mm/vmalloc: fix vmalloc_to_page for huge vmap mappings 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: 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 | 10 + arch/arm64/include/asm/vmalloc.h | 25 + arch/arm64/mm/mmu.c | 26 - arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/vmalloc.h | 21 + arch/powerpc/kernel/module.c | 13 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 21 - arch/x86/include/asm/vmalloc.h | 23 + arch/x86/mm/ioremap.c | 19 - arch/x86/mm/pgtable.c | 13 - include/linux/io.h | 9 - include/linux/vmalloc.h | 27 ++ init/main.c | 1 - mm/ioremap.c | 225 +-------- mm/memory.c | 66 ++- mm/page_alloc.c | 5 +- mm/vmalloc.c | 454 +++++++++++++++--- 18 files changed, 564 insertions(+), 397 deletions(-)