Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1338844rwi; Wed, 26 Oct 2022 14:04:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5pRVd/VeT/li6yHU/td+UVCCNmAyE/RHTLqhX5xThAjn7lvYM5uMi/KF0G3RxzNVZAyRHG X-Received: by 2002:a17:907:746:b0:741:4a1b:cb1f with SMTP id xc6-20020a170907074600b007414a1bcb1fmr37576353ejb.370.1666818276045; Wed, 26 Oct 2022 14:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666818276; cv=none; d=google.com; s=arc-20160816; b=Ym7KPubzuHrRjSCJHZzUAGvPhEAQWS5IbNPpFvbjKoVjZ9VSfdKwMyc02wi3Tty32S P8qyZJ7SlKhpW5OvF1Jn+S93alC6SIYFrVgLUOcjbWXwj3cXE1VX+vN8Bet3wZufm+c0 cssL+Q6JSqu5ls0OOmqq+Oku18D3wz5U1Ugx40CZcY+LpC95fOtAjZWgL2cPkFNfFHvT svPml/KTRntIcBOTrZqcJMVdDaDrFNEYCD2j9UL+KUwmU0ILoPP4WkdgMasXQH1LpbaC Xn5CPkJcDRUHCBP6kPcs9+0XsoI1zSLrnVO0zp4/oljt/yw0rMFgN8VJ49WGTaHAVH0K JBSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=reYTGbFPdclPcD2z+9ilEBAxZuR3E49Fi6l8bS5z4WI=; b=Cr/KAEvw1z8z9EK7c5icgmDRuey/e8w3j+SUgc9Zi0tZhhXrYjFXKtL9yLRwQ8tQ4D +rX5rOpM9Q8aH4ei3wSQIrvM6vlT2wipvK/K4V+6z8hJyckWH9fKk9smYLCensvUXRo7 /8L669eJtnLZeiEEdjKlFibPQ1Y+8UuavnZjvBacBB8Mw73XImB2jcEXRygchZ6kkixp jHjwaPaqCejlOZs5qeK0kgPNEhbhV2etK0FZYM7E6PN9lUp6oJ501NgSCcxaPjJynDFe sUmTBGJOHzuwGReoPKB3QX5eH92XnvLjc44XjCEGHYYAVtuTgsdj/JYjoCnOjgzrQcEw 8eCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aBtyYt4P; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa11-20020a1709076d0b00b0078db3ce1e59si7156413ejc.38.2022.10.26.14.03.45; Wed, 26 Oct 2022 14:04:36 -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=@gmail.com header.s=20210112 header.b=aBtyYt4P; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234410AbiJZUGx (ORCPT + 99 others); Wed, 26 Oct 2022 16:06:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235014AbiJZUGV (ORCPT ); Wed, 26 Oct 2022 16:06:21 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B83A7923D4 for ; Wed, 26 Oct 2022 13:06:14 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 20so16023882pgc.5 for ; Wed, 26 Oct 2022 13:06:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=reYTGbFPdclPcD2z+9ilEBAxZuR3E49Fi6l8bS5z4WI=; b=aBtyYt4P+vrjfIes9GrPnp95ytz1pJMQqoVJ9IaOTyatT7BoXUjWDPFe7pG+Lk4T79 NQuMNp02jNFbg3gNY3A6L5qaM0I+ipLR0tic74LTR25pkvpbJp07lDvXeYm6xmOtG/BH op+IP2TMH34vf4h8sRylM7+9xt8LxOPbRNiyKSalamzvKDJEYWNI1aILFBGmb3njkqQj nmHPjxnsNzYpDqpjCzaSPqJSK4Jb7RJzZna4H+HWIdBQVl05zEPXIXq+Aztx7KiAF66s k+AD9Z375sO6Ti0vlaZIne8oZPdVrcblEhURsgaKd+UYVIlFWZLvTrt9geLhnDGjsBya qkKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=reYTGbFPdclPcD2z+9ilEBAxZuR3E49Fi6l8bS5z4WI=; b=g17CQlYUj87ZvGfxnR4Ggtbn/xGNAZ35MqCyIxtZUPYNqL/cM896Fr/LHZ8dFQvMwu 0ALNGrmL75k+FvEb+S7wx032e0Z/Bv2PUjW+O9DIppfd31cBtb0DJPB7gVRGzGFEn4So Ti7bCt/MKNcIXqtMnRr1BpAatQWm6p8RyHlXnjivvOGJwIoKdqbK3Ogc9jfrKnmgBlv8 StxSJ6Zs/IME28BdomXU3HZz5ERe9Oel6z9urLdraRBektmzmjwUJ2RfyWda3+6eZM1b oYM2v3C8nljFrKgJEowZnK+sCTGQC9pfs4gG/s3rfcccvvpkuXpmA6e88D6yjAd2ROxH 89pw== X-Gm-Message-State: ACrzQf1o0QVDmCU/XiavTmd26/XWIF/OBzUzgzYgUeW87Pp8u4uAGK8f /zVwq3eJCHQfe4AmeE4SU78= X-Received: by 2002:a65:6bd4:0:b0:443:94a1:429c with SMTP id e20-20020a656bd4000000b0044394a1429cmr39156742pgw.606.1666814774292; Wed, 26 Oct 2022 13:06:14 -0700 (PDT) Received: from localhost (fwdproxy-prn-003.fbsv.net. [2a03:2880:ff:3::face:b00c]) by smtp.gmail.com with ESMTPSA id q15-20020a170902dacf00b0017c19d7c89bsm3296439plx.269.2022.10.26.13.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 13:06:13 -0700 (PDT) From: Nhat Pham To: akpm@linux-foundation.org Cc: hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com Subject: [PATCH 0/5] Implement writeback for zsmalloc Date: Wed, 26 Oct 2022 13:06:08 -0700 Message-Id: <20221026200613.1031261-1-nphamcs@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Unlike other zswap’s allocators such as zbud or z3fold, zsmalloc currently lacks the writeback mechanism. This means that when the zswap pool is full, it will simply reject further allocations, and the pages will be written directly to swap. This series of patches implements writeback for zsmalloc. When the zswap pool becomes full, zsmalloc will attempt to evict all the compressed objects in the least-recently used zspages. There are 5 patches in this series: Johannes Weiner (1): zswap: fix writeback lock ordering for zsmalloc Nhat Pham (4): zsmalloc: Consolidate zs_pool's migrate_lock and size_class's locks zsmalloc: Add a LRU to zs_pool to keep track of zspages in LRU order zsmalloc: Add ops fields to zs_pool to store evict handlers zsmalloc: Implement writeback mechanism for zsmalloc mm/zsmalloc.c | 336 ++++++++++++++++++++++++++++++++++++++++---------- mm/zswap.c | 37 +++--- 2 files changed, 293 insertions(+), 80 deletions(-) -- 2.30.2