diff mbox series

[7/9] mm/z3fold: remove redundant list_del_init of zhdr->buddy in z3fold_free

Message ID 20220219092533.12596-8-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series A few cleanup patches for z3fold | expand

Commit Message

Miaohe Lin Feb. 19, 2022, 9:25 a.m. UTC
The do_compact_page will do list_del_init(&zhdr->buddy) for us. Remove this
extra one to save some possible cpu cycles.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/z3fold.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Vitaly Wool March 2, 2022, 8:38 a.m. UTC | #1
On Sat, Feb 19, 2022 at 10:26 AM Miaohe Lin <linmiaohe@huawei.com> wrote:
>
> The do_compact_page will do list_del_init(&zhdr->buddy) for us. Remove this
> extra one to save some possible cpu cycles.
>
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>

Reviewed-by: Vitaly Wool <vitaly.wool@konsulko.com>

> ---
>  mm/z3fold.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/mm/z3fold.c b/mm/z3fold.c
> index 18a697f6fe32..867c590df027 100644
> --- a/mm/z3fold.c
> +++ b/mm/z3fold.c
> @@ -1244,9 +1244,6 @@ static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)
>                 return;
>         }
>         if (zhdr->cpu < 0 || !cpu_online(zhdr->cpu)) {
> -               spin_lock(&pool->lock);
> -               list_del_init(&zhdr->buddy);
> -               spin_unlock(&pool->lock);
>                 zhdr->cpu = -1;
>                 kref_get(&zhdr->refcount);
>                 clear_bit(PAGE_CLAIMED, &page->private);
> --
> 2.23.0
>
diff mbox series

Patch

diff --git a/mm/z3fold.c b/mm/z3fold.c
index 18a697f6fe32..867c590df027 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1244,9 +1244,6 @@  static void z3fold_free(struct z3fold_pool *pool, unsigned long handle)
 		return;
 	}
 	if (zhdr->cpu < 0 || !cpu_online(zhdr->cpu)) {
-		spin_lock(&pool->lock);
-		list_del_init(&zhdr->buddy);
-		spin_unlock(&pool->lock);
 		zhdr->cpu = -1;
 		kref_get(&zhdr->refcount);
 		clear_bit(PAGE_CLAIMED, &page->private);