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: <8b26ceaa-79b4-4c3e-c37a-e191b3403358@huawei.com>
Date:   Mon, 16 Jan 2023 19:11:27 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     <akpm@...ux-foundation.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next 2/7] mm: memory: convert do_anonymous_page() to use
 a folio



On 2023/1/13 23:33, Matthew Wilcox wrote:
> On Thu, Jan 12, 2023 at 04:30:01PM +0800, Kefeng Wang wrote:
>> Convert do_anonymous_page() to use a folio and replace related functions
>> to folio functions.
> 
> I think this patch has a prerequisite of sorting out
> alloc_zeroed_user_highpage_movable().  That way we can get rid of
> the 'page' variable inside this function altogether.

How about provide a wrapper like 
folio_alloc_zeroed_user_highmem_movable(), but the is a little bit long.

static inline struct folio *
folio_alloc_zeroed_user_highmem_movable(struct vm_area_struct *vma,
                                        unsigned long vaddr)
{
        struct folio *folio = NULL;
        struct page *page;

        page = alloc_zeroed_user_highpage_movable(vma, vaddr);
        if (page)
                folio = page_folio(page);

        return folio;
}


> 
>>   	inc_mm_counter(vma->vm_mm, MM_ANONPAGES);
>>   	page_add_new_anon_rmap(page, vma, vmf->address);
> 
> folio_add_new_anon-rmap().

ok, will update.

> 
>> -	lru_cache_add_inactive_or_unevictable(page, vma);
>> +	folio_add_lru_vma(folio, vma);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ