* Re: [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly
@ 2025-02-19 3:39 刘烨
0 siblings, 0 replies; 5+ messages in thread
From: 刘烨 @ 2025-02-19 3:39 UTC (permalink / raw)
To: brauner, dhowells, akpm
Cc: linux-kernel, linux-mm, Shivank Garg, Dev Jain, dhowells
[-- Attachment #1: Type: text/html, Size: 2239 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly
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 11:28 ` David Howells
1 sibling, 0 replies; 5+ messages in thread
From: David Howells @ 2025-02-12 11:28 UTC (permalink / raw)
To: Liu Ye; +Cc: dhowells, brauner, akpm, linux-kernel, linux-mm
Liu Ye <liuye@kylinos.cn> 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>
Acked-by: David Howells <dhowells@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly
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
1 sibling, 0 replies; 5+ messages in thread
From: Dev Jain @ 2025-02-12 5:25 UTC (permalink / raw)
To: Liu Ye, brauner, dhowells, akpm; +Cc: linux-kernel, linux-mm
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly
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
1 sibling, 0 replies; 5+ messages in thread
From: Shivank Garg @ 2025-02-12 5:19 UTC (permalink / raw)
To: Liu Ye, brauner, dhowells, akpm; +Cc: linux-kernel, linux-mm
On 2/12/2025 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;
> }
Reviewed-by: Shivank Garg <shivankg@amd.com>
Thanks,
Shivank
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly
2025-02-12 2:58 [PATCH 0/2] mm: Optimize folio_order Liu Ye
@ 2025-02-12 2:58 ` Liu Ye
2025-02-12 5:19 ` Shivank Garg
2025-02-12 5:25 ` Dev Jain
2025-02-12 11:28 ` David Howells
1 sibling, 2 replies; 5+ messages in thread
From: Liu Ye @ 2025-02-12 2:58 UTC (permalink / raw)
To: brauner, dhowells, akpm; +Cc: linux-kernel, linux-mm, Liu Ye
__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;
}
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-02-19 3:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-19 3:39 [PATCH 1/2] mm/folio_queue: Delete __folio_order and use folio_order directly 刘烨
-- strict thread matches above, loose matches on Subject: below --
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
2025-02-12 11:28 ` David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox