From patchwork Sun Jan 24 08:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 12042145 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 7263CC433E0 for ; Sun, 24 Jan 2021 08:22:57 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D91AB22582 for ; Sun, 24 Jan 2021 08:22:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D91AB22582 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 10A2D6B0007; Sun, 24 Jan 2021 03:22:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 093916B0008; Sun, 24 Jan 2021 03:22:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9CC16B000A; Sun, 24 Jan 2021 03:22:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0098.hostedemail.com [216.40.44.98]) by kanga.kvack.org (Postfix) with ESMTP id D19886B0007 for ; Sun, 24 Jan 2021 03:22:55 -0500 (EST) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 91138181AF5CA for ; Sun, 24 Jan 2021 08:22:55 +0000 (UTC) X-FDA: 77739977910.24.plot99_5c067722757b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 6EA591A4A0 for ; Sun, 24 Jan 2021 08:22:55 +0000 (UTC) X-HE-Tag: plot99_5c067722757b X-Filterd-Recvd-Size: 6212 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Sun, 24 Jan 2021 08:22:55 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id b8so5717151plh.12 for ; Sun, 24 Jan 2021 00:22:54 -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=vxwgyuW5XH28Q8/mj8v779VyclgJcF5KFu/DzCcjZnI=; b=Fs0JCb3pwKQ3Qw2tgKBDrI0dac88HUkrErNJBG0hmRLf5MyNBR21T+TPQXWbZhzXWR 5CKgAqureRQX5U3msaUj+PUlSx+eroPq001obnVV7TfXWOm2oSyNkyE7wZM7J9Pv8Mta xDge4jkywbVh2WRt+ij2Wvj7yIwZDjn6BDaEtOt4/C2gHaR7aiHu96kIa1ZiMKOG6JX1 Vdh6g9cgk2rsp+rAgX7ps8P3fUZTlODulpbF24noaVvODB7zOCWZr/S0xRJRBhHCPNRm j4Jo4Rxa5z8wzdHpC1OgyDz4e7JPp8DkXwn0yn6X7IPbVkLVco3Zbc8HUofZ34N5kcGN zLUw== 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=vxwgyuW5XH28Q8/mj8v779VyclgJcF5KFu/DzCcjZnI=; b=kEZUUQwqC6riTZjeRcUQ1Rb12gr1w7q8HPMoCqfH/mzn4hGazgZcESsYeMyMl/basq gO7lXULk1HaCQqmcBMMwBL9n2LAbYxpYW3TET7vDuzZZI88CN3NB8sxvJRvLksAZtCXZ cu+OpNQNbPeb/Sox0lxtJW3TQOl18fTC8cAWxUOxp1DE2QKPNOro6I0nd4Oa/IauiAPG NKnMpQ5asIp5u4fXRWpsDml8eOV11clm6PQF/TbReGwAshURjscwNR6qHGl/Ky6DdC6F ZQmbmEDNFSSLV+tFvD0POfWX87opb/qdARsdKoVphSQOBPviosRy7tuS5TMItjKX6mgo FdDQ== X-Gm-Message-State: AOAM53396wBX6FApxY2GcJfWV9ZKsUO2FOICDk0Eg3q2KNyrRU7iCd6N PTBFceydTknhwH9IlTEWUXGGgueJrYM= X-Google-Smtp-Source: ABdhPJwork++HKOseNPRq3Vls6uVbkN5KsPiEY5ah8ze3Qk+PSvpG3taYXPMNJK4g7gAUsggjvJOSg== X-Received: by 2002:a17:90b:b0b:: with SMTP id bf11mr10064810pjb.122.1611476573791; Sun, 24 Jan 2021 00:22:53 -0800 (PST) Received: from bobo.ozlabs.ibm.com ([124.170.13.62]) by smtp.gmail.com with ESMTPSA id gb12sm11799757pjb.51.2021.01.24.00.22.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jan 2021 00:22:53 -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 , Ding Tianhong Subject: [PATCH v10 00/12] huge vmalloc mappings Date: Sun, 24 Jan 2021 18:22:18 +1000 Message-Id: <20210124082230.2118861-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: Fixed a couple of bugs that Ding noticed in review and testing. Thanks, Nick 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 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 *** BLURB HERE *** 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 | 455 +++++++++++++++--- 18 files changed, 563 insertions(+), 399 deletions(-)