lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJD7tkatLxSd_qv_g1AS-5dEZrX1RYHrqjUuzee8iOvo+eRxAQ@mail.gmail.com>
Date:   Thu, 27 Jul 2023 11:09:03 -0700
From:   Yosry Ahmed <yosryahmed@...gle.com>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Nhat Pham <nphamcs@...il.com>,
        Domenico Cerasuolo <cerasuolodomenico@...il.com>,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] mm: zswap: use zswap_invalidate_entry() for duplicates

On Thu, Jul 27, 2023 at 9:23 AM Johannes Weiner <hannes@...xchg.org> wrote:
>
> Minor cleanup. Instead of open-coding the tree deletion and the put,
> use the zswap_invalidate_entry() convenience helper.
>
> Suggested-by: Yosry Ahmed <yosryahmed@...gle.com>
> Signed-off-by: Johannes Weiner <hannes@...xchg.org>

Reviewed-by: Yosry Ahmed <yosryahmed@...gle.com>

Thanks!

> ---
>  mm/zswap.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index 583ef7b84dc3..e123b1c7981c 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -1344,9 +1344,7 @@ bool zswap_store(struct page *page)
>         spin_lock(&tree->lock);
>         while (zswap_rb_insert(&tree->rbroot, entry, &dupentry) == -EEXIST) {
>                 zswap_duplicate_entry++;
> -               /* remove from rbtree */
> -               zswap_rb_erase(&tree->rbroot, dupentry);
> -               zswap_entry_put(tree, dupentry);
> +               zswap_invalidate_entry(tree, dupentry);
>         }
>         if (entry->length) {
>                 spin_lock(&entry->pool->lru_lock);
> --
> 2.41.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ