Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2047040rdb; Thu, 7 Dec 2023 17:14:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/2ZXMNlrKbhmoBK/d9G2hbSbhvyZW/szbuFNd3hUnNapVmLwBPNjzn8ONDUUv33mO9oST X-Received: by 2002:a17:903:110d:b0:1d0:6ffd:e2d5 with SMTP id n13-20020a170903110d00b001d06ffde2d5mr3836787plh.111.1701998086740; Thu, 07 Dec 2023 17:14:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701998086; cv=none; d=google.com; s=arc-20160816; b=JjzXqHutwyO3ftlnnT7pmFBIf/VQhOvkB0OfkdiDCdjVo1sIH7ifl5S9e3PShqzTEd snVxPUHKUSRoq677GIBAE5KpFs4bO8YOfCb3gUo8XByM1sBHiQOCoVwavcEv/hKmTSVy jnGyesNOhSJB9Ujf18R1Dj/dstXXC0D2BcIH6NUXK3mhRDpZOpb1OtYXG4aa17afwYFH PPNFdjjr66xNcZVjx74zbzJpj/6A3d0pRYkSPo8kcHj05XHERIwTSAWSJcMyV2kagDQf EwBAnx9xrjzisvpy2m211A/QnGXu83BWOICzkSGmKNwnkcsoxA1UXAxNOQuszFjYnEw9 6jiQ== 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=yo7cHeMTarcGBUaA8OM2fMUJyq8/LpYExJLjCHdh5Nc=; fh=8IG6FXjBbX7sKw6VCXHnFHmfRrjugQpAJBRlV+XitCA=; b=fIoi/QGtOVztDp8jHdYwuPMIz42ipfuL7yk5ZapX8wn2jGDYn4rG3CaqGCn9EYjrhr WQRiPGHRo/WtHKGb1Gtg4BoNqFGoEm6TmI/KGlDJl+f1aJptJIla/NjBHz7uwbB93zMS mbBqtcvX8Xiiy232uUDT+wMXkb7Yagr1EUGi3GVxSPtlaypSqBwjGiwrJyyHntP07Shf b8j54CTGWqf9L+HxYr7Ha6E1p4jEy7lfbnCe/36mDMxNA8JrWFaSRB263QoxJSTbdC1F SGBuZSfKO5ta+/Qc40iJ8hnhlQHxNgIPh2B7SB/kBh0Z5YbjJ+3sTLcbXauhol23ZBDs udzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EvAywlk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id c2-20020a170902d90200b001d09c8c44dfsi597549plz.627.2023.12.07.17.14.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 17:14:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EvAywlk1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 826F4804C609; Thu, 7 Dec 2023 17:14:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1572900AbjLHBO2 (ORCPT + 99 others); Thu, 7 Dec 2023 20:14:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444223AbjLHBO1 (ORCPT ); Thu, 7 Dec 2023 20:14:27 -0500 Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0A81706; Thu, 7 Dec 2023 17:14:33 -0800 (PST) Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-7b70de199f6so8031639f.2; Thu, 07 Dec 2023 17:14:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701998073; x=1702602873; 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=yo7cHeMTarcGBUaA8OM2fMUJyq8/LpYExJLjCHdh5Nc=; b=EvAywlk11vAybVFoYb2/hKS8i9IqpVgXPH78bIQgRsYD4jynVOG0tG61jeRqsWNhDp XVOW7H2bZ1CJF9BKR6twI5O7/pfJ4EWdBdfTC8Lswenfr7osbAPPF5S2bftsUSoE1k7r Pna4vAPsb5dZnrgEsbFTLayXjODFd5V3aN5J8j/WOKi8iveno7NJguPwjWse9LnQ/DOo 7httFtKl+MV0bXCSyH22xHCeyKDGkExxweDyTMvRP7uz7S0n9ASgJ/PLIii0i2IwNjUM i5yfUIWQoCGV9a0jhq75Tl3mEBgKcbTpjxyO9UqODg9F9FaFmYGckRYj68CPkWJoSEcz rhnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701998073; x=1702602873; 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=yo7cHeMTarcGBUaA8OM2fMUJyq8/LpYExJLjCHdh5Nc=; b=CXf8e4gOklRcu7ffjJelqPfv0TZ6FH87VzpQN1ZLntCe/eqcOv/KuVQrnvjv07LxUc kOu3YRxtSXMaBs6mY05kJBof1Wga6Gc9KmMI1K2FP6Avl+PL0gEoWWikVTgLhv09FT0A ipZ3FKBXamCPwqAUgYYv2igY7p6ssc1G9pL6yXen10Y0OuLchetdXpUQtQQzBxjFWVat AUOZzUEwbpBM3jR5yrq5VVSB6xPVxSzU8H4WJ9SZgmnhTmR1vD+3Dz17uoJprhvF1mTL UoFIdSK3TYRkU6Izl2MtoUYvcFlCJxm5JgoyJQwkmhUPqyKJ6tOdfLlXWZw77ifG29Vb SlDA== X-Gm-Message-State: AOJu0YzsZnKwwUutlNmSooHbgRCiWvmvltu9tsB/o3OYur0A7rQw7FXF 5R1/gNz8QDZ8PNSluyFRbVcp2ybYnuRwoZAz1Cs= X-Received: by 2002:a5d:8194:0:b0:7b3:973d:c4 with SMTP id u20-20020a5d8194000000b007b3973d00c4mr4073115ion.16.1701998073117; Thu, 07 Dec 2023 17:14:33 -0800 (PST) MIME-Version: 1.0 References: <20231207192406.3809579-1-nphamcs@gmail.com> <20231207141142.307745be167d044b0eec1b42@linux-foundation.org> In-Reply-To: From: Nhat Pham Date: Thu, 7 Dec 2023 17:14:22 -0800 Message-ID: Subject: Re: [PATCH v6] zswap: memcontrol: implement zswap writeback disabling To: Andrew Morton Cc: 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, chrisl@kernel.org 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 17:14:44 -0800 (PST) On Thu, Dec 7, 2023 at 4:42=E2=80=AFPM Nhat Pham wrote: > [..] > > I don't have any concrete numbers though - any numbers I can pull out > are from highly artificial tasks that only serve to test the > correctness aspect of the implementation. zswap.writeback disablement > would of course be faster in these situations (up to 33%!!!!) - but > that's basically just saying HDD is slow. Which is not very > informative or surprising, so I did not include it in the changelog. For instance, on a server with HDD, I allocate memories and populate them with random values (so that zswap store will always fail), and specify memory.high low enough to trigger reclaim. The time it takes to allocate the memories and just read through it a couple of times (doing silly things like computing the values' average etc.): zswap.writeback disabled: real 0m30.537s user 0m23.687s sys 0m6.637s 0 pages swapped in 0 pages swapped out zswap.writeback enabled: real 0m45.061s user 0m24.310s sys 0m8.892s 712686 pages swapped in 461093 pages swapped out (the last two lines are from vmstat -s).