Message ID | 20240130014208.565554-2-hannes@cmpxchg.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm: zswap: cleanups | expand |
On 2024/1/30 09:36, Johannes Weiner wrote: > There is a zswap_entry_ namespace with multiple functions already. Another is zswap_invalidate_entry(), maybe zswap_entry_invalidate is better. > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> > --- > mm/zswap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/zswap.c b/mm/zswap.c > index 7f88b3a77e4a..173f2e6657de 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c > @@ -520,7 +520,7 @@ static struct zpool *zswap_find_zpool(struct zswap_entry *entry) > * Carries out the common pattern of freeing and entry's zpool allocation, > * freeing the entry itself, and decrementing the number of stored pages. > */ > -static void zswap_free_entry(struct zswap_entry *entry) > +static void zswap_entry_free(struct zswap_entry *entry) > { > if (!entry->length) > atomic_dec(&zswap_same_filled_pages); > @@ -555,7 +555,7 @@ static void zswap_entry_put(struct zswap_entry *entry) > WARN_ON_ONCE(refcount < 0); > if (refcount == 0) { > WARN_ON_ONCE(!RB_EMPTY_NODE(&entry->rbnode)); > - zswap_free_entry(entry); > + zswap_entry_free(entry); > } > } >
On 2024/1/30 11:19, Johannes Weiner wrote: > On Tue, Jan 30, 2024 at 11:13:16AM +0800, Chengming Zhou wrote: >> On 2024/1/30 09:36, Johannes Weiner wrote: >>> There is a zswap_entry_ namespace with multiple functions already. >> >> Another is zswap_invalidate_entry(), maybe zswap_entry_invalidate is better. > > You're right. > > I originally had a patch for that, but then dropped it because it is > sort of also a tree operation and it looked a bit weird to me. Right. > > But I could be persuaded to include it again, no strong preferences > either way. Never mind.
On 2024/1/30 09:36, Johannes Weiner wrote: > There is a zswap_entry_ namespace with multiple functions already. > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com> > --- > mm/zswap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/zswap.c b/mm/zswap.c > index 7f88b3a77e4a..173f2e6657de 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c > @@ -520,7 +520,7 @@ static struct zpool *zswap_find_zpool(struct zswap_entry *entry) > * Carries out the common pattern of freeing and entry's zpool allocation, > * freeing the entry itself, and decrementing the number of stored pages. > */ > -static void zswap_free_entry(struct zswap_entry *entry) > +static void zswap_entry_free(struct zswap_entry *entry) > { > if (!entry->length) > atomic_dec(&zswap_same_filled_pages); > @@ -555,7 +555,7 @@ static void zswap_entry_put(struct zswap_entry *entry) > WARN_ON_ONCE(refcount < 0); > if (refcount == 0) { > WARN_ON_ONCE(!RB_EMPTY_NODE(&entry->rbnode)); > - zswap_free_entry(entry); > + zswap_entry_free(entry); > } > } >
On Mon, Jan 29, 2024 at 08:36:37PM -0500, Johannes Weiner wrote: > There is a zswap_entry_ namespace with multiple functions already. > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Yosry Ahmed <yosryahmed@google.com> Thanks.
On Mon, Jan 29, 2024 at 5:42 PM Johannes Weiner <hannes@cmpxchg.org> wrote: > > There is a zswap_entry_ namespace with multiple functions already. > > Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Nhat Pham <nphamcs@gmail.com> > --- > mm/zswap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/zswap.c b/mm/zswap.c > index 7f88b3a77e4a..173f2e6657de 100644 > --- a/mm/zswap.c > +++ b/mm/zswap.c > @@ -520,7 +520,7 @@ static struct zpool *zswap_find_zpool(struct zswap_entry *entry) > * Carries out the common pattern of freeing and entry's zpool allocation, > * freeing the entry itself, and decrementing the number of stored pages. > */ > -static void zswap_free_entry(struct zswap_entry *entry) > +static void zswap_entry_free(struct zswap_entry *entry) > { > if (!entry->length) > atomic_dec(&zswap_same_filled_pages); > @@ -555,7 +555,7 @@ static void zswap_entry_put(struct zswap_entry *entry) > WARN_ON_ONCE(refcount < 0); > if (refcount == 0) { > WARN_ON_ONCE(!RB_EMPTY_NODE(&entry->rbnode)); > - zswap_free_entry(entry); > + zswap_entry_free(entry); > } > } > > -- > 2.43.0 >
diff --git a/mm/zswap.c b/mm/zswap.c index 7f88b3a77e4a..173f2e6657de 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -520,7 +520,7 @@ static struct zpool *zswap_find_zpool(struct zswap_entry *entry) * Carries out the common pattern of freeing and entry's zpool allocation, * freeing the entry itself, and decrementing the number of stored pages. */ -static void zswap_free_entry(struct zswap_entry *entry) +static void zswap_entry_free(struct zswap_entry *entry) { if (!entry->length) atomic_dec(&zswap_same_filled_pages); @@ -555,7 +555,7 @@ static void zswap_entry_put(struct zswap_entry *entry) WARN_ON_ONCE(refcount < 0); if (refcount == 0) { WARN_ON_ONCE(!RB_EMPTY_NODE(&entry->rbnode)); - zswap_free_entry(entry); + zswap_entry_free(entry); } }
There is a zswap_entry_ namespace with multiple functions already. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> --- mm/zswap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)