Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5672663rdb; Wed, 13 Dec 2023 16:18:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpRZXNBfz6zAvHD3rEHcdv+Hrt5+f1kAfFy9TC04NUVSMGsLtXx1bwMDqXxA/VL8hB5nL3 X-Received: by 2002:a05:6a20:2926:b0:18f:97c:3861 with SMTP id t38-20020a056a20292600b0018f097c3861mr8809722pzf.59.1702513130748; Wed, 13 Dec 2023 16:18:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702513130; cv=none; d=google.com; s=arc-20160816; b=TzeBbrOq5stoOtwEHqaGztxLm61rBZHA9CMWi+RE6AxbcrVCxhBKZI03A735BhyIUK Tcu3gsb8SEEIuRZMMrpf1EP+eC3CLC4TnvYxdbx//N2vWtusd4IQaV/KMAHFYPeK7xsW rL8LOTdvCStxNq8gz5Jqm2hx53tX2prRXREPqUg1K3iiLy75QeNqEyk1J8wguYuTdqqz go7draY5rg7Xf3O8LEQmoPcbuFxUh7rKESpzIX/IerK2qhiScirEV3Nzs/niqUX3ba2A 2u8fZCXJKXqtKO6xBa8wEWZvhFwwmZlBU3WTCAdfmOMNwEdiyfBWOWtI4AMaDivpXMgt GNnw== 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=UK0r9pqE3gS6uIIh7g6GkHrJnnAduy/j8HlB4vpg/WI=; fh=CcmSh0HiimF8Zsm6wh/XwrLc2aYJxF3572jVG2Fg6wo=; b=GgSVMKNwIp70BBo0/0xMeGjbw+cmwzjo9AA0tyuzQqallJFE15Tat47I25EmTTOqRB RKapEIDBBKh7K/j8KZFhb7+JeFKXmG13Wq2a046PYjvbMA3IhEDj0lJH3INQSNf6S2P0 /ER94EH52Nz2USSi6O0wOYtKMXtPv45qKEG8EN7w+p79IkFiV0Jj6RMDecekVhUR/5BF rLIlH/GhOmVvA/345va7wBLOamXEF4h4GoNnGyLGTv9YTr/mot4mMOv6D4Q3rvKZX5Oe 9LdXWsR3csF1dpHiyTCg7qeCGlJfIB+anb8qvKi9DFf1owDFtioZrZG+ELoHmgvibpIy aOcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SpSu16Hi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id a2-20020a056a000c8200b006ce6b4258ffsi10460493pfv.302.2023.12.13.16.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 16:18:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SpSu16Hi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 4B01D827E599; Wed, 13 Dec 2023 16:18:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442806AbjLNASe (ORCPT + 99 others); Wed, 13 Dec 2023 19:18:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234086AbjLNASd (ORCPT ); Wed, 13 Dec 2023 19:18:33 -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 D70A9C9 for ; Wed, 13 Dec 2023 16:18:39 -0800 (PST) Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7b71d65021dso2714639f.1 for ; Wed, 13 Dec 2023 16:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702513119; x=1703117919; 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=UK0r9pqE3gS6uIIh7g6GkHrJnnAduy/j8HlB4vpg/WI=; b=SpSu16HiptAvSuPCo+8FZNXa+Uy1iBODjYZ6AfZeDKEPzeciaxwKpVV06xszI/CMhn /GQZTWfUsLGB5DQWYYj+qxccuePmTJCCMbf5XKK5LPNjDLAN7GuRALbftKS2K/mr8Uhg HB3/bL0xEA0lmTn829+6W+PmiXpbYSbt95Xc9bMcS5wGo6UZ0mVoqGurbF0smfAQ2MUX UQKGx4ePtZCSW1mJ4lKOKi4eKQrjIFvofpMqKabFMtSsdDC5/tpXXqUat0333zNd7Pmc SHTbII+JB3SyxrDx7hXXSosLzoXMIDtkvQOaLf9JKf+2YWbkxWKlPW8obi96Y0Rd0WFk 0mvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702513119; x=1703117919; 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=UK0r9pqE3gS6uIIh7g6GkHrJnnAduy/j8HlB4vpg/WI=; b=R+XISHd/t37NxPNF9O2PezSewF2+vegk5U1m/vJ843ffFSiN7u4EErglTS3/saQPQI bc7T3jIUizxd8I9cLM2PukEFsw/59DPEwMk++IrgwxyaHmCRPxDsUpctDNuhriJLHh6h G/U5w0YYZHVzL0pVXHgASzx6su7/sDnWu49nASzqdreSKLj3fC2Z+FF5g+ZBgRROoYNE 7oBTvWpGiOqAEfXPuPcFrPq1/eVnIae/MI8MKqpoxNSPBFVSJetduB7IOVeFlvwFhjLA uftohugH+egnpvuDVsCZAhe6cnmGgShscLv3CyIgFKKMXiRRbcPOUnvElB4u9ou/nyAP qHvg== X-Gm-Message-State: AOJu0Yz491hC/gzSQHFwnQT79ZMfkq59CvIGdD5kMn1SHrGB31pyzVyt pRDg01SZcjJjKnL5wMIMUR2xKryrWnJbGw5c3kI= X-Received: by 2002:a6b:e81a:0:b0:7b4:2a4e:57b0 with SMTP id f26-20020a6be81a000000b007b42a4e57b0mr7965967ioh.11.1702513119140; Wed, 13 Dec 2023 16:18:39 -0800 (PST) MIME-Version: 1.0 References: <20231213-zswap-dstmem-v1-0-896763369d04@bytedance.com> <20231213-zswap-dstmem-v1-2-896763369d04@bytedance.com> In-Reply-To: From: Nhat Pham Date: Wed, 13 Dec 2023 16:18:28 -0800 Message-ID: Subject: Re: [PATCH 2/5] mm/zswap: change dstmem size to one page To: Yosry Ahmed Cc: Chengming Zhou , Andrew Morton , Chris Li , Johannes Weiner , Seth Jennings , Dan Streetman , Vitaly Wool , linux-kernel@vger.kernel.org, linux-mm@kvack.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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 16:18:48 -0800 (PST) On Wed, Dec 13, 2023 at 3:34=E2=80=AFPM Yosry Ahmed = wrote: > > On Tue, Dec 12, 2023 at 8:18=E2=80=AFPM Chengming Zhou > wrote: > > > > Change the dstmem size from 2 * PAGE_SIZE to only one page since > > we only need at most one page when compress, and the "dlen" is also > > PAGE_SIZE in acomp_request_set_params(). If the output size > PAGE_SIZE > > we don't wanna store the output in zswap anyway. > > > > So change it to one page, and delete the stale comment. > > I couldn't find the history of why we needed 2 * PAGE_SIZE, it would > be nice if someone has the context, perhaps one of the maintainers. It'd be very nice indeed. > > One potential reason is that we used to store a zswap header > containing the swap entry in the compressed page for writeback > purposes, but we don't do that anymore. Maybe we wanted to be able to > handle the case where an incompressible page would exceed PAGE_SIZE > because of that? It could be hmm. I didn't study the old zswap architecture too much, but it has been 2 * PAGE_SIZE since the time zswap was first merged last I checked. I'm not 100% comfortable ACK-ing the undoing of something that looks so intentional, but FTR, AFAICT, this looks correct to me.