[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZVJ5akp29W2gxDR8@fedora>
Date: Mon, 13 Nov 2023 11:30:50 -0800
From: Vishal Moola <vishal.moola@...il.com>
To: Kefeng Wang <wangkefeng.wang@...wei.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Matthew Wilcox <willy@...radead.org>,
David Hildenbrand <david@...hat.com>,
Sidhartha Kumar <sidhartha.kumar@...cle.com>
Subject: Re: [PATCH v2 2/6] mm: memory: use a folio in
validate_page_before_insert()
On Mon, Nov 13, 2023 at 11:22:18PM +0800, Kefeng Wang wrote:
> Use a folio in validate_page_before_insert() to save two
> compound_head() calls.
>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@...il.com>
> Reviewed-by: Sidhartha Kumar <sidhartha.kumar@...cle.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> ---
> mm/memory.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory.c b/mm/memory.c
> index c32954e16b28..379354b35891 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -1841,9 +1841,12 @@ pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
>
> static int validate_page_before_insert(struct page *page)
> {
> - if (PageAnon(page) || PageSlab(page) || page_has_type(page))
> + struct folio *folio = page_folio(page);
> +
> + if (folio_test_anon(folio) || folio_test_slab(folio) ||
> + page_has_type(page))
> return -EINVAL;
> - flush_dcache_page(page);
> + flush_dcache_folio(folio);
> return 0;
> }
>
> --
> 2.27.0
Powered by blists - more mailing lists