Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1216844rdb; Fri, 19 Jan 2024 11:41:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IERHD+uLEf/7y/d78weiaaxDa9QxT0SZqOO6ZW2rYvMvXG7qGBJl5RAXLgKJPW3U8cWLZTZ X-Received: by 2002:a17:90b:4c81:b0:28f:9294:b8b with SMTP id my1-20020a17090b4c8100b0028f92940b8bmr277191pjb.15.1705693307514; Fri, 19 Jan 2024 11:41:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705693307; cv=pass; d=google.com; s=arc-20160816; b=ohEjvtCPzJF9C4qR7kt4TW0QjH6CC26+3X5LzRsoZ2vtPNe+kALos1Waw4XS62fJ+a hHcJRuJAtptmgYXkYMphyvPzsWCKX6KmU1MzdCDOAHYo5LVVcvxMWZi2gd7wzjT/jyHf JVVIQaG23OhIipmQrs8jyaAPNY6DBqj66iMyNILDrNEbb+DsR4yCb5x/DtNAI10JdCB6 SUli3XdBTjT8bTd8Q8sbWi21Dn8WRzKJF9RoWvWO5bbLm95VSZ3DDoQa7nCyiAf0EXBJ DOumeqKDeQVjbfGCrz59lh0Xpm7IySmaDkdbMOfzLRDn/9vt5Q8ZTe6NXLV5RDLtVVaP 1DRg== 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=AGnn/MsX85yn8KUcF8f/JaW7Zm3qd9DTw9KnS3mXcVo=; fh=X6ryCwQ0Aal2Ve8IO+xkZ22uIPGtGnQM9Gfby62l8Cw=; b=oK4cAw1qyzevJhkTcc2dBIn8EM33NHIgzk9K5TDe7t9hhaN/Eyz99DvOi44r7D5Ykw o7Cfh9z0Q1lLhsdTL9YHsX9mQoo0Y/PF8nLJMKLXbCyt/jwQGrbvkk7agY6xYtE+ZnAA l+FQ4BgyFZZE7k6CCZHojPZZh1mlZvK1WRevgR8AcXIxvh/neCnH3AVWD0VcxFf+9Dlw weEH0WTQns298sNN3B2nZnFhA+rHNpfcl3jhgtHksuqwtyfFBUE3MdkFy8hKlfHq7/c1 DA2+HG7wBGnIPjia8WE4TTu4hlVeVWqgm6Ivel/PZuLWfPr66n9x4cP2TNxi1WVKcRYf v3kg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Gv5X+/1S"; 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-31523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31523-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v22-20020a17090a521600b0028beed57779si3785492pjh.123.2024.01.19.11.41.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 11:41:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="Gv5X+/1S"; 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-31523-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31523-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CA5DAB237DD for ; Fri, 19 Jan 2024 19:39:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFC0B5821B; Fri, 19 Jan 2024 19:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Gv5X+/1S" Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 80E5A58210 for ; Fri, 19 Jan 2024 19:38:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705693104; cv=none; b=hfdSsaJklEMasoVBBjN8kxr+7FtQPt2Ggvx4Lp6N+WFBMWBFo11wyJ+lboIcVPHo27hHDQjjaIkoAo4O8XMaiuiSwFLLa5zrjwQZoTRzDuzSjZY2gVFZMoYoQvS7AStmVHdkiPZuuCDCgoeWiXbEdIbpZmQLbpZKNlkpSEKgLPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705693104; c=relaxed/simple; bh=AGnn/MsX85yn8KUcF8f/JaW7Zm3qd9DTw9KnS3mXcVo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=BO5EhITBCZtwzA01yCG95cM8COi5pZ208kWDoHjWtdzuPunoJlIYEYD4VjVZpvdZIUqxnqbD9hzdHD+NClEfU5dPcw5GQNLPeI9YJ+ONCOotYG2ZSLK9hhCH5NkPJ0MbIeOEG2GhM8AKNxpTofy6OrrM1lj74VsfQxvs2AVbLl0= 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=Gv5X+/1S; arc=none smtp.client-ip=209.85.218.43 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-f43.google.com with SMTP id a640c23a62f3a-a28cc85e6b5so135588266b.1 for ; Fri, 19 Jan 2024 11:38:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705693101; x=1706297901; 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=AGnn/MsX85yn8KUcF8f/JaW7Zm3qd9DTw9KnS3mXcVo=; b=Gv5X+/1SCaht7WLtwMvc4olGOns624sfGppM41XmrM4zxh0MucE6k+RicnqjR8FHvn yw3cqD38qYN2M63biOTIpNCLnKf99Y9jDJa3MbBT9oMjUAsmCxiypuRz/V4uU/YLFLpO zxPVUDCByAw79ER4b0CH7lFugZBIsNerqWd5SdvJOzDKI9QNRMl8BLxEr2PIG9B9wpms 7XPbXnK7H76fnzvqzREnNtd1r72IYBwn1cTfNF8CdXrBk5O7/ttMSVhomMIsf98kOffC m5M665vNGj6/IyvO/NAT1c5NvTR1UxS7iDGXwFNWApehh2K86MlYVpKwnVyW3aZDDiVC dK5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705693101; x=1706297901; 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=AGnn/MsX85yn8KUcF8f/JaW7Zm3qd9DTw9KnS3mXcVo=; b=AwIrGvjBYAqJEZkyiljBppY9OHgTQWxTpc3d/qaPq8EOSVKIzH+KA0+z92hNGblg3x g1uOsHHzI4yu+B0iJ58Pr9MAIT5ATvW0+ftTpi3Ju98URhFWG5RmrW4gvt1FyggAszAD HSQLqKuJhUrHSdsrPnZrlQnBH9N+wTi/NSvEUoddjRlXu5bJz0Onn9NV53/14Di/I1mQ oBt1tZ/JfyyiGq+pwaW7NNK9a9rORKGop3SbK39CX9uaAYbLxC2nN/q4Rubrd6df1hZh snYOul+nieMwwSqrjYufgwhq9eskJ963105NMySRkmTGS1nU4872eBDf35CFpnWuc+H6 BCvg== X-Gm-Message-State: AOJu0YyiQr2YllkLx0A8eHXjiix7CEwKWZ+FmjYeLkXqGZHndq8m34PR hOCKf06I5WSD6wTbEeCDsdIL10p9DKwGJS+SPBmKJz9EP3esLK4HCmijz+MQsuT3YNQU2Pq9lKl fSQyugFUCkBO/T9wr5tVy63qVoiWnYTi2UmHu8IvCSD4W7yHKwEUa X-Received: by 2002:a17:906:74f:b0:a2f:1588:d271 with SMTP id z15-20020a170906074f00b00a2f1588d271mr103336ejb.224.1705693100587; Fri, 19 Jan 2024 11:38:20 -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> <20240117-zswap-xarray-v1-2-6daa86c08fae@kernel.org> In-Reply-To: From: Yosry Ahmed Date: Fri, 19 Jan 2024 11:37:44 -0800 Message-ID: Subject: Re: [PATCH 2/2] mm: zswap.c: remove RB tree To: Chris Li Cc: 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)" , "Liam R. Howlett" , Joel Fernandes , Chengming Zhou Content-Type: text/plain; charset="UTF-8" > > If this is doable, I think we can return xa_store(..) and keep the > > logic in the caller. I think there's a chance > > zswap_{search/insert/erase} may end up being very thin wrappers around > > xa_{load/store/erase}, and we may be able to remove them completely. > > Let's see how it goes. > > > > See my other email about erasing an entry raced into a new entry. That > is the part I am not certain. > Anyway, when zswap adopte folio, then it might need to handle multi > entry, we will be back to using the XAS API. Handling large folios in zswap is a much larger topic that involves a lot more than this xa_* vs. xas_* apis dispute. Let's not worry about this for now.