From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 A6652C433E0 for ; Tue, 26 Jan 2021 09:50:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3327320780 for ; Tue, 26 Jan 2021 09:50:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3327320780 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 B6CC58D00BB; Tue, 26 Jan 2021 04:50:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AF6938D00B0; Tue, 26 Jan 2021 04:50:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BF628D00BB; Tue, 26 Jan 2021 04:50:12 -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 82D2E8D00B0 for ; Tue, 26 Jan 2021 04:50:12 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 45304181AF5CC for ; Tue, 26 Jan 2021 09:50:12 +0000 (UTC) X-FDA: 77747455464.08.cry24_06110c62758d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 21A6D1819E798 for ; Tue, 26 Jan 2021 09:50:12 +0000 (UTC) X-HE-Tag: cry24_06110c62758d X-Filterd-Recvd-Size: 6683 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 Jan 2021 09:50:11 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id i7so11152727pgc.8 for ; Tue, 26 Jan 2021 01:50:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=0BoP+OYH6EXdZxnw4jTi+ce0h1kJJ+YvrP995HEeEfk=; b=HAPMFftRZxQG/fBZeVQHKpfYqezKjPzUFWYma5LOeOZuhMrSgaQnFghwR82Hi0Tcad 6i4fqeK0OEgAe0lPjMHX+w/LEXKabwaw3WgD+7gti+Eq3I7UGN+6+YRRaTKc5T6KgGFT x+FH14E2Wga0siPTYUQdnIEKHn+e2plYn73AjOkuryD4Sp/FSHEuDne1lLKJVidRQtNt obqeveTlFYP05jEmDI0GDr5yXXaz9RQ4vG8/zio/JQSQ+/5P7bwkD8IJjsswZP/7emSG r4VtW5DBjjmSYLx8gY9cAkgVlI/TN/bJJNxZzeydR0tM7Q0sJIlZvG5IcVD30HdqeCXI GG4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=0BoP+OYH6EXdZxnw4jTi+ce0h1kJJ+YvrP995HEeEfk=; b=tE27Q1TNSiH0hZxPuq/uNv85Qs7DKi1t0P5qTzBg+K5GC30iSzrda05wlq+yGXSTPh xWiko1xChjtPJCI6AzCPAgruQLpK0lXbyLHH+TWOH4BIU/MFtwdduqz7FJomzdbsEv8H gQ7V4OxlkZNmJYOy6vPi5idHgeyc9MIAnjhnxBmCkagbzWhrhfmikYKbZHubLgcVW2n6 Fm9BMbpsRXEcJLcLQcG9g3GBQFXQjjjXJ4A9DlfyIKfSQcLTvQ38haX5Tt4793JMi+rO h3UUVh7wBIKU4mDi0igiq4UAyztEwK6J2qg19XPvj/wzyqYluyBeWMAXQTHN0hr9H+FJ /7ag== X-Gm-Message-State: AOAM532f/f7VKdSfDDpmpgoNENoz/F5cWBf8mfBi4reGWoWhpLCbg4YC NQRf4dFuRCub90xR0dhGazY= X-Google-Smtp-Source: ABdhPJzy2Ur7IdM2ZfVTsqMbS5tBjuUgvkwINi0xes7/ASkks7ScG4l9nU4ZAYkMr3Wud5aCblU1YA== X-Received: by 2002:aa7:8b0f:0:b029:1c0:e782:ba29 with SMTP id f15-20020aa78b0f0000b02901c0e782ba29mr4498133pfd.37.1611654610729; Tue, 26 Jan 2021 01:50:10 -0800 (PST) Received: from localhost (192.156.221.203.dial.dynamic.acc50-nort-cbr.comindico.com.au. [203.221.156.192]) by smtp.gmail.com with ESMTPSA id c11sm17063325pfl.185.2021.01.26.01.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 01:50:10 -0800 (PST) Date: Tue, 26 Jan 2021 19:50:05 +1000 From: Nicholas Piggin Subject: RE: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings To: Andrew Morton , 'Christophe Leroy' , David Laight , "linux-mm@kvack.org" Cc: Ding Tianhong , Christoph Hellwig , Jonathan Cameron , "linux-arch@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , =?iso-8859-1?q?Zefan=0A?= Li , Rick Edgecombe References: <20210124082230.2118861-1-npiggin@gmail.com> <20210124082230.2118861-12-npiggin@gmail.com> <933352bd-dcf3-c483-4d7a-07afe1116cf1@csgroup.eu> <7749b310046c4b9baa07037af1d97d87@AcuMS.aculab.com> In-Reply-To: <7749b310046c4b9baa07037af1d97d87@AcuMS.aculab.com> MIME-Version: 1.0 Message-Id: <1611654541.je6x6v0xw5.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Excerpts from David Laight's message of January 25, 2021 10:24 pm: > From: Christophe Leroy >> Sent: 25 January 2021 09:15 >>=20 >> Le 24/01/2021 =C3=A0 09:22, Nicholas Piggin a =C3=A9crit=C2=A0: >> > Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALL= OC >> > enables support on architectures that define HAVE_ARCH_HUGE_VMAP and >> > supports PMD sized vmap mappings. >> > >> > vmalloc will attempt to allocate PMD-sized pages if allocating PMD siz= e >> > or larger, and fall back to small pages if that was unsuccessful. >> > >> > Architectures must ensure that any arch specific vmalloc allocations >> > that require PAGE_SIZE mappings (e.g., module allocations vs strict >> > module rwx) use the VM_NOHUGE flag to inhibit larger mappings. >> > >> > When hugepage vmalloc mappings are enabled in the next patch, this >> > reduces TLB misses by nearly 30x on a `git diff` workload on a 2-node >> > POWER9 (59,800 -> 2,100) and reduces CPU cycles by 0.54%. >> > >> > This can result in more internal fragmentation and memory overhead for= a >> > given allocation, an option nohugevmalloc is added to disable at boot. >> > >> > Signed-off-by: Nicholas Piggin >> > --- >> > arch/Kconfig | 10 +++ >> > include/linux/vmalloc.h | 18 ++++ >> > mm/page_alloc.c | 5 +- >> > mm/vmalloc.c | 192 ++++++++++++++++++++++++++++++--------= -- >> > 4 files changed, 177 insertions(+), 48 deletions(-) >> > >>=20 >> > diff --git a/mm/vmalloc.c b/mm/vmalloc.c >> > index 0377e1d059e5..eef61e0f5170 100644 >> > --- a/mm/vmalloc.c >> > +++ b/mm/vmalloc.c >>=20 >> > @@ -2691,15 +2746,18 @@ EXPORT_SYMBOL_GPL(vmap_pfn); >> > #endif /* CONFIG_VMAP_PFN */ >> > >> > static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_m= ask, >> > - pgprot_t prot, int node) >> > + pgprot_t prot, unsigned int page_shift, >> > + int node) >> > { >> > const gfp_t nested_gfp =3D (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZE= RO; >> > - unsigned int nr_pages =3D get_vm_area_size(area) >> PAGE_SHIFT; >> > - unsigned long array_size; >> > - unsigned int i; >> > + unsigned int page_order =3D page_shift - PAGE_SHIFT; >> > + unsigned long addr =3D (unsigned long)area->addr; >> > + unsigned long size =3D get_vm_area_size(area); >> > + unsigned int nr_small_pages =3D size >> PAGE_SHIFT; >> > struct page **pages; >> > + unsigned int i; >> > >> > - array_size =3D (unsigned long)nr_pages * sizeof(struct page *); >> > + array_size =3D (unsigned long)nr_small_pages * sizeof(struct page *)= ; >>=20 >> array_size() is a function in include/linux/overflow.h >>=20 >> For some reason, it breaks the build with your series. >=20 > I can't see the replacement definition for array_size. > The old local variable is deleted. Yeah I saw that after taking another look. Must have sent in a bad diff.=20 The v11 fixed that and a couple of other compile issues. Thanks, Nick