Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp786211rdb; Thu, 18 Jan 2024 21:13:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0OafLvVohQ1ztFcXD6ke4G9DqH9XrHVZBKkWsWr4W8/dBf5fsqWoQPXwlJcEYL11ZkMKs X-Received: by 2002:a17:90a:f697:b0:290:1cf2:56e with SMTP id cl23-20020a17090af69700b002901cf2056emr1577477pjb.1.1705641212003; Thu, 18 Jan 2024 21:13:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705641211; cv=pass; d=google.com; s=arc-20160816; b=zdqg66h8gEuNv/zRMsMfLtr2pPrMjLNK7x265e2+tksAE1qxmUFPHcRp+JxAv8LC0e 0++ayBU5lriI7HXQ0tYgiEC/DeAvoDY2n14NB3wpTQk93xgM1CfO5/ocoZCu749qsE1c 4WF+9zCchHrousNGDTEgszCvcaSeAZ35LDzsYzsptrSIxTgLEOcaLGuYiQkDlI3y/Kq7 gANO1e5cFLGVINdIwURnXWhd91bFx7mH79KnxNaAmDMbpw0WZL1lntu3IP8xjNzD6sON BDr6v18P2eMgFeRb88G4CuMqcLv9F48CLUXnNGSxLDdBNs9BL28VoOB/kNhF9mcARlJV q3dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=6DMlZREdHCOCJLHZWzZ6wV69tr/ryDaj7HxEqQ5FeQE=; fh=nKamcws4AdeXnhuCmBlHB/P7z/9I66GFZEzsAWPSKhI=; b=WkKX140ZW4OhMvPs2Tm6mBS0Z3wDqgR4GFnc4v5yzsTYVrK8iARh7SB9W/wUcR8wRu wMPY9wk1zcIGtRe9vXsubVmvfNBhlLMysSDl4ez6kg0r+vfUF+jUcanYe0FVkwU7Fhm3 VR3wPpNpar/U5G0eT3GApMMzBJ9F3L4mdJcmQDbpk3wZLBEzwIQicIEzdKO1QCFQIvtd 9WX/cWfH7amoup4ivRTd2W2JwMaLj+DOy2NzDuwQlmns40aosnCiFAKF7KDb9EOdwoKl jfH0IXg62IEsbpjRqW3DbYYu0Bi5M60tM1JEG2DnH6RXu4zfVlC2qL6baBORQmVI+dgy lh/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lbV+3zun; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w32-20020a634760000000b00585999a38a6si2561241pgk.793.2024.01.18.21.13.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 21:13:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lbV+3zun; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30767-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30767-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A1896283542 for ; Fri, 19 Jan 2024 05:13:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E8B54A0C; Fri, 19 Jan 2024 05:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lbV+3zun" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65F184691 for ; Fri, 19 Jan 2024 05:13:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705641203; cv=none; b=bVH2T0UahnHKpcnjBa/U4vsu5Jy+cVvQwEkUuMmsfhfekfcTlWoIjw+vPY1Mb3KKzkvUTq0/JCF09NU6GtcC0NrG/DM8UVjxh0ZEfqFUP0lTYN7FuG2EgEDK4fXDRKWmbe5EYQpfOlyORc72TyigKP5FzXGoai96gk/6BjARFx8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705641203; c=relaxed/simple; bh=Ne6s30tyKXga+DbCWN5zpt/HH+395I1ynKLHxGT4RsQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Content-Type; b=Sl7rtJuEgE7JBXTpYLHfr6hER3+758Hc4hjT0zZT+XLETqN8cxRrCK2ZJw52SZugWtBT2GRwTuzh/F2eGnoaS3nQqByD0KJu3pN4mrF+RvW+smq19gv8YRGsplYv4OlJfhhQGwQmtCgMaPjU8ZDIu/PDOLVczKxNnITfxGUPv6s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lbV+3zun; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7F41C43609 for ; Fri, 19 Jan 2024 05:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705641202; bh=Ne6s30tyKXga+DbCWN5zpt/HH+395I1ynKLHxGT4RsQ=; h=References:In-Reply-To:From:Date:Subject:To:From; b=lbV+3zunRyYYnwhJj5srk2lhNvfqikcWIHF4w1ZuWXbq+wqCBaFZVLEhYT/3sa2kr 6xw3jg60ateipQEDDLhsS2NT8Hs+mBIcWs7rbE8+YyUFrw+jhJgA/fy7mf9kUGjlQi p3aCOc3tnSZuAmoObxXCEjzmlYJ8ZcsLWZ0KwSmiyw77Dbe6Qx9bOPW3xiJEdNp5xV lNPtZkEprRA5O/pwqfsby5/+vHL8SJeSjcT6gmdRZxOnYWgZRNH/wUBlYAYOhrUxLH q2/GFYzFN3Ub2KBbRQZtZM5D+MGvAVzr2jVDK2tCgPTW54eJVUK41JRwKm5TbZFyuo lvf2I8FoVnLFQ== Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2902b142211so346023a91.3 for ; Thu, 18 Jan 2024 21:13:22 -0800 (PST) X-Gm-Message-State: AOJu0YxHXge2t/cwzcxsYWARx7j/tDvl1/qDLM+C399K+8A/aovG5aNv 7U0+bR9XbPGxNrzmVo7lIYmwwi3tBNey+seiL8t0DLi4MhrjIC+A/6De5BAuL1z+HWIbnP6mH3P iZYO7hQEgazI3E2qoryAasUzU9Qyd97kpK1xU X-Received: by 2002:a17:90a:c305:b0:28f:fc44:f61e with SMTP id g5-20020a17090ac30500b0028ffc44f61emr1597466pjt.60.1705641202088; Thu, 18 Jan 2024 21:13:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240117-zswap-xarray-v1-0-6daa86c08fae@kernel.org> <20240118180959.gwqphdgmf7r5sdne@revolver> In-Reply-To: <20240118180959.gwqphdgmf7r5sdne@revolver> From: Chris Li Date: Thu, 18 Jan 2024 21:13:10 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/2] RFC: zswap tree use xarray instead of RB tree To: "Liam R. Howlett" , Christopher Li , Yosry Ahmed , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?V2VpIFh177+8?= , Yu Zhao , Greg Thelen , Chun-Tse Shao , =?UTF-8?Q?Suren_Baghdasaryan=EF=BF=BC?= , Brain Geffon , Minchan Kim , Michal Hocko , Mel Gorman , Huang Ying , Nhat Pham , Johannes Weiner , Kairui Song , Zhongkun He , Kemeng Shi , Barry Song , "Matthew Wilcox (Oracle)" , Joel Fernandes , Chengming Zhou Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 18, 2024 at 11:00=E2=80=AFAM Liam R. Howlett wrote: > > > > > > > > > > > The first patch adds the xarray alongside the RB tree. > > > > There is some debug check asserting the xarray agrees with > > > > the RB tree results. > > > > > > > > The second patch removes the zwap RB tree. > > > > > > The breakdown looks like something that would be a development step, > > > but for patch submission I think it makes more sense to have a single > > > patch replacing the rbtree with an xarray. > > > > I think it makes the review easier. The code adding and removing does > > not have much overlap. Combining it to a single patch does not save > > patch size. Having the assert check would be useful for some bisecting > > to narrow down which step causing the problem. I am fine with squash > > it to one patch as well. > > I had thought similar when I replaced the rbtree with the maple tree in > the VMA space. That conversion was more involved and I wanted to detect > if there was ever any difference, and where I had made the error in the > multiple patch conversion. > > This became rather painful once an issue was found, as then anyone > bisecting other issues could hit this difference and either blamed the > commit pointing at the BUG_ON() or gave up (I don't blame them for > giving up, I would). With only two commits, it may be easier for people > to see a fixed tag pointing to the same commit that bisect found (if > they check), but it proved an issue with my multiple patch conversion. Thanks for sharing your experience. That debug assert did help me catch issues on my own internal version after rebasing to the latest mm tree. If the user can't do the bisect, then I agree we don't need to assert in the official version. I can always bisect on my one internal version. > > You may not experience this issue with the users of the zswap, but I > plan to avoid doing this again in the future. At least a WARN_ON_ONCE() > and a comment might help? Sure, I might just merge the two patches. Don't have the BUG_ON() any more. Chris