* [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put()
@ 2024-01-25 8:14 Yosry Ahmed
2024-01-25 8:17 ` Chengming Zhou
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yosry Ahmed @ 2024-01-25 8:14 UTC (permalink / raw)
To: Andrew Morton
Cc: Johannes Weiner, Nhat Pham, Chengming Zhou, linux-mm,
linux-kernel, Yosry Ahmed
Commit 7310895779624 ("mm: zswap: tighten up entry invalidation")
removed the usage of tree argument, delete it.
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
---
mm/zswap.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/mm/zswap.c b/mm/zswap.c
index 78df16d307aa8..8f4a7efc2bdae 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -569,8 +569,7 @@ static void zswap_entry_get(struct zswap_entry *entry)
/* caller must hold the tree lock
* remove from the tree and free it, if nobody reference the entry
*/
-static void zswap_entry_put(struct zswap_tree *tree,
- struct zswap_entry *entry)
+static void zswap_entry_put(struct zswap_entry *entry)
{
int refcount = --entry->refcount;
@@ -853,7 +852,7 @@ static void zswap_invalidate_entry(struct zswap_tree *tree,
struct zswap_entry *entry)
{
if (zswap_rb_erase(&tree->rbroot, entry))
- zswap_entry_put(tree, entry);
+ zswap_entry_put(entry);
}
static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_one *l,
@@ -924,7 +923,7 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o
put_unlock:
/* Drop local reference */
- zswap_entry_put(tree, entry);
+ zswap_entry_put(entry);
unlock:
spin_unlock(&tree->lock);
spin_lock(lock);
@@ -1754,7 +1753,7 @@ bool zswap_load(struct folio *folio)
zswap_lru_del(&entry->pool->list_lru, entry);
zswap_lru_add(&entry->pool->list_lru, entry);
}
- zswap_entry_put(tree, entry);
+ zswap_entry_put(entry);
spin_unlock(&tree->lock);
return true;
--
2.43.0.429.g432eaa2c6b-goog
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put()
2024-01-25 8:14 [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put() Yosry Ahmed
@ 2024-01-25 8:17 ` Chengming Zhou
2024-01-25 14:45 ` Johannes Weiner
2024-01-25 18:30 ` Nhat Pham
2 siblings, 0 replies; 4+ messages in thread
From: Chengming Zhou @ 2024-01-25 8:17 UTC (permalink / raw)
To: Yosry Ahmed, Andrew Morton
Cc: Johannes Weiner, Nhat Pham, linux-mm, linux-kernel
On 2024/1/25 16:14, Yosry Ahmed wrote:
> Commit 7310895779624 ("mm: zswap: tighten up entry invalidation")
> removed the usage of tree argument, delete it.
>
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
LGTM, thanks!
Reviewed-by: Chengming Zhou <zhouchengming@bytedance.com>
> ---
> mm/zswap.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 78df16d307aa8..8f4a7efc2bdae 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -569,8 +569,7 @@ static void zswap_entry_get(struct zswap_entry *entry)
> /* caller must hold the tree lock
> * remove from the tree and free it, if nobody reference the entry
> */
> -static void zswap_entry_put(struct zswap_tree *tree,
> - struct zswap_entry *entry)
> +static void zswap_entry_put(struct zswap_entry *entry)
> {
> int refcount = --entry->refcount;
>
> @@ -853,7 +852,7 @@ static void zswap_invalidate_entry(struct zswap_tree *tree,
> struct zswap_entry *entry)
> {
> if (zswap_rb_erase(&tree->rbroot, entry))
> - zswap_entry_put(tree, entry);
> + zswap_entry_put(entry);
> }
>
> static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_one *l,
> @@ -924,7 +923,7 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o
>
> put_unlock:
> /* Drop local reference */
> - zswap_entry_put(tree, entry);
> + zswap_entry_put(entry);
> unlock:
> spin_unlock(&tree->lock);
> spin_lock(lock);
> @@ -1754,7 +1753,7 @@ bool zswap_load(struct folio *folio)
> zswap_lru_del(&entry->pool->list_lru, entry);
> zswap_lru_add(&entry->pool->list_lru, entry);
> }
> - zswap_entry_put(tree, entry);
> + zswap_entry_put(entry);
> spin_unlock(&tree->lock);
>
> return true;
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put()
2024-01-25 8:14 [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put() Yosry Ahmed
2024-01-25 8:17 ` Chengming Zhou
@ 2024-01-25 14:45 ` Johannes Weiner
2024-01-25 18:30 ` Nhat Pham
2 siblings, 0 replies; 4+ messages in thread
From: Johannes Weiner @ 2024-01-25 14:45 UTC (permalink / raw)
To: Yosry Ahmed
Cc: Andrew Morton, Nhat Pham, Chengming Zhou, linux-mm, linux-kernel
On Thu, Jan 25, 2024 at 08:14:23AM +0000, Yosry Ahmed wrote:
> Commit 7310895779624 ("mm: zswap: tighten up entry invalidation")
> removed the usage of tree argument, delete it.
>
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Beat me to it :)
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put()
2024-01-25 8:14 [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put() Yosry Ahmed
2024-01-25 8:17 ` Chengming Zhou
2024-01-25 14:45 ` Johannes Weiner
@ 2024-01-25 18:30 ` Nhat Pham
2 siblings, 0 replies; 4+ messages in thread
From: Nhat Pham @ 2024-01-25 18:30 UTC (permalink / raw)
To: Yosry Ahmed
Cc: Andrew Morton, Johannes Weiner, Chengming Zhou, linux-mm, linux-kernel
On Thu, Jan 25, 2024 at 12:14 AM Yosry Ahmed <yosryahmed@google.com> wrote:
>
> Commit 7310895779624 ("mm: zswap: tighten up entry invalidation")
> removed the usage of tree argument, delete it.
>
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
> ---
> mm/zswap.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 78df16d307aa8..8f4a7efc2bdae 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -569,8 +569,7 @@ static void zswap_entry_get(struct zswap_entry *entry)
> /* caller must hold the tree lock
> * remove from the tree and free it, if nobody reference the entry
> */
> -static void zswap_entry_put(struct zswap_tree *tree,
> - struct zswap_entry *entry)
> +static void zswap_entry_put(struct zswap_entry *entry)
> {
> int refcount = --entry->refcount;
>
> @@ -853,7 +852,7 @@ static void zswap_invalidate_entry(struct zswap_tree *tree,
> struct zswap_entry *entry)
> {
> if (zswap_rb_erase(&tree->rbroot, entry))
> - zswap_entry_put(tree, entry);
> + zswap_entry_put(entry);
> }
>
> static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_one *l,
> @@ -924,7 +923,7 @@ static enum lru_status shrink_memcg_cb(struct list_head *item, struct list_lru_o
>
> put_unlock:
> /* Drop local reference */
> - zswap_entry_put(tree, entry);
> + zswap_entry_put(entry);
> unlock:
> spin_unlock(&tree->lock);
> spin_lock(lock);
> @@ -1754,7 +1753,7 @@ bool zswap_load(struct folio *folio)
> zswap_lru_del(&entry->pool->list_lru, entry);
> zswap_lru_add(&entry->pool->list_lru, entry);
> }
> - zswap_entry_put(tree, entry);
> + zswap_entry_put(entry);
> spin_unlock(&tree->lock);
>
> return true;
> --
> 2.43.0.429.g432eaa2c6b-goog
>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-25 18:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 8:14 [PATCH] mm: zswap: remove unused tree argument in zswap_entry_put() Yosry Ahmed
2024-01-25 8:17 ` Chengming Zhou
2024-01-25 14:45 ` Johannes Weiner
2024-01-25 18:30 ` Nhat Pham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox