2024-03-07 13:29:28

by Hao Ge

[permalink] [raw]
Subject: [PATCH] mm/page-flags: make __PageMovable return bool

make __PageMovable return bool like __folio_test_movable

Signed-off-by: Hao Ge <[email protected]>
---
include/linux/page-flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 735cddc13d20..3f2cf3d3b86b 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -663,7 +663,7 @@ static __always_inline bool __folio_test_movable(const struct folio *folio)
PAGE_MAPPING_MOVABLE;
}

-static __always_inline int __PageMovable(struct page *page)
+static __always_inline bool __PageMovable(struct page *page)
{
return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) ==
PAGE_MAPPING_MOVABLE;
--
2.25.1



2024-03-21 03:23:14

by Hao Ge

[permalink] [raw]
Subject: [PATCH V2] mm/page-flags: make __PageMovable return bool

make __PageMovable return bool like __folio_test_movable

Signed-off-by: Hao Ge <[email protected]>

---
v2: Send this patch on the latest version
---
include/linux/page-flags.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 5ee2d0ab62c6..2647c7a35c5a 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -689,7 +689,7 @@ static __always_inline bool __folio_test_movable(const struct folio *folio)
PAGE_MAPPING_MOVABLE;
}

-static __always_inline int __PageMovable(const struct page *page)
+static __always_inline bool __PageMovable(const struct page *page)
{
return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) ==
PAGE_MAPPING_MOVABLE;
--
2.25.1


2024-04-04 19:34:53

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH V2] mm/page-flags: make __PageMovable return bool

On 21.03.24 04:22, Hao Ge wrote:
> make __PageMovable return bool like __folio_test_movable
>
> Signed-off-by: Hao Ge <[email protected]>
>
> ---
> v2: Send this patch on the latest version
> ---
> include/linux/page-flags.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index 5ee2d0ab62c6..2647c7a35c5a 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -689,7 +689,7 @@ static __always_inline bool __folio_test_movable(const struct folio *folio)
> PAGE_MAPPING_MOVABLE;
> }
>
> -static __always_inline int __PageMovable(const struct page *page)
> +static __always_inline bool __PageMovable(const struct page *page)
> {
> return ((unsigned long)page->mapping & PAGE_MAPPING_FLAGS) ==
> PAGE_MAPPING_MOVABLE;

Reviewed-by: David Hildenbrand <[email protected]>

--
Cheers,

David / dhildenb