Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp320745rdb; Thu, 25 Jan 2024 17:12:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IESwpCObYvUdlrCyCxTTjnEpTd9zqF9j7pDuJf3O1HtWNwjMgL2M7oUxfR/NmPMD2hD40Tz X-Received: by 2002:a05:6a00:3cd1:b0:6d9:b075:a7d6 with SMTP id ln17-20020a056a003cd100b006d9b075a7d6mr779604pfb.19.1706231550877; Thu, 25 Jan 2024 17:12:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706231550; cv=pass; d=google.com; s=arc-20160816; b=LLmvpUZwv7MeCqv+KbwUYepPOGjapIr1UQzH3w4N2VuZR37IuPPKkykOjF7KU9u/hA EtJZ7cnEkE00mhupldPGtR54C67bHZUE0WKevQechSj1svkNf7mdDQPFyDw+91sgLm8i u+bdnZeviuH2INAZWnzoPDn9Js3sLbZnnOo4duyKJtHwgag2BFAc06eqHQLeiRj9/aOe VdY2nEmy2RnRkpfdgK/Lk2KTwIuh5oE7xOzhJAwJUldWLr/ZUKDfn3oxp1eANZKOAA77 4l5r+QUmfa4AW+5agjEUfpQhY/2xJTK61c7Q26qWTlR9sy3rYdSVoY30b3Ja4iRrcOKw 8jcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=+9liw3MIg51z1w1+FLNp7TW4WBhCye0p1bQDb5wxCAc=; fh=n4+nbnOCx49ee6IrLpGvXrS0on2L2bs2uSWBh7R2urc=; b=QBHX2jnaOaV1x8f3mgCMgqVyz9Wk/C3RCPqSavYZM4NDwoN41r38+vT8XS2nby+ELf 5lEpjQ+dNB7KEK5I3i+BM2hVFtFkzxOas0XlgnPXWzCRxL3dKAPmWyy2bgPuFdf2BXxL YvDpT2aa2DrWeeCBixrF331/OQ5aCQ9+N68j8e7Li+ck7Qc5Q03i3c1IhCkSkn46XP+9 NNfoM2BdnJZLDnT0QgAYNaGbm86jRkbhYnw+++sQ9uPUaTD48sk5pVBB3dL669oJJMqh jq2GxJAeZpuM6cyBwOERx6Y2+gJSu8H+foSAZwefnaw8Sb14n8YjvhiaraP1DPvSPu4v 5kHg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nV8roOhE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39483-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id ca27-20020a056a02069b00b005ce06e0e354si197680pgb.138.2024.01.25.17.12.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 17:12:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nV8roOhE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-39483-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39483-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 755A2B24A2D for ; Fri, 26 Jan 2024 01:10:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A068DEC3; Fri, 26 Jan 2024 01:09:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nV8roOhE" 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 CABAB387 for ; Fri, 26 Jan 2024 01:09:55 +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=1706231395; cv=none; b=fH+zRVcuDv6J6HRrJHwufIm47aTTF/eSAYmUx4mpA6lxfhPQh7NVNH77hYY8dhfHqorWf6O+v/PjnT5/wfeO0j4zShYYd5o3CmdV1HtEkQ4UkLNimm6DvPKKKHXnBh50Fk5+VxhmruABZqAEp5OfTr/EiYWAEzKJ3w4rNzXbpbU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706231395; c=relaxed/simple; bh=+9liw3MIg51z1w1+FLNp7TW4WBhCye0p1bQDb5wxCAc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=lQ3xiAovJe8s/YA8pqm8ji5Op7OB5pUQo2oRR/Qz7zFX7D29pzUsSPvUXrdI5tlhTqLiAOlAq4Z4zLNIbxvGLGY+tzCZY0pWo3n+mBMQLw2abzN1PJj3yv73r7RPiJfQeXE81FXCyGTURfTC0G0tz4+0HPgwYFxkMn1L0ZD93/o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nV8roOhE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61011C43399 for ; Fri, 26 Jan 2024 01:09:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706231395; bh=+9liw3MIg51z1w1+FLNp7TW4WBhCye0p1bQDb5wxCAc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nV8roOhEKCzd0klA0IZP9b6yC8z0UOgjK1pql6YB7FfazfpFKMzc+ZEjD3UQA9YxN wvXAGypAVDyL/NPt9gnkhtW5OFTB323fmBOXep+mU/wo0ZHonXyivYrGJcvFFuTqV7 asGB7elZGV9f+v1WXmlnpJ57JWSX5WMN5a+vSlwStQFtFHsrwt8KCd2FWWr13SRgbj +7jQd6pWuGFqkx/WAQ9uJS9veNfxvM+XvmWBwlMbROJekzxbomxb4jNO2QlN6k176r FJZQKBmr3LVrikdVF9j2YsyGXy0rFTl3QyL138Q9xMBWNladqC5YJwniwRs73wxaiP pcNLKEJrO7bIw== Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d746ce7d13so25035ad.0 for ; Thu, 25 Jan 2024 17:09:55 -0800 (PST) X-Gm-Message-State: AOJu0YyNVww6/2hDrYRjVRg+Xl3MhRJGCVb0J3tTGjjibyEv3uhrhjne BEIXQbBj3L5xQ/cOoCUjvXnuA9EGSRyk1BV11zE1bbaCrKqxZwgFEkpoM6g9EQs3OWdnutpdT9P DizbbLky2lUH+2Kl1OjiPxmG3wZRvijaSHB9X X-Received: by 2002:a17:903:1108:b0:1d4:d5bb:5d7c with SMTP id n8-20020a170903110800b001d4d5bb5d7cmr695292plh.110.1706231394824; Thu, 25 Jan 2024 17:09:54 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240120024007.2850671-1-yosryahmed@google.com> <20240120024007.2850671-3-yosryahmed@google.com> <20240122201906.GA1567330@cmpxchg.org> <20240123153851.GA1745986@cmpxchg.org> <20240123201234.GC1745986@cmpxchg.org> In-Reply-To: From: Chris Li Date: Thu, 25 Jan 2024 17:09:43 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] mm: zswap: remove unnecessary tree cleanups in zswap_swapoff() To: Yosry Ahmed Cc: Johannes Weiner , Andrew Morton , Nhat Pham , Chengming Zhou , Huang Ying , linux-mm@kvack.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Yosry, On Thu, Jan 25, 2024 at 2:34=E2=80=AFPM Yosry Ahmed = wrote: > > > > problem is that after the entry is isolated from the zswap LRU, we > > > need to grab the tree lock to make sure it's still there and get a > > > ref, and just trying to lock the tree may be a UAF if we race with > > > swapoff. > > > > I feel it is very wrong to have the tree freed while having > > outstanding entry allocationed from the tree pending. > > I would want to avoid that situation if possible. > > This should be the case with Chengming's solution. Thanks for confirming. Looking forward to Chenming's patch. Chris