Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2034236rdb; Thu, 7 Dec 2023 16:43:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJSZm+ZhS6yuiA00tkOqA/rBK6ynkOFS1r2o1zDLPl93/HDrgGb7CBWLuDT4GggZzkgwOg X-Received: by 2002:a05:6a00:1d8d:b0:6cd:d6eb:2f19 with SMTP id z13-20020a056a001d8d00b006cdd6eb2f19mr3393486pfw.9.1701996202943; Thu, 07 Dec 2023 16:43:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701996202; cv=none; d=google.com; s=arc-20160816; b=rxPzKZJs3AutXTKt7RbPvFc1TNs79IvVEb+EsUzGECzETKepl5E6oVf01/8xpacYNE klrhfloDPN0a4N5heFfwDHEWiccZWFMmUuUSERbcF4nkHmRJ0NGSvX0CCVTXvdFH4tma K0vcw6uS2gJPE2Usm60FPaCYD/LDjGRv7uuMNAA4jGcvBNyxaauvQmq/L3kN94gRG/lv L02EmYVjtwSDFKX4l6W+Gl4sP0kE+YEGvYl/+nYu0Z3tUDtDSge+gZTjuhkCcnhf9RNa Ua3X2g3n28Kqaogy3Nu0vrhbAcKBP+6ldzzJn8w+C0GzHy3Ry9O8iLPVc74/tuXDyYIc xC9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8OQ4qcJBnrVu5qdEda2Vkc1e736jChzDqNzRg++7jp4=; fh=8IG6FXjBbX7sKw6VCXHnFHmfRrjugQpAJBRlV+XitCA=; b=SamKZcoUr4bqrp37naZgNWMMFUvNXrmCxYpW/nzrlBtRNVMKqiPHLGMEUKLHFbq2Lf XQt3UdluS/jISfu3lUHvCoThlRO7wOVs97gAuuw3Oc3saoBpFGPFdQTKwrC49mBdsBVc d3C09pN2O9kD5CuRqniMcFyhQTKDcSXdhokBXkSzf1ppH+PEycPoQKhFt6GMjJb9rl5d XdiVFwr+ZBk+K3KTKDqUjb/1xEXPgNlgwJnuHRbn/pSDjJinZHXRenGWfps/wvep5OZz Rbyi0nCJBN4Hx0NY5Zd3BW1VAGM5SR+MMv2/VO9jC3Ok+9MVJYjJDcrcrCy10TeerJvW 8h2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Xp1OZaYw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id h12-20020a056a00230c00b006cb88a284dfsi546988pfh.164.2023.12.07.16.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 16:43:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Xp1OZaYw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 8BDAE80E9E1D; Thu, 7 Dec 2023 16:43:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232621AbjLHAnG (ORCPT + 99 others); Thu, 7 Dec 2023 19:43:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbjLHAnF (ORCPT ); Thu, 7 Dec 2023 19:43:05 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6318FD5B; Thu, 7 Dec 2023 16:43:11 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7b373b0e9b7so71054839f.0; Thu, 07 Dec 2023 16:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701996191; x=1702600991; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8OQ4qcJBnrVu5qdEda2Vkc1e736jChzDqNzRg++7jp4=; b=Xp1OZaYwu7UmbI0jUOrYrDiwhgyOlQEfKxfcDHrsmTS0OUUmChDC50iG+O8GF42b9O X943sj1BPgoR05PWOfKH1du5kzGFCn1o9ctlr2+kW5SPxM3h06LUnUWsoK6zg03BzfcH xYNIboaLLCCstB51Sn0vSWPM2PPSl79eYj+l3zT5BiDNqC2lQmEUBEPUm6AcjhVlhW3Q Zl6dJrZNznPt5vUpvyiXlWCecW+qoE7PH+8tqJ4rfDtTbrvH/XDOh4zGZE0zHvgWNCtz hSMw2Guejll6mTGBQGYtbPzQQC04eSUzPNdaAJLIR4oPEHqkjdg5zis3VgcI2RXx9saZ /eJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701996191; x=1702600991; h=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=8OQ4qcJBnrVu5qdEda2Vkc1e736jChzDqNzRg++7jp4=; b=AUahYRwgKNB0hrw68HZauD7jkg0rewKoypiKdFDDccZJ8ZzjfzbyWZepnLf3bild/F eZFNq0G+OdSnXRJhFm9S42NDyEy+TSfKem2RsLtUU4sZi7IecHZzi2V3mFu6BrHp/T9Y 7+VfWCRdsyGcMgNCOCREJDWWsUQfnpHqrHUDMteoDi/rtUIkaIwejMlhoPyIlDJi7/lQ 35SP06MQN8qiIFfjjqWiAgXq5Np9i4Cws6F7jz18/9Qhff4KW6mbR004I1u6lnpWDp2P jDM67THU0B5daQeedzLHP/VCjHMzgmZSrBO+xPXf4XZmj0aq+iLTW0DIoRs8ydj1fzuD PeUA== X-Gm-Message-State: AOJu0YyUj+95w0wAxs2SPnhC3iGSua5WOIuwFjT1sF+8B7ozJRo2vadz SFCUDQQS30juTYF+9lwemloQPFBVHmjrkTIiM3o= X-Received: by 2002:a5e:8e04:0:b0:7b6:ef47:7042 with SMTP id a4-20020a5e8e04000000b007b6ef477042mr2369173ion.20.1701996190674; Thu, 07 Dec 2023 16:43:10 -0800 (PST) MIME-Version: 1.0 References: <20231207192406.3809579-1-nphamcs@gmail.com> <20231207141142.307745be167d044b0eec1b42@linux-foundation.org> In-Reply-To: <20231207141142.307745be167d044b0eec1b42@linux-foundation.org> From: Nhat Pham Date: Thu, 7 Dec 2023 16:42:59 -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" 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 07 Dec 2023 16:43:20 -0800 (PST) > > This does seem to be getting down into the weeds. How would a user > know (or even suspect) that these things are happening to them? Perhaps > it would be helpful to tell people where to go look to determine this. When I test this feature during its development, I primarily just look at the swapin/major fault counters to see if I'm experiencing swapping IO, and when writeback is disabled, if the IO is still there. We can also poll these counters overtime and plot it/compute their rate of change. I just assumed this is usually the standard practice, and not very zswap-specific in general, so I did not specify in the zswap documentation. > > Also, it would be quite helpful of the changelog were to give us some > idea of how important this tunable is. What sort of throughput > differences might it cause and under what circumstances? For the most part, this feature is motivated by internal parties who have already established their opinions regarding swapping - the workloads that are highly sensitive to IO, and especially those who are using servers with really slow disk performance (for instance, massive but slow HDDs). For these folks, it's impossible to convince them to even entertain zswap if swapping also comes as a packaged deal. Writeback disabling is quite a useful feature in these situations - on a mixed workloads deployment, they can disable writeback for the more IO-sensitive workloads, and enable writeback for other background workloads. (Maybe we should include the paragraph above as part of the changelog?) 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.