lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 25 Jan 2021 12:24:01 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Christophe Leroy' <christophe.leroy@...roup.eu>,
        Nicholas Piggin <npiggin@...il.com>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>
CC:     "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        Ding Tianhong <dingtianhong@...wei.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Christoph Hellwig <hch@...radead.org>,
        "Zefan Li" <lizefan@...wei.com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Rick Edgecombe <rick.p.edgecombe@...el.com>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>
Subject: RE: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings

From: Christophe Leroy
> Sent: 25 January 2021 09:15
> 
> Le 24/01/2021 à 09:22, Nicholas Piggin a écrit :
> > Support huge page vmalloc mappings. Config option HAVE_ARCH_HUGE_VMALLOC
> > 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 size
> > 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 <npiggin@...il.com>
> > ---
> >   arch/Kconfig            |  10 +++
> >   include/linux/vmalloc.h |  18 ++++
> >   mm/page_alloc.c         |   5 +-
> >   mm/vmalloc.c            | 192 ++++++++++++++++++++++++++++++----------
> >   4 files changed, 177 insertions(+), 48 deletions(-)
> >
> 
> > diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> > index 0377e1d059e5..eef61e0f5170 100644
> > --- a/mm/vmalloc.c
> > +++ b/mm/vmalloc.c
> 
> > @@ -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_mask,
> > -				 pgprot_t prot, int node)
> > +				 pgprot_t prot, unsigned int page_shift,
> > +				 int node)
> >   {
> >   	const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO;
> > -	unsigned int nr_pages = get_vm_area_size(area) >> PAGE_SHIFT;
> > -	unsigned long array_size;
> > -	unsigned int i;
> > +	unsigned int page_order = page_shift - PAGE_SHIFT;
> > +	unsigned long addr = (unsigned long)area->addr;
> > +	unsigned long size = get_vm_area_size(area);
> > +	unsigned int nr_small_pages = size >> PAGE_SHIFT;
> >   	struct page **pages;
> > +	unsigned int i;
> >
> > -	array_size = (unsigned long)nr_pages * sizeof(struct page *);
> > +	array_size = (unsigned long)nr_small_pages * sizeof(struct page *);
> 
> array_size() is a function in include/linux/overflow.h
> 
> For some reason, it breaks the build with your series.

I can't see the replacement definition for array_size.
The old local variable is deleted.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ