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] [day] [month] [year] [list]
Message-ID: <YQBCtHv1qD4Pinw/@casper.infradead.org>
Date:   Tue, 27 Jul 2021 18:30:28 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Chen Wandun <chenwandun@...wei.com>
Cc:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, wangkefeng.wang@...wei.com,
        weiyongjun1@...wei.com
Subject: Re: [PATCH] mm/vmalloc: add missing __GFP_HIGHMEM flag for vmalloc

On Mon, Jul 26, 2021 at 12:05:44PM +0800, Chen Wandun wrote:
> 在 2021/7/26 11:25, Matthew Wilcox 写道:
> > On Mon, Jul 26, 2021 at 11:23:33AM +0800, Chen Wandun wrote:
> > > struct page array can also be allocated in highmem during vmalloc,
> > > that will ease the low memory stress in 32bit system.
> > Huh?  Where does it get kmapped in order to access it?

(i misread your patch, apologies)

> The struct page array contain numbers of pointer of struct page, it is used to save
> 
> pages that allocated for vmalloc mapping in vmap_pages_range, it does't need to kmap.
> 
> 
> The main idea of this patch is come from:
> 
> https://lore.kernel.org/lkml/20170307141020.29107-1-mhocko@kernel.org/

you've misunderstood that patch.  think about it:

static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
                                 pgprot_t prot, unsigned int page_shift,
                                 int node)
{
	const gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO;
(now nested_gfp has neither DMA nor DMA32 set)

        gfp_mask |= __GFP_NOWARN;
        if (!(gfp_mask & (GFP_DMA | GFP_DMA32)))
                gfp_mask |= __GFP_HIGHMEM;
(we set HIGHMEM if DMA and DMA32 are both not set)

                area->pages = __vmalloc_node(array_size, 1, nested_gfp, node,
                                        area->caller);
(we don't need to set HIGHMEM here because it will be set for us in
the second call to __vmalloc_area_node)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ