From patchwork Sat Jan 20 02:40:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yosry Ahmed X-Patchwork-Id: 13524319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5C01C4725D for ; Sat, 20 Jan 2024 02:40:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 381736B0074; Fri, 19 Jan 2024 21:40:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 30A0E6B0078; Fri, 19 Jan 2024 21:40:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1AA716B007B; Fri, 19 Jan 2024 21:40:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 06AF96B0074 for ; Fri, 19 Jan 2024 21:40:14 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B27031401BC for ; Sat, 20 Jan 2024 02:40:12 +0000 (UTC) X-FDA: 81698135064.27.F9FA801 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) by imf16.hostedemail.com (Postfix) with ESMTP id 12DB3180008 for ; Sat, 20 Jan 2024 02:40:10 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Eysb5vhm; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of 3ijKrZQoKCM8J9DCJv27zy19916z.x97638FI-775Gvx5.9C1@flex--yosryahmed.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3ijKrZQoKCM8J9DCJv27zy19916z.x97638FI-775Gvx5.9C1@flex--yosryahmed.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705718411; a=rsa-sha256; cv=none; b=2RLTBBW2pR/rFBima1Mg/fy84NSk8IpS+Xx28W5jpXxQqmIzapTLYqRO0fhtAnQgU7/Jqk eeOoV5owLCnAtEHI3/bJkJ3bpJ3vw+jcWysp6GjjXaqVH8pziCIq95QutdVhiww/KPM6fU YRZeOiswntScEe/fJFgA6Kj4ILmszBo= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=Eysb5vhm; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf16.hostedemail.com: domain of 3ijKrZQoKCM8J9DCJv27zy19916z.x97638FI-775Gvx5.9C1@flex--yosryahmed.bounces.google.com designates 209.85.219.201 as permitted sender) smtp.mailfrom=3ijKrZQoKCM8J9DCJv27zy19916z.x97638FI-775Gvx5.9C1@flex--yosryahmed.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705718411; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=nM+uM5keP1vVbVBzlI6j6cI4oG9iDGk+mwAqUBofyJA=; b=w0CRHMn8ItYgkEFVbYTrLmlcGAuMylHTbQyiEEK129gyPg5wgrMBNUJNWqMI/OYazSKBOI W3beQ0S5OXOh0PG2dHs3qEPOrQoW2cjjq70WbxAA2V40+j82upqmcGjAdNfafadzjxnLmm VFkRHZZ2nTVpu1p+gwZxPYeBcx4bSQk= Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-dc24eb17be6so2467671276.1 for ; Fri, 19 Jan 2024 18:40:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705718410; x=1706323210; darn=kvack.org; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=nM+uM5keP1vVbVBzlI6j6cI4oG9iDGk+mwAqUBofyJA=; b=Eysb5vhmJMD2mh1zl8H0CyUyU8N+1BKo61SnxEtHyr2vnePojPWx9LASm5FnrPeGTS J12O6zsLhsJwipzMmNQLGfq3ciLc3KNmR0J1LiO9cO5u//8wRO3zljpEIlNY1VzEI3t9 MVp8U4KPM5gXWx8+4bd74l+fYXYH0Cs8LaICba7QbMDSUiCAxTz+mFcc4BoU8MaDJatY oEbK4cJmb3ud+9nT3OlRP4abe9xaGe/EzLLtrGxWIg2bnumS43by1mHcQCGbqtjyGneK kBrrswtf9CCFhuOvmcRVECdOBzzdtK7bnWFN0fRAwRzWXu14bNlfuh4//W59eYpJTDeb 0i+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705718410; x=1706323210; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nM+uM5keP1vVbVBzlI6j6cI4oG9iDGk+mwAqUBofyJA=; b=lBdRiIFDqgZENq7oXk0tjCyty81DkOxmsokYRn1oXJcUKpK4ewbZRZw/EbSyRkUlBP 5otcaxqVsWFCDrT3gwovwZAtonn4sqFLWtHZlq7vYjGtFCp6eI9rdpy9TavJmnwLCnne 2ZW7fkJdh3KC/c/19w6YVcqNWhuoFEddMfkqU+nTjeLRSxActqu9rM64Og8JCE00g1ff Kod3zEfy/5PrC1pyNdeqLuCOFC5zNz7bKZF9Ddc7EuDl7BUZvhpewKQOgJ0rodscUBhI v/3cSTviFyiNtsZbtBDMUccdOKLcozzTMXuI1fOnozZQR2t8vY63QVdSTPacMKI3gElH tUwA== X-Gm-Message-State: AOJu0Yy+PEuxaALahpT6GrN7W1hHqYH7riI57kKX+VaZp3Hd5fHmTy/q LlP2iC20lk4qni0Ehi1VY3onqhHBcJUHH2l8YIE4NTIKa0ri2cPxcc9VQWVo0KMOmohF7PTFZ1a gHibglrkgFTSnFn51Ag== X-Google-Smtp-Source: AGHT+IGzNqMl3DhRutX1zvjmGkt2LuQmWmEVi4658k8bSyLNrERdkq6ZmeK5EEpUZV+0XOc07nXSEFyjXLHNexLS X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a05:6902:86:b0:dbe:a214:888c with SMTP id h6-20020a056902008600b00dbea214888cmr423251ybs.11.1705718410258; Fri, 19 Jan 2024 18:40:10 -0800 (PST) Date: Sat, 20 Jan 2024 02:40:05 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog Message-ID: <20240120024007.2850671-1-yosryahmed@google.com> Subject: [PATCH 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 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 12DB3180008 X-Stat-Signature: i6ueff46ja9ci4zmubkm4yuh9bm6wtbr X-HE-Tag: 1705718410-734300 X-HE-Meta: U2FsdGVkX18TMFmaaeBMXqCiVP4btGwMZvYjIb40gch2MBhT1qwasIrm4vv+XnDtDxTMJZpuK19qHkN96uKFCRyOuGJUy7wplARnlhIvBSSk81ts1nq38yvsJ9VidzglQEqS5RXhYSpJgVgb3lfQCzUw3FRSa7e3TYjeU8SX5n8Knx4YxTubN0Q+YDDXuPkSYVRO+NrZIZBq+go3GHWps1HxWr/XkcbrzK/hZn1JJLk5vTn8k1Ba7LnSouVQyar2+JSlsHtOIBd9tpWWnbzopIKIYEsfRNQzHDyjEWjq2RFhN1O3ZUVNZNN43JnKDNyyvPcnXsbs31FsQ7dw+aboBQtchkVeJkBTII480bW9uSm78QTvPHU9HeTvhBAAQH1E2JdpA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qVcsu5yVo6/WZoB79/WN5qGQSsYG5t/woot63n70G0iGibszUliqi3fQ7IbIIF/21QRbzde3PGxcRDt74exBmegIHRi3PhfdLK/PYOARFZALVuO8SRGbyW/aWez6WpOim/D3s6l+lIq0GG3H1/lHCveDy3rgBp7UZBTslQwTUOyZ58R+6yKX1yIBZwPySWePM7HoEfNU0p9snCNnUbV45DP X-Bogosity: Ham, tests=bogofilter, spamicity=0.012555, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This mini-series simplifies aims to zswap_swapoff(), which should simplify in progress work touching it (zswap tree split, rbtree to xarray conversion). Patch 1 is a code readability change in the core swap code that makes patch 2 (the actual simplification) more obviously correct. Yosry Ahmed (2): mm: swap: update inuse_pages after all cleanups are done mm: zswap: remove unnecessary tree cleanups in zswap_swapoff() mm/swapfile.c | 4 ++-- mm/zswap.c | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-)