Message ID | 20240729112534.3416707-19-alexs@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm/zsmalloc: add zpdesc memory descriptor for zswap.zpool | expand |
On (24/07/29 19:25), alexs@kernel.org wrote: [..] > +static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc) > +{ > + __ClearPageMovable(zpdesc_page(zpdesc)); > +} [..] > @@ -846,7 +846,7 @@ static void reset_zpdesc(struct zpdesc *zpdesc) > { > struct page *page = zpdesc_page(zpdesc); > > - __ClearPageMovable(page); > + __zpdesc_clear_movable(zpdesc); > ClearPagePrivate(page); Just a quick question, I see that you wrote wrappers for pretty much everything, including SetPagePrivate(), but not for ClearPagePrivate()?
On 7/30/24 5:34 PM, Sergey Senozhatsky wrote: > On (24/07/29 19:25), alexs@kernel.org wrote: > [..] >> +static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc) >> +{ >> + __ClearPageMovable(zpdesc_page(zpdesc)); >> +} > > [..] > >> @@ -846,7 +846,7 @@ static void reset_zpdesc(struct zpdesc *zpdesc) >> { >> struct page *page = zpdesc_page(zpdesc); >> >> - __ClearPageMovable(page); >> + __zpdesc_clear_movable(zpdesc); >> ClearPagePrivate(page); > > Just a quick question, I see that you wrote wrappers for pretty > much everything, including SetPagePrivate(), but not for > ClearPagePrivate()? Hi Sergey, Thanks for comment! Yes, it's better to have one for clear, I'll sent a patch soon. Alex
diff --git a/mm/zpdesc.h b/mm/zpdesc.h index f64e813f4847..5db4fbe2d139 100644 --- a/mm/zpdesc.h +++ b/mm/zpdesc.h @@ -114,6 +114,11 @@ static inline void __zpdesc_set_movable(struct zpdesc *zpdesc, __SetPageMovable(zpdesc_page(zpdesc), mops); } +static inline void __zpdesc_clear_movable(struct zpdesc *zpdesc) +{ + __ClearPageMovable(zpdesc_page(zpdesc)); +} + static inline bool zpdesc_is_isolated(struct zpdesc *zpdesc) { return PageIsolated(zpdesc_page(zpdesc)); diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index bb8b5f13a966..e1d3ad50538c 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -846,7 +846,7 @@ static void reset_zpdesc(struct zpdesc *zpdesc) { struct page *page = zpdesc_page(zpdesc); - __ClearPageMovable(page); + __zpdesc_clear_movable(zpdesc); ClearPagePrivate(page); zpdesc->zspage = NULL; zpdesc->next = NULL;