From: "Huang, Ying" <ying.huang@intel.com>
To: Zi Yan <ziy@nvidia.com>
Cc: <linux-mm@kvack.org>, Alexander Potapenko <glider@google.com>,
Kees Cook <keescook@chromium.org>,
David Hildenbrand <david@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
Miaohe Lin <linmiaohe@huawei.com>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
John Hubbard <jhubbard@nvidia.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] mm: avoid clearing user movable page twice with init_on_alloc=1
Date: Fri, 11 Oct 2024 14:57:30 +0800 [thread overview]
Message-ID: <874j5j9let.fsf@yhuang6-desk2.ccr.corp.intel.com> (raw)
In-Reply-To: <20241007182315.401167-1-ziy@nvidia.com> (Zi Yan's message of "Mon, 7 Oct 2024 14:23:15 -0400")
Zi Yan <ziy@nvidia.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
prev parent reply other threads:[~2024-10-11 7:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 18:23 Zi Yan
2024-10-08 8:26 ` David Hildenbrand
2024-10-08 11:52 ` Zi Yan
2024-10-08 12:57 ` Vlastimil Babka
2024-10-08 13:06 ` David Hildenbrand
2024-10-08 13:46 ` Zi Yan
2024-10-11 6:55 ` Huang, Ying
2024-10-11 6:57 ` Huang, Ying [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874j5j9let.fsf@yhuang6-desk2.ccr.corp.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=glider@google.com \
--cc=jhubbard@nvidia.com \
--cc=keescook@chromium.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=wangkefeng.wang@huawei.com \
--cc=willy@infradead.org \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox