From patchwork Fri Aug 21 04:44:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11728107 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 918DE722 for ; Fri, 21 Aug 2020 04:44:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5DDD52075E for ; Fri, 21 Aug 2020 04:44:41 +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="c7SEuBm9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5DDD52075E 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 69E148D000C; Fri, 21 Aug 2020 00:44:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 626138D0005; Fri, 21 Aug 2020 00:44:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5162D8D000C; Fri, 21 Aug 2020 00:44:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0092.hostedemail.com [216.40.44.92]) by kanga.kvack.org (Postfix) with ESMTP id 368288D0005 for ; Fri, 21 Aug 2020 00:44:40 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EDA7E181AEF09 for ; Fri, 21 Aug 2020 04:44:39 +0000 (UTC) X-FDA: 77173335078.13.push18_17126fa27036 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id B9E9618140B60 for ; Fri, 21 Aug 2020 04:44:39 +0000 (UTC) X-Spam-Summary: 1,0,0,cd066c03188327f3,d41d8cd98f00b204,npiggin@gmail.com,,RULES_HIT:41:355:379:541:973:988:989:1260:1311:1314:1345:1437:1515:1535:1542:1711:1730:1747:1777:1792:1801:2198:2199:2393:2553:2559:2562:2731:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3873:3874:4362:4605:5007:6119:6261:6653:7875:9413:10004:11026:11232:11473:11658:11914:12043:12296:12297:12438:12517:12519:12679:12895:13894:14096:14180:14181:14394:14687:14721:21060:21080:21444:21450:21451:21627:21666:30054:30090,0,RBL:209.85.210.194:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04ygd9yc9kuxsyd36est6j1a4dwwxyc9n3dthr3p3ci6scfwygiskpuwkf4tkq8.iukkefe3txzhqksdrfbkgarwgp4gjfbssaa5fiqhkasbp5werrnb1zfyydnkrkr.1-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: push18_17126fa27036 X-Filterd-Recvd-Size: 5186 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 04:44:39 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id d188so474445pfd.2 for ; Thu, 20 Aug 2020 21:44:39 -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=2FijGblDddjp78CZtsuopymeT4GIAirJaILJzMaKauU=; b=c7SEuBm9ZYiwMyDgcCjUP4zkcAqcJWkSnCZkOh9wB/Q1IQYWihz+hZnrfBEOh8YtOo 7oKYdorv5eBuZ6kfHQNFNprGFy29TgABA5JyE/oEjJ7SqNA9UsflqSpOSQH6A6F0HgO4 n1Ms4wHgOaegdSr9pxT+782mC2bPskftyVMT9UuR05WNlfA31jSh2BBdEfrIikfeKbGT 7XnmmP3RgtcKmGKSgn73d5a2tMgGTfWoCkCTZCWirqaujLImDZBUJHgejXJwHDcuqYsO +931rfrU7AbK0Ggp/BlSjg9QxvFgq51FZw7CPgSBFVbsPK3EMHLVfEyg7WldxgZDwgzs czVA== 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=2FijGblDddjp78CZtsuopymeT4GIAirJaILJzMaKauU=; b=qEzLLC53WrSi4bN9vA3/nFUinrHfiZoAyGNZuM8Ww69GzWmLf4B0ec3W6WD1/8yit5 7BSAME0q0I8rUyIiwf3WBsfgJdet8NdlsThJZmcnL9FF3bcJAuUZ4RBsCFAFq9YXKt08 ZC/ZuonqfGHYoppKrfzHfzCo96B+TqPdWu3Xpb68l4kG1fmRTE/a4KUdkz2Q+dHmlyuU 6GN7KomrSh2q8qjxePmbrScuzZxZtGmpLb/T0KEwId4ncOZok60ohui/0/Dd3p0o2EkY ECKw6FxYOWlYgMsgSOnq6283iMb6wWuIXVzWCQd961CJBObOuVSX0lEqrQib81SVLmd1 gYSg== X-Gm-Message-State: AOAM533cfMa7c5KVq1A5HqrNYpuV0egj/u+ezOvXHWqZsayf2CJr/NU+ OqjBTVw7R3/e3LlBjVC+v2A6kIXPhEc= X-Google-Smtp-Source: ABdhPJw13X7rw0q4xbArvVS+WyTpffCFf61Owreem8v6Q4CEO1zlzy3RKePEZ/FsBQwm1kKEDBNCCQ== X-Received: by 2002:a63:cf03:: with SMTP id j3mr1043772pgg.198.1597985077991; Thu, 20 Aug 2020 21:44:37 -0700 (PDT) Received: from bobo.ibm.com (61-68-212-105.tpgi.com.au. [61.68.212.105]) by smtp.gmail.com with ESMTPSA id l9sm683374pgg.29.2020.08.20.21.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 21:44:37 -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, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron Subject: [PATCH v5 0/8] huge vmalloc mappings Date: Fri, 21 Aug 2020 14:44:19 +1000 Message-Id: <20200821044427.736424-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: B9E9618140B60 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: I made this powerpc-only for the time being. It shouldn't be too hard to add support for other archs that define HUGE_VMAP. I have booted x86 with it enabled, just may not have audited everything. Hi Andrew, would you care to put this in your tree? Thanks, Nick 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 (8): 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 lib/ioremap: rename ioremap_*_range to vmap_*_range mm: HUGE_VMAP arch support cleanup mm: Move vmap_range from lib/ioremap.c to mm/vmalloc.c mm/vmalloc: add vmap_range_noflush variant mm/vmalloc: Hugepage vmalloc mappings .../admin-guide/kernel-parameters.txt | 2 + arch/Kconfig | 4 + arch/arm64/mm/mmu.c | 12 +- arch/powerpc/Kconfig | 1 + arch/powerpc/mm/book3s64/radix_pgtable.c | 10 +- arch/x86/mm/ioremap.c | 12 +- include/linux/io.h | 9 - include/linux/vmalloc.h | 13 + init/main.c | 1 - mm/ioremap.c | 231 +-------- mm/memory.c | 60 ++- mm/page_alloc.c | 4 +- mm/vmalloc.c | 456 +++++++++++++++--- 13 files changed, 476 insertions(+), 339 deletions(-)