From patchwork Sat Nov 28 15:25:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11937555 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 3F699C63697 for ; Sat, 28 Nov 2020 15:26:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 92230246A7 for ; Sat, 28 Nov 2020 15:26:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r3NsuPL7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 92230246A7 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 B517C6B005C; Sat, 28 Nov 2020 10:26:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B015A6B005D; Sat, 28 Nov 2020 10:26:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A16C86B0068; Sat, 28 Nov 2020 10:26:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 8A09F6B005C for ; Sat, 28 Nov 2020 10:26:11 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 46B28180AD80F for ; Sat, 28 Nov 2020 15:26:11 +0000 (UTC) X-FDA: 77534202942.10.crook49_4111c8d27391 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 1A15116A4A5 for ; Sat, 28 Nov 2020 15:26:11 +0000 (UTC) X-HE-Tag: crook49_4111c8d27391 X-Filterd-Recvd-Size: 6228 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Sat, 28 Nov 2020 15:26:10 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id w6so7061050pfu.1 for ; Sat, 28 Nov 2020 07:26:10 -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=GHPYzM4jRC5rTtI6jITOYY+6mqWQDFCFmyVj9lbViqM=; b=r3NsuPL716Gbgc91UvbQ7Phv454iWIU3Ws+yRn1NF8ztZyJQEC12d/w6ht7/hkUIB2 GQ7zk+ZsmiUP5fj1Y+CNw5ilGJdKf4uR1xAysGjstUx2EwVyBaj6ky+/iCCcGC0qaSsg 59lI7fxzzbMkqSVze/gFz01BoXbyZF1+wGQGjIzJk6gTPmzDzS20twqYprzF16NuikVx Y/vMpPW187nLpKZmVnGk2UdsdFIN81xJkOTSUMC3UHpC1rmRNPfRfsv9f9hq2pLTO0of tJBpJn8dn4aff5mwgKy4I/VDRXC6xdx0Q+4BBGlWQ3Xj4xlZ36ycPUhKIrWGWIsJCQ58 c74w== 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=GHPYzM4jRC5rTtI6jITOYY+6mqWQDFCFmyVj9lbViqM=; b=f+UbJK6tgr2h5nnNwbPn8Z4pquPAn9qTNOXxIyIXl7JK2U6QehuTX4beTBHc+iPVuC VqU1pLblC+a/8XByo5zsN6+Ikv4lf3McxG8qMoRgRZSJfUjs6MTOX81glH9eOD7XJGrr MTizQBEzMrka0OD8ftrY0+y3VEjPaHnANDfSYxHf8Vbsg0+Lbw6Y42OlbLfEJzbR1/al JVxvHYAZkENqyn7MDacjKB/Ez3/P8ziufHFNmKF7aefIqoj2KeGQQsA1lMrvy+NQSr9Y J9AgXrR4Jha1AaOybPqtP587h+GpbYtrI3Uob5Auny+RpKvPzVLLIMv3gnMqAzsX7eTj 9sMg== X-Gm-Message-State: AOAM533j4lyI46BiwCwDkOLdhgSYhMTicSKlS5Vej7gUtnq4tBGGz5br Yxu1kf/smKnYdUyqT/82k7Gihdrg/Bg= X-Google-Smtp-Source: ABdhPJzATmCEtGS9aoj2vYvtmzZ2I4PDKHAI5rV7JzJixtHGXrGtJ2A5RqcQYH/fOjEekJVYwlteoQ== X-Received: by 2002:aa7:8f09:0:b029:18c:4cc6:891d with SMTP id x9-20020aa78f090000b029018c4cc6891dmr11676493pfr.46.1606577169501; Sat, 28 Nov 2020 07:26:09 -0800 (PST) Received: from bobo.ibm.com (193-116-103-132.tpgi.com.au. [193.116.103.132]) by smtp.gmail.com with ESMTPSA id d22sm15500173pjw.11.2020.11.28.07.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2020 07:26:08 -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 Subject: [PATCH v8 00/12] huge vmalloc mappings Date: Sun, 29 Nov 2020 01:25:47 +1000 Message-Id: <20201128152559.999540-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, Please consider this for -mm. Thanks, Nick 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] *** 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 | 4 + 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/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 | 10 + init/main.c | 1 - mm/ioremap.c | 225 +-------- mm/memory.c | 66 ++- mm/page_alloc.c | 5 +- mm/vmalloc.c | 453 +++++++++++++++--- 17 files changed, 529 insertions(+), 395 deletions(-)