Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1557062rdb; Sun, 19 Nov 2023 00:29:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrsFx7UqU9+3JSDos198X5CIWTUnQolb5Fh/GGBddbgWVbRrLnVPNZlnQZYCri3GciAaiu X-Received: by 2002:a05:6a00:2908:b0:691:2d4:2389 with SMTP id cg8-20020a056a00290800b0069102d42389mr3643729pfb.21.1700382580230; Sun, 19 Nov 2023 00:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700382580; cv=none; d=google.com; s=arc-20160816; b=snehhTZIGQBUA4LWQFVTXAQfY34mSlVRQPqOXr5aB1TeM4myo/HFdElyQz88OCG828 MLGAkS1NG01z8XYRnVCNF2kP5yUYw38/0hsCrt/35jki+fHCOZlivtwF3aLT6wRdl+9x E16ZhaQqNuieZBXGVFlOYIkrmW6lzwlLHhuMvGzx9boXVr6V0UgykMH3fxLndUY8MLe/ d6PaOUIYyqX3zHgnMtpckphqJUxYih9L57IaBsNGc/RiR/b6eqPOFoRZcI4l1yGQopHE omvvzHYGXg9lI19CR6Nn/beJLzCScPPM1gNRkrswqIRm6b2kC4iWrwcvhqfa3o4GmD/H e03A== 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=rUActRnZmtzkV4K9zxV2dW7FzLL41pY5BNpwV/8e8k0=; fh=5LJCFo8BfKK2x56YrwVnsRe3clxwQs9Ke/UgJA5MX6c=; b=BENKUgQAjnVHb2oHcDhfEMdRBRDlh7gOFRtcdUwbT8zmyYRyPcCiTbcBahLmqLuPPk L1Fdji8A5CxIb605n0EY226A5hC6n/C+dpG5W2BiiTDYYyGCmjkS79pDwVljaiATki2E EALUtaRVP6ZCgrpxgsvzXAv8KRY1kNRn3DnL0ubbrWZoCceeKkleZBFDxbUJPenMC7Q3 4O367yBrT/Iy5xBsZ94oYxewuZ3Pjojxy0sf9Z2N4uuiQn/EdP04bueY7cp69Iho33zb k/7ZfjbI/vuhG3Yb3Enfa4fC0huijjAGvyUU9j4lnwukY6wRkSk18yPS+kTfelkHb6/Y dmTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RFI4xKuE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id j6-20020a056a00234600b006bf317c9397si5853492pfj.244.2023.11.19.00.29.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Nov 2023 00:29:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RFI4xKuE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id F0623808EE74; Sun, 19 Nov 2023 00:29:37 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229668AbjKSI3d (ORCPT + 99 others); Sun, 19 Nov 2023 03:29:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjKSI3b (ORCPT ); Sun, 19 Nov 2023 03:29:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE934CE for ; Sun, 19 Nov 2023 00:29:28 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 583E8C433CD for ; Sun, 19 Nov 2023 08:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700382568; bh=6v79FyeoIDasUhEqXXVQirvwJzjxpmLQLlOQstZb9KY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RFI4xKuEFjWeWK9lvlb/XZ0hFSAwMl/9gZ0HjcEEsusTyTpy9GgoBy7tWUA1iPhpc wmxzMC86wgrlWSpdLu5bJV535RSFEZ1b0ZyvsuCRnaIOD9kg3YRBZrzIaz09vkabuy xAJeb3pKCs5i+/hNux+EzgQlorZifsbmXPygIWrN46iE1VxbYj+v1lFgdUMkVawMgY TeKdbh7giBRJ3HjF8hHDErRmiN0tpmSP5FJY/kb5ckWfU7ynyL/3HyYtoXnCHE5nWa o5NUWWHVBa89RRsFzBWpWVL9hpGGjSnxQ2iVuQSvukZ1eLNVfnYx2Q9b8hpJ6cbkDh BhUviairKHYIQ== Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6cd09f51fe0so2340718a34.1 for ; Sun, 19 Nov 2023 00:29:28 -0800 (PST) X-Gm-Message-State: AOJu0YwJWNo+skETpsFBf8/kVftfMej7z/B2xZx/ryz4X90nnJj5OH3k Ta4RVwQvuAkGMpFn1l4OLBNFS4QASls5BE/eufTPiw== X-Received: by 2002:a05:6870:cb4a:b0:1ea:809c:3eb with SMTP id oz10-20020a056870cb4a00b001ea809c03ebmr5213078oab.44.1700382567531; Sun, 19 Nov 2023 00:29:27 -0800 (PST) MIME-Version: 1.0 References: <20231113130601.3350915-1-hezhongkun.hzk@bytedance.com> In-Reply-To: From: Chris Li Date: Sun, 19 Nov 2023 00:29:16 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [External] Re: [PATCH] mm:zswap: fix zswap entry reclamation failure in two scenarios To: Nhat Pham Cc: Zhongkun He , Yosry Ahmed , Andrew Morton , Johannes Weiner , Seth Jennings , Dan Streetman , Vitaly Wool , linux-mm , LKML , Ying Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 19 Nov 2023 00:29:38 -0800 (PST) On Sat, Nov 18, 2023 at 10:44=E2=80=AFAM Nhat Pham wrot= e: > > Why do we need to release them? > > Consider this scenario,there is a lot of data cached in memory and zswa= p, > > hit the limit=EF=BC=8Cand shrink_worker will fail. The new coming data = will be written > > directly to swap due to zswap_store failure. Should we free the last on= e > > to store the latest one in zswap. > > Shameless plug: zswap will much less likely hit the limit (global or > cgroup) with the shrinker enabled ;) It will proactively reclaim the > objects way ahead of the limit. I think that is actually the proper path, by the time it hits the limit of zpool. That is already too late to shrink zpool to make room. The shrinker should have guaranteed the amount of pages for write back purposes to make forward progress. > It comes with its own can of worms, of course - it's unlikely to work > for all workloads in its current form, but perhaps worth experimenting > with/improved upon? Agree. Chris