Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp903768rdb; Tue, 23 Jan 2024 20:51:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHNG/vwcEPbz47Xn+BupN+7box3G4plc9Pq6Ak70fliRz1gSbmJ1f3A4MKFC00ynZN1pFU X-Received: by 2002:a05:600c:3d08:b0:40e:585a:c12f with SMTP id bh8-20020a05600c3d0800b0040e585ac12fmr758294wmb.43.1706071919675; Tue, 23 Jan 2024 20:51:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706071919; cv=pass; d=google.com; s=arc-20160816; b=jg5gS8jUte0glVH6DcZOSuttqrQq5mF935pziXfvuQsunA0n270poVqY+RSHr6QU1U TzB2LBfUFLAUueqU3KmHTyjHuL9uBEueRheYd8ZoqLx4iZI0pqA3zyw2HMa0FLq73SOc BOlmlR0UsjsCMuHby1u7w5EhtxwL7fmbowoXAL7FUjO6jydOh18v5fuS4pSFPWQdbAAA lA732aP+R1Sh3iAkCgWCg4+dpABmumZ8fRK2+ImKsr4PvEd7qONe6IGRghN6Bsc590hp uf+DZbuaW9xaBN4GCeFyrgphVMr8cEdJ1p9WZEG1Rv3bvKdn0vLAnnd3V3Me7nc0ircj /wUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:from:subject:message-id:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:dkim-signature; bh=TID2fOsjU/jpHwDMlLW9FAqgk4WlE0mPeuj0sjEkApw=; fh=2fp47O5heT9ZSY23GxUI23pZ77ANaQPj9zY0xLvYULg=; b=sCyRt5rbdy0eAsAbVydoJzcid/4U+K8wASMfoYQ+Rk7wRgLVo9xX9jTSdhRn1i95Y+ Qn2v+Vcyfd++c9Y/G09DdONORLRi28OqzCu7NXF1J3SKPergIhQy29fUf+FKk9smjf4W 2DW8TjL/xM35nJ5Z8PEElrFF64LMx6G2rEeubR5rG+6QmPhAIdiMJpfJZfCTYrbgea7U oxv3TIpd+0hdb3P3YTQotnHYYTdapAlVXECnjR+ZXLFsrv87zM3hp6f3AeGJ7Lqdf0MN ZBDncF4wOt1BHiPhCb/nLY/iAp+E9hXD4xjQLI0TZVtLaTRjFpD/9BQDXv9sGRVG5jnG wDzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="OzxvyZg/"; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-36437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36437-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w1-20020a1709062f8100b00a2a73607836si11904608eji.1026.2024.01.23.20.51.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 20:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="OzxvyZg/"; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-36437-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36437-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AD0381F2733C for ; Wed, 24 Jan 2024 04:51:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F11CBC8D2; Wed, 24 Jan 2024 04:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OzxvyZg/" Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (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 BA5A0C2C7 for ; Wed, 24 Jan 2024 04:51:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706071878; cv=none; b=kE06mtymuoIfpHKu7ed1qoiyaV/6VTTfo4gmZesn77/z8W5TezjHQe1IZKI9+tN/FFFBkqriYojBbLGtKY93gT+fE9E5WlxqFK7UIbu1Kk/gB1mtiaPvRl+65Vo0hchiD1EsC1Telmk+q5ASqpDev0EGgjzSLcGpqrC5LqS2uD4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706071878; c=relaxed/simple; bh=ie+we1nj+mw7e9ONK+IgxcW9mHL0I0DPXCgErXIomSA=; h=Date:Mime-Version:Message-ID:Subject:From:To:Cc:Content-Type; b=NBG653NEP7hFwA5Mvk6yItW9RLbn32jGrecDJn9vJP5oXRfsNj9uXM7m5erbH/bDm4jxwYa3BW23caDtNsQPmY0fqhMeW78IdVSFeyzwRdKC5+e+n9IBCvjhniind4Es7ENNq9plmCYXDSi2eyPhvbUPLgvPm+U1wl4KCnANdQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=OzxvyZg/; arc=none smtp.client-ip=209.85.219.201 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=flex--yosryahmed.bounces.google.com Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc60902da2cso481639276.3 for ; Tue, 23 Jan 2024 20:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706071875; x=1706676675; darn=vger.kernel.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=TID2fOsjU/jpHwDMlLW9FAqgk4WlE0mPeuj0sjEkApw=; b=OzxvyZg/Ika2zgqCROsW02XTv9ThAlwtL4ept2K/kvOkomx6fhm68rsrTY6gaHjuB1 /joVwN7/zLJwjxMrNV4n7YdCzIracRkKQcymSfs7mqansyzH50ZMpspanLveoB+Eez2c cJ4nYleeo8/+W9yFUv5we9Rwju88DMeH9xwv33Q/u03yzMj4WkvQUUD6jRZY1Q6RswNU Vw5pQm7rz1JoPpVP7im3DNVNRWtXfYzjqIrIkp/OSVXVoBoi2ceWaIMmDwIkwOsAMgJ1 tSVi3Ahr/rz722WjAOvq2VVYsAW+2jsUoOQRUWTUWDiwRNlInw+8u0WIuVqGtSKde+7P V/zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706071875; x=1706676675; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TID2fOsjU/jpHwDMlLW9FAqgk4WlE0mPeuj0sjEkApw=; b=O06X1qgnNcFdvkYXWyQH4DHF2jl7qmxj58TEScLGhagprTORjbTRo2epqTtN9b+L7z CaEDDllqTbql58CaEH8VN8KPYvHNMZzgvQq3cDxy90kuSv+1Y4AEEgvOMOkrCr7ZOzv8 LanqWKyVGZQvvHWW7g4iguXuQgn76Jc2eyt6TeZ3TVtaZRl+Z5eAMHAjzXrhiK+Y3X3k LJdmsDCFxNz1+UDuh88BfUeGbjvS8FkWCZlEfkK5mh6KnibkYscslmpsSEgeVVn/8oS2 sjygq87pYupl7OwHiOhyYx4f0wBAxFks8HoYKcQ8AVSviz8ZoJ4bx8lW2e2610mzB/Wh Olyw== X-Gm-Message-State: AOJu0Yz2ESUYWt7j50iXbGRIU4Po/cJRrVxTpM4Qr8K0YqhLWw90JhS5 KQX+qTgTIiLsQ1qHmP1TbV8wqT9BquOtK9rqBWZnGHrMir1brVc4p/5MLMHoxyvyvzlcQ/0ZDmV Rt/apwnvUPfRy2PNMZA== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:6902:a8f:b0:dc2:5237:81c7 with SMTP id cd15-20020a0569020a8f00b00dc2523781c7mr151808ybb.3.1706071875767; Tue, 23 Jan 2024 20:51:15 -0800 (PST) Date: Wed, 24 Jan 2024 04:51:10 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240124045113.415378-1-yosryahmed@google.com> Subject: [PATCH v2 0/2] mm: zswap: simplify zswap_swapoff() From: Yosry Ahmed To: Andrew Morton Cc: Johannes Weiner , Nhat Pham , Chris Li , Chengming Zhou , Huang Ying , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yosry Ahmed Content-Type: text/plain; charset="UTF-8" These patches aim to simplify zswap_swapoff() by removing the unnecessary trees cleanup code. Patch 1 makes sure that the order of operations during swapoff is enforced correctly, making sure the simplification in patch 2 is correct in a future-proof manner. This is based on mm-unstable and v2 of the "mm/zswap: optimize the scalability of zswap rb-tree" series [1]. [1]https://lore.kernel.org/lkml/20240117-b4-zswap-lock-optimize-v2-0-b5cc55479090@bytedance.com/ Yosry Ahmed (2): mm: swap: enforce updating inuse_pages at the end of swap_range_free() mm: zswap: remove unnecessary trees cleanups in zswap_swapoff() mm/swapfile.c | 18 +++++++++++++++--- mm/zswap.c | 16 +++------------- 2 files changed, 18 insertions(+), 16 deletions(-) -- 2.43.0.429.g432eaa2c6b-goog