Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2042208rdb; Thu, 7 Dec 2023 17:03:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IFr7+h+s0BA+309NkGwiU81e8TXkZtQv4c2G7L3VmodtMSBbkIhyQewEHTWDyiapEualC6M X-Received: by 2002:a05:6a20:5603:b0:18f:be46:7d52 with SMTP id ir3-20020a056a20560300b0018fbe467d52mr3262188pzc.105.1701997439040; Thu, 07 Dec 2023 17:03:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701997439; cv=none; d=google.com; s=arc-20160816; b=cqpTvz4RPhWyab8D/nz9NFW5jGqR3QeFoaJnKrbrvEJPYW2S5wTbz3wUfOa9oJsyup BWIG1fIL0X2LwUM+BK8LxM/1aohkpmPf/CcEmKIXE4qJjvJP/jMFMg7GjjcbR9F4Vs9l If0NqZHXPKopE4HOpRvKoNsnlUaFs/wKUMWuJjaVufvYBQ7+JLKG+/tz9SYW9fw3Ssyg KNt1dM4PRaobxLOopl8t8Pq0kW8WdbK3X/j2bwJgdm84Nu+8NKpeW8+jL+J6lSOBpgwc fbLKOjgDdU+OITAL5+6hIppjL+cB6sMLf1uF9gQT4CWz7kj1E6e+chSPLNOkzwrbSxBt TS9A== 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=FFmGbo8fhXTr6Pczms9GfEwRxaNflz7F0LyZ8zkEvYE=; fh=O9UIPMmoeykWQ0SMBalrkmeGmxPXOwfVRtCQbnDXh+A=; b=g5bFGTr2LTbywZu4rJAOSijvIm2tWkcLGo/e4zkTjhPOYRkL7VEgEpog68I5TdToLI gfwhXSolze3sLdp1WUnFazFkJzgPfh0wGKEUtOrXTstPxp/DELp/S+a1vd3AisTCa/Sl LzCdixWwCgQB4A0SjnII6/sInmA2P2lAnaDiLdZp8C8QQZ50qc5uLQHHbaLldg48RIIQ ZOWUVhKi+vL0d/hTZGVtD8sqpWHadbQOIbaSpC5soC219XlLuyEugumfXrdHRorJ8B2D oU2y5AUQ46cY4XhLwwhPw3Bi8nW4315lBL6XxQnpOJ1e02aFBBiQz/iLI2ednSVi0ZMV Ne1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PCuScKAk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s12-20020a056a0008cc00b006cdd0109833si577179pfu.154.2023.12.07.17.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 17:03:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PCuScKAk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 39D5480EE83D; Thu, 7 Dec 2023 17:03:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444207AbjLHBDl (ORCPT + 99 others); Thu, 7 Dec 2023 20:03:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjLHBDk (ORCPT ); Thu, 7 Dec 2023 20:03:40 -0500 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DEA61708; Thu, 7 Dec 2023 17:03:43 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7b6f4330598so48710739f.1; Thu, 07 Dec 2023 17:03:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701997423; x=1702602223; darn=vger.kernel.org; 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=FFmGbo8fhXTr6Pczms9GfEwRxaNflz7F0LyZ8zkEvYE=; b=PCuScKAk1OX6xK7/E7A4aW5apNTR/EUyuM4ju2F0J3Xj+0Z5sXw6E5Y2qadyK0qLwe U5qrZYZErCyMLRzaHJyUuXvsxJV+5/nmE3eTUBrOmo4CGKc+kj3iO9Q07Jnm0P16HZb/ iSYnXOyh1XdmKsIVtvnOaU9vJXITTOTt3lx9iiYVghiVSpsBNl1QXMsBKihHBHRyESER X8vHXQL4cQOZZ28yIGumF0484j1gfIJVzLBPb0z2xhFIkKcsaOmJGN++Jt2UvX1wzonw YVSusNajqhmRUXD15xzYkJCehD2QSxRUbxj6EkZdg/+t07v/sWC5zL06JMFi1avkGcd3 8Ayg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701997423; x=1702602223; 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=FFmGbo8fhXTr6Pczms9GfEwRxaNflz7F0LyZ8zkEvYE=; b=gsLD6xoNyopNdpUQ6jRHVs9jzWXu8G62xgk7OLHijQI5kSkNeEjuXKUUeScYOSQ9Kf tS8IBIPq47Y3P47t6nlqTI2Mk6lTeTIAdiovVTB+r5J1PnJJcuCOq2daPVixIbNFHPWR nt8QZwzjgNZy9au9zXKaZzZbOW/1saT0ZNvDEKju92p5LoM9JvbVZs8X7+2ioGTeZI4x uQ5CLWBgnHN6XLKUXC1Embaj5sOrkQjSlDA/zuk6OVk4A3nSFLnT2BHJEzimPC7LZczJ FYFD9Y8cYcuavkyhc9KLw+ScDpBdBFX4/Gb8zLz4lROsJkvayHTZNrnIy6/EhT18npEo UJSA== X-Gm-Message-State: AOJu0YxCNaVTFrV+6QrU4u5Tu1Lzn1FxIcqUF4S+Le4kZDybiEQKzMV4 8/OdiIjuECtXLDKYtJlmaxway5YiZwflAzZt9UI= X-Received: by 2002:a6b:cf16:0:b0:7b4:28e4:8509 with SMTP id o22-20020a6bcf16000000b007b428e48509mr3612735ioa.11.1701997422578; Thu, 07 Dec 2023 17:03:42 -0800 (PST) MIME-Version: 1.0 References: <20231207192406.3809579-1-nphamcs@gmail.com> In-Reply-To: From: Nhat Pham Date: Thu, 7 Dec 2023 17:03:31 -0800 Message-ID: Subject: Re: [PATCH v6] zswap: memcontrol: implement zswap writeback disabling To: Chris Li Cc: akpm@linux-foundation.org, tj@kernel.org, lizefan.x@bytedance.com, hannes@cmpxchg.org, cerasuolodomenico@gmail.com, yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, hughd@google.com, corbet@lwn.net, konrad.wilk@oracle.com, senozhatsky@chromium.org, rppt@kernel.org, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, david@ixit.cz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 17:03:56 -0800 (PST) On Thu, Dec 7, 2023 at 4:19=E2=80=AFPM Chris Li wrote: > > Hi Nhat, > > > On Thu, Dec 7, 2023 at 11:24=E2=80=AFAM Nhat Pham wro= te: > > > > During our experiment with zswap, we sometimes observe swap IOs due to > > occasional zswap store failures and writebacks-to-swap. These swapping > > IOs prevent many users who cannot tolerate swapping from adopting zswap > > to save memory and improve performance where possible. > > > > This patch adds the option to disable this behavior entirely: do not > > writeback to backing swapping device when a zswap store attempt fail, > > and do not write pages in the zswap pool back to the backing swap > > device (both when the pool is full, and when the new zswap shrinker is > > called). > > > > This new behavior can be opted-in/out on a per-cgroup basis via a new > > cgroup file. By default, writebacks to swap device is enabled, which is > > the previous behavior. Initially, writeback is enabled for the root > > cgroup, and a newly created cgroup will inherit the current setting of > > its parent. > > > > Note that this is subtly different from setting memory.swap.max to 0, a= s > > it still allows for pages to be stored in the zswap pool (which itself > > consumes swap space in its current form). > > > > This patch should be applied on top of the zswap shrinker series: > > > > https://lore.kernel.org/linux-mm/20231130194023.4102148-1-nphamcs@gmail= .com/ > > > > as it also disables the zswap shrinker, a major source of zswap > > writebacks. > > I am wondering about the status of "memory.swap.tiers" proof of concept p= atch? > Are we still on board to have this two patch merge together somehow so > we can have > "memory.swap.tiers" =3D=3D "all" and "memory.swap.tiers" =3D=3D "zswap" c= over the > memory.zswap.writeback =3D=3D 1 and memory.zswap.writeback =3D=3D 0 case? > > Thanks > > Chris > Hi Chris, I briefly summarized my recent discussion with Johannes here: https://lore.kernel.org/all/CAKEwX=3DNwGGRAtXoNPfq63YnNLBCF0ZDOdLVRsvzUmYhK= 4jxzHA@mail.gmail.com/ TL;DR is we acknowledge the potential usefulness of swap.tiers interface, but the use case is not quite there yet, so it does not make too much sense to build up that heavy machinery now. zswap.writeback is a more urgent need, and does not prevent swap.tiers if we do decide to implement it.