Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp257675rwb; Thu, 27 Jul 2023 12:14:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEvxc69dlLNC2JUNcNLJEQxp0RKofyJe8kHSDHrmnFiDrxJm2vNQOLExVmg0KxcTilfIST9 X-Received: by 2002:a17:903:124c:b0:1b9:cb27:7f43 with SMTP id u12-20020a170903124c00b001b9cb277f43mr247243plh.43.1690485280818; Thu, 27 Jul 2023 12:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690485280; cv=none; d=google.com; s=arc-20160816; b=QY0lslP0nXvGu5tC/HhiDltUUNDgJGKj8v1Xc14vkde65FjfBZQaNntClLfDR+HIGi ocTUGLbO8Usr6P3M46yzxiKc/CTk+NdWofMNhaEHeCGKiSEocqIIbkFUywy3W76gLGcA CToRmFtLWLIKNTMSnYQDG1WaUzvI3WFXVEYr57AAiwiT32ZuQgCl2hQFzYuS0dfDcgo+ eXWDHG8VHg1qGVbJ/Vceo/J9VpmcTM8zS8izakR4TvOj0bFphgCw+mXYejqOkgDQOL25 ABjCIUqlEsdhHhiOTCqDpUU7EYNdi+J2p160iEV37WHCgrfKZRyEF7KQtGKkHyovPZmr AtUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vFXw2+/KjQw8lFjUIikFW0fpJeY+CVFCOxN28DSc2EU=; fh=47GdyZklcgcD8qJ16MXsdlFZ0YXB4FCJx/6ZOSqWHtk=; b=FkiDT+NZ78RPn+MhPaw8CJ2PvxizkkR6msNe3gZhP/dkIPNO67LAdikr+jbJmwvInC YXA+fQ+g/Yl0fGrHoET5ZRChoUygLDIk4GSmsb5parK3E2Ah1kVFE0vW4p0jHRxSjWeO QpBCrsrSuKhY6A03MaOTURck+Q6fWFEzVfuBvKHFM3VE1mfymhdfdnrtQdRTsuG1ydIK opzWLApgLXe5tXGGmwMGiW6eW1lRgG8Jykr3IsvOu/xaR92kjlURLgMT6cU/ltqZadWn kJAUQFyXJMX3f+y1YVnEZ2iZOacYrZ9qtRrrsHTJktb56DW9j8zn1B/TYNufJuBMbCrY RLEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=u9Lcnt4A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x20-20020a17090a789400b0026329075cc5si3191965pjk.155.2023.07.27.12.14.28; Thu, 27 Jul 2023 12:14:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=u9Lcnt4A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229923AbjG0SJn (ORCPT + 99 others); Thu, 27 Jul 2023 14:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229633AbjG0SJm (ORCPT ); Thu, 27 Jul 2023 14:09:42 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 042B72D64 for ; Thu, 27 Jul 2023 11:09:41 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-99bcf2de59cso174336466b.0 for ; Thu, 27 Jul 2023 11:09:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690481379; x=1691086179; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vFXw2+/KjQw8lFjUIikFW0fpJeY+CVFCOxN28DSc2EU=; b=u9Lcnt4AIVuUkFcAGaUnmpymF9rWEHPvOXpXB6dGhP3BOSP7gSH4v2E6z5lSYZkUyl 0v0unc1ZvcWA6/dofZ0iAsJjUnlcOrkw/t7VbQf1vBMncRJymzx0Ob/i5xWsHuiHyJro mzdinAzZaleSfyM792cjxJXh+8ckauv3PEYzY9/oc25YwSgah//rUVvFFyDofJBQaSUr 8wcgis6hBaE7K9wTpAQKokZufhksFyM28GVWKljwbLQ4MB9Fbe4YxjOea7Wx1UfRnC8C EZ51XNS29AKcr+QSK8p3pvrewa2uFhVr+Z1yc5cFpat5gIvM/b+T0u+1Iwi79EfmO1nS evfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690481379; x=1691086179; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vFXw2+/KjQw8lFjUIikFW0fpJeY+CVFCOxN28DSc2EU=; b=JRrDKbYCgZF7NPfktk2WJB2OHzEimVpi621LZ1QplPL4NyeLgKUt5cX3utBNLB/kRR AdH8NA3wliBGSNBXE8kDAEZsfGNIbybUGiMh9Q6ZGp6VPryCZHosCkHcVH6NxCQPK9G2 wY3ZO6gQ/DI7JAjIPejbGhLDUBEUTEmqowWuxlxUPnBg8hJWtWAPWHoL/3xlnYGmLaJ7 57fnEyKWSwZNPaSKpGs7yMKFRG9ekbpQxfCETbdPBqItYk+uWTjO1ajFA5FBq37iaa6X UNWx1mfE529027jDtxmdkrpAEycjq5VLdBpXUGAZ1Al+CCIPvjM4RcHNHnwyLGAhumXn 5akg== X-Gm-Message-State: ABy/qLY+LA/LdkwkyaK6Sw150WDKzPzXTrawPZkdzMwfyxpd0YqmP28g q09VIQHJrkHRpjRSJX+5aGgB3Saw+Els2YaRXkYIrw== X-Received: by 2002:a17:907:2cc8:b0:99b:cc2f:c47c with SMTP id hg8-20020a1709072cc800b0099bcc2fc47cmr2592178ejc.53.1690481379333; Thu, 27 Jul 2023 11:09:39 -0700 (PDT) MIME-Version: 1.0 References: <20230727162343.1415598-1-hannes@cmpxchg.org> <20230727162343.1415598-2-hannes@cmpxchg.org> In-Reply-To: <20230727162343.1415598-2-hannes@cmpxchg.org> From: Yosry Ahmed Date: Thu, 27 Jul 2023 11:09:03 -0700 Message-ID: Subject: Re: [PATCH 1/3] mm: zswap: use zswap_invalidate_entry() for duplicates To: Johannes Weiner Cc: Andrew Morton , Nhat Pham , Domenico Cerasuolo , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 27, 2023 at 9:23=E2=80=AFAM Johannes Weiner wrote: > > Minor cleanup. Instead of open-coding the tree deletion and the put, > use the zswap_invalidate_entry() convenience helper. > > Suggested-by: Yosry Ahmed > Signed-off-by: Johannes Weiner Reviewed-by: Yosry Ahmed 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) =3D=3D -E= EXIST) { > 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 >