[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <874j5j9let.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Fri, 11 Oct 2024 14:57:30 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Zi Yan <ziy@...dia.com>
Cc: <linux-mm@...ck.org>, Alexander Potapenko <glider@...gle.com>, Kees
Cook <keescook@...omium.org>, David Hildenbrand <david@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>, "Matthew Wilcox (Oracle)"
<willy@...radead.org>, Miaohe Lin <linmiaohe@...wei.com>, Kefeng Wang
<wangkefeng.wang@...wei.com>, John Hubbard <jhubbard@...dia.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] mm: avoid clearing user movable page twice with
init_on_alloc=1
Zi Yan <ziy@...dia.com> writes:
[snip]
> diff --git a/include/linux/highmem.h b/include/linux/highmem.h
> index 930a591b9b61..4b15224842e1 100644
> --- a/include/linux/highmem.h
> +++ b/include/linux/highmem.h
> @@ -220,18 +220,8 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
> * Return: A folio containing one allocated and zeroed page or NULL if
> * we are out of memory.
> */
> -static inline
> -struct folio *vma_alloc_zeroed_movable_folio(struct vm_area_struct *vma,
> - unsigned long vaddr)
> -{
> - struct folio *folio;
> -
> - folio = vma_alloc_folio(GFP_HIGHUSER_MOVABLE, 0, vma, vaddr, false);
> - if (folio)
> - clear_user_highpage(&folio->page, vaddr);
> -
> - return folio;
> -}
> +#define vma_alloc_zeroed_movable_folio(vma, vaddr) \
> + vma_alloc_folio(GFP_HIGHUSER_MOVABLE | __GFP_ZERO, 0, vma, vaddr, false)
Although just one line, I still prefer to use inline function instead of
macro here. Not strong opinion.
> #endif
[snip]
--
Best Regards,
Huang, Ying
Powered by blists - more mailing lists