linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dev Jain <dev.jain@arm.com>
To: Liu Ye <liuye@kylinos.cn>,
	brauner@kernel.org, dhowells@redhat.com,
	akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly
Date: Wed, 12 Feb 2025 10:55:17 +0530	[thread overview]
Message-ID: <df25775e-9c78-44f3-b058-1c8e8de32288@arm.com> (raw)
In-Reply-To: <20250212025843.80283-2-liuye@kylinos.cn>



On 12/02/25 8:28 am, Liu Ye wrote:
> __folio_order is the same as folio_order, remove __folio_order and then
> just include mm.h and use folio_order directly.
> 
> Signed-off-by: Liu Ye <liuye@kylinos.cn>
> ---
>   include/linux/folio_queue.h | 12 +++---------
>   1 file changed, 3 insertions(+), 9 deletions(-)
> 
> diff --git a/include/linux/folio_queue.h b/include/linux/folio_queue.h
> index 4d3f8074c137..45ad2408a80c 100644
> --- a/include/linux/folio_queue.h
> +++ b/include/linux/folio_queue.h
> @@ -15,6 +15,7 @@
>   #define _LINUX_FOLIO_QUEUE_H
>   
>   #include <linux/pagevec.h>
> +#include <linux/mm.h>
>   
>   /*
>    * Segment in a queue of running buffers.  Each segment can hold a number of
> @@ -216,13 +217,6 @@ static inline void folioq_unmark3(struct folio_queue *folioq, unsigned int slot)
>   	clear_bit(slot, &folioq->marks3);
>   }
>   
> -static inline unsigned int __folio_order(struct folio *folio)
> -{
> -	if (!folio_test_large(folio))
> -		return 0;
> -	return folio->_flags_1 & 0xff;
> -}
> -
>   /**
>    * folioq_append: Add a folio to a folio queue segment
>    * @folioq: The segment to add to
> @@ -241,7 +235,7 @@ static inline unsigned int folioq_append(struct folio_queue *folioq, struct foli
>   	unsigned int slot = folioq->vec.nr++;
>   
>   	folioq->vec.folios[slot] = folio;
> -	folioq->orders[slot] = __folio_order(folio);
> +	folioq->orders[slot] = folio_order(folio);
>   	return slot;
>   }
>   
> @@ -263,7 +257,7 @@ static inline unsigned int folioq_append_mark(struct folio_queue *folioq, struct
>   	unsigned int slot = folioq->vec.nr++;
>   
>   	folioq->vec.folios[slot] = folio;
> -	folioq->orders[slot] = __folio_order(folio);
> +	folioq->orders[slot] = folio_order(folio);
>   	folioq_mark(folioq, slot);
>   	return slot;
>   }

This looks like a reasonable change to make, since it avoids code 
duplication. Please consider:

Reviewed-by: Dev Jain <dev.jain@arm.com>



  parent reply	other threads:[~2025-02-12  5:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12  2:58 [PATCH 0/2] mm: Optimize folio_order Liu Ye
2025-02-12  2:58 ` [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly Liu Ye
2025-02-12  5:19   ` Shivank Garg
2025-02-12  5:25   ` Dev Jain [this message]
2025-02-12  2:58 ` [PATCH 2/2] mm/mm.h: Write folio->_flags_1 & 0xff as a macro definition Liu Ye
2025-02-12  5:12   ` Dev Jain
2025-02-12  5:40   ` Shivank Garg
2025-02-12  7:11     ` liuye
     [not found]   ` <1739340112672653.3.seg@mailgw.kylinos.cn>
2025-02-12  7:07     ` liuye
2025-02-12  9:06       ` Dev Jain
2025-02-12 12:36   ` Matthew Wilcox
2025-02-12 16:22   ` David Hildenbrand
2025-02-12 11:28 ` [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly David Howells
2025-02-19  3:39 刘烨

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=df25775e-9c78-44f3-b058-1c8e8de32288@arm.com \
    --to=dev.jain@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=liuye@kylinos.cn \
    /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