Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp22950rdb; Wed, 17 Jan 2024 15:48:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQ946DOwTEE+toiwWNHyD0LLVuDsRDNgTv37cfTfOEN8g8VR6G9Wh92v+UEtWRK/wBYvx1 X-Received: by 2002:a05:6a00:92a9:b0:6d3:ab53:367 with SMTP id jw41-20020a056a0092a900b006d3ab530367mr92122pfb.33.1705535313128; Wed, 17 Jan 2024 15:48:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705535313; cv=pass; d=google.com; s=arc-20160816; b=0MmQSJiQFNjSRzlbFNg4aL7iZbjT0QpWv4ZmvZ4VFlKFeGqkxTXgQxSP9MjEsu24mb Vx+AJ/QJhJpGfjaP77ms7nTGLHd9gVR6URBlvovYNyl28bBnk7mTJP2NUpyguCY0itbw RGfyv/HmocSUI6xd0iByVr7dxNdQLW2uKHu7Q+ukmGazTT9zxtSjA2GGIItWUobRR82o YOXWhWp3Mq+5GX8ye3dOnRlVWaTfotnHawxDmY6JY6b6rb3jEGjxcNB4QikgvN4d5DnJ bsMYEUPKCBtK4+F/R45OHS+Ql3mgJEw/nzvdOxIPycXoc7Jfogpn7f9fe78e7hSEOKc6 Pxuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=VCBKt8IzuP6x9scNJoSJcUgrz4a37akazxYAWOrz96o=; fh=z42tYhmEVyKbvVCoIn1ah1Gr9cnGWJFdg9VEk4s9rHY=; b=WRZ/QMR068JyZ0fzfN9gFFhWNzLTj7aRpbDB9F6LKLyQxsTdU7d9EYaOBnMJ99bCQE rQZIJFhxeOFnLolipLPSGGcq7GrnuqwgpCgxO8g7ZVkpe09LydFN8/qcccceWO6tf042 x7BqjOXYLDhU9fqN7G8gbjkT2PhDVyJNmp4a5KwFuRHnOI7S9UghIzpPvds9yqAz1p/S BI1Ob+/mX8e47HxuCcntSQxwnpdiVo+m3TOeL3Fg3bNCWgoN+S6o553LK/MH40xwtZPH SICcb4XF5j2uCJ/pQMyythQA0Jo9OENxjsL8Jx/QeGxtP7cgyNwAHWD1H1MA+Edkwhqr oIow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uxw1g9MW; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-29557-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id k9-20020aa788c9000000b006d99f3bc0f4si2817887pff.248.2024.01.17.15.48.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 15:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29557-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=uxw1g9MW; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-29557-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 C5BE5287074 for ; Wed, 17 Jan 2024 23:48:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DB3D286AC; Wed, 17 Jan 2024 23:48:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="uxw1g9MW" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDD761C11 for ; Wed, 17 Jan 2024 23:48:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705535305; cv=none; b=gwo7+FzEuSd+gSiLhtAcclbGbmPm0dWmHAa3tqCDb2k0hXkqKnVTfTv7pv84r+V8nSKKFO9hEOssgDOfcmMyMfo9axVP9cGGyyN/R6EihoQqlfJU6jfCcMVrhdGXRUYHA2g1ojdZspQwCUJTgeYddDi5/CXwE6TfDDJI+VDhyjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705535305; c=relaxed/simple; bh=o/7Dr1KrXaPTWwgbqvtbLp3agio8da0eexlUCdi+K7w=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version: References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc: Content-Type; b=K67wcOSuGLS9JeRGyoF4MlOiwkegUL2xUAFLIya2Lfpcq6rEkjt4eLkGFSUMesi/5BITtpTCye690671qWHqOBhMAXsh/uUSI+f1w0xaUc14L0+Rpg5VzqH1s4J9uAj0wAqcwpIlHgOJ/S/yB4JBV4r2svd8qw7os0IUCTbsAcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=uxw1g9MW; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a28ab7ae504so1095296366b.3 for ; Wed, 17 Jan 2024 15:48:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705535302; x=1706140102; 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=VCBKt8IzuP6x9scNJoSJcUgrz4a37akazxYAWOrz96o=; b=uxw1g9MWVUCcPP0CpYrws6CY7oOjlfiM6QFyWfqMSDv4QC6WiiJZaGtlPeDLCj2jVr +XByPsD35RogMr4H4//gs2uhKeNok2DjlFtjEyuNe2zB7IoLC/UzbSO1R3tsgW8dp0+9 GAglm6oefXT7Eae0pqGc2juEb4YMxvPhjbZkzM4NQKyDa+whVmf2IQ+3Q0K/+sVFivFb Yqftu15VetQJuRZkmDzdlLmQc8mZCO5M1nJ2JcnjwHZNerLayvg6l+LWUiC1z3ZLpE0U /1xKaln4a8i9ln6Tr2gOBZIQT+MfefdT3OCUlIEMF2D+OIZuFnlvNWPIAg4y0v7rrUiE 4xUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705535302; x=1706140102; 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=VCBKt8IzuP6x9scNJoSJcUgrz4a37akazxYAWOrz96o=; b=mh6YHBtZTAHAUnop4GjuF4CwQh7PuTZ9pxunXsY0lgE5n0eviDs5H5Grpj+ceiTmr8 ZRXDyGQTbw0Y4Gj06h7YmNu4oljMJ87/rUa3360Bri1jAm844nHsqeaRPpvvvg2cFiSI 7MOoTBc/0Ek+eq1HsyfSt0q/vYEzrPdXAubEjFJOgZv4xDtP+BBIK7sfDoLRF/gATK0p RZbRRmjtzitNmk3B+f6MuypszzeQRLy3P+vu1281QAF2Zwbk8/qHL0ezHzKs/aiypRS6 7/GsBgK3eKj93KqBFHyejGoKX/PDA1/pKzGGl8eyqXctTyU+a8Q6ukfNmyg4bFMktceJ tOdQ== X-Gm-Message-State: AOJu0YxxDrXu8NH92fSypAAA5NlyDkmn0BoJQtM/SWlAOGt/wWJPtpFi USNM8F3cLAS5s1Ma850nd4S6VkaQKfnY+/NUgPdOMCFMpip+ X-Received: by 2002:a17:906:60cb:b0:a26:ee83:8841 with SMTP id f11-20020a17090660cb00b00a26ee838841mr4895563ejk.33.1705535301782; Wed, 17 Jan 2024 15:48:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240117-b4-zswap-lock-optimize-v1-0-23f6effe5775@bytedance.com> In-Reply-To: From: Yosry Ahmed Date: Wed, 17 Jan 2024 15:47:45 -0800 Message-ID: Subject: Re: [PATCH 0/2] mm/zswap: optimize the scalability of zswap rb-tree To: Chris Li Cc: Chengming Zhou , Andrew Morton , linux-kernel@vger.kernel.org, Johannes Weiner , linux-mm@kvack.org, Nhat Pham Content-Type: text/plain; charset="UTF-8" > Currently the xarray patch should have everything it takes to use RCU > read lock. However taking out the tree spinlock is more work than > previously. If we are going to remove the tree spinlock, I think we > should revert back to doing a zswap tree lookup and return the zswap > entry with reference increased. The tree mapping can still decouple > from the zswap entry reference count drop to zero. Anyway, my V1 of > the xarray patch will not include removing the tree spinlock. Interesting. What do you mean by removing the tree spinlock? My assumption was that the xarray reduces lock contention because we do not need a lock to do lookups, but we still need the lock otherwise. Did you have something in mind to completely remove the tree lock? > > > The reason why I think we should wait for the xarray patch(es) is > > there is a chance we may see less improvements from splitting the tree > > if it was an xarray. If we merge this series first, there is no way to > > know. > > > > Chris, do you intend to send the xarray patch(es) anytime soon? > > Thanks for the heads up. Let me send it out now. Awesome, thanks! I assume Chengming can test whether this series provides the same benefits with the xarray.