diff mbox series

[v2,10/11] mm/memory-failure: Use folio functions throughout collect_procs()

Message ID 20240408194232.118537-11-willy@infradead.org (mailing list archive)
State New
Headers show
Series Some cleanups for memory-failure | expand

Commit Message

Matthew Wilcox April 8, 2024, 7:42 p.m. UTC
Saves a couple of calls to compound_head().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/memory-failure.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jane Chu April 9, 2024, 6:19 a.m. UTC | #1
On 4/8/2024 12:42 PM, Matthew Wilcox (Oracle) wrote:

> Saves a couple of calls to compound_head().
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>   mm/memory-failure.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 7caec2fc3327..1c3cf1fe4964 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -712,9 +712,9 @@ static void collect_procs(struct folio *folio, struct page *page,
>   {
>   	if (!folio->mapping)
>   		return;
> -	if (unlikely(PageKsm(page)))
> +	if (unlikely(folio_test_ksm(folio)))
>   		collect_procs_ksm(page, tokill, force_early);
> -	else if (PageAnon(page))
> +	else if (folio_test_anon(folio))
>   		collect_procs_anon(folio, page, tokill, force_early);
>   	else
>   		collect_procs_file(folio, page, tokill, force_early);

Looks good.

Reviewed-by: Jane Chu <jane.chu@oracle.com>

-jane
diff mbox series

Patch

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 7caec2fc3327..1c3cf1fe4964 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -712,9 +712,9 @@  static void collect_procs(struct folio *folio, struct page *page,
 {
 	if (!folio->mapping)
 		return;
-	if (unlikely(PageKsm(page)))
+	if (unlikely(folio_test_ksm(folio)))
 		collect_procs_ksm(page, tokill, force_early);
-	else if (PageAnon(page))
+	else if (folio_test_anon(folio))
 		collect_procs_anon(folio, page, tokill, force_early);
 	else
 		collect_procs_file(folio, page, tokill, force_early);