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]
Message-Id: <1611654541.je6x6v0xw5.astroid@bobo.none>
Date:   Tue, 26 Jan 2021 19:50:05 +1000
From:   Nicholas Piggin <npiggin@...il.com>
To:     Andrew Morton <akpm@...ux-foundation.org>,
        'Christophe Leroy' <christophe.leroy@...roup.eu>,
        David Laight <David.Laight@...LAB.COM>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>
Cc:     Ding Tianhong <dingtianhong@...wei.com>,
        Christoph Hellwig <hch@...radead.org>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        "linux-arch@...r.kernel.org" <linux-arch@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        Zefan
 Li <lizefan@...wei.com>,
        Rick Edgecombe <rick.p.edgecombe@...el.com>
Subject: RE: [PATCH v10 11/12] mm/vmalloc: Hugepage vmalloc mappings

Excerpts from David Laight's message of January 25, 2021 10:24 pm:
> 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.

Yeah I saw that after taking another look. Must have sent in a bad diff. 
The v11 fixed that and a couple of other compile issues.

Thanks,
Nick

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ