From patchwork Mon Jun 10 14:30:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Usama Arif X-Patchwork-Id: 13692134 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 61B50C27C55 for ; Mon, 10 Jun 2024 14:31:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B9156B0083; Mon, 10 Jun 2024 10:31:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 667FC6B0085; Mon, 10 Jun 2024 10:31:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 52ED36B0088; Mon, 10 Jun 2024 10:31:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 34EBC6B0083 for ; Mon, 10 Jun 2024 10:31:24 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id C8590120FED for ; Mon, 10 Jun 2024 14:31:23 +0000 (UTC) X-FDA: 82215216846.20.51FFF95 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by imf30.hostedemail.com (Postfix) with ESMTP id C3FA480011 for ; Mon, 10 Jun 2024 14:31:21 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=U+v5qhUw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of usamaarif642@gmail.com designates 209.85.222.178 as permitted sender) smtp.mailfrom=usamaarif642@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718029881; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=vmkoYQdN2TcqhXW6bXeE/domfSCU9DERaxqlSrdPGI0=; b=5FjZy0TJlDBvDoeOD/qf4/8NHbaq6/knbO+CFlx8u0kGnPYZOxWy2eAujD26Zhvse4V+M7 UfRd0FIZC7JexaDju3WrDsZJdRnu1XyPOlQH7Jw2GWy98WW5clyA2SPTv+NGATAkbfo8YV v9rQyctzJCZv+O4LR0kq/9Xoh1w/BTc= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=U+v5qhUw; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf30.hostedemail.com: domain of usamaarif642@gmail.com designates 209.85.222.178 as permitted sender) smtp.mailfrom=usamaarif642@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718029881; a=rsa-sha256; cv=none; b=BJfv1tgaYDvJKQossUDK9dtz1pTKI0s+5J5K+wnFaV7/5nUPDehbptfX8z0ezY6yH4Eqa+ BXRc3Baalq0bO0QuPro6mhaFzuGykzeBEu9rKDwToNcZ7B97qhckns7LWAOQR5scybjyPE oqhCHnFNBBZYBX3e7AHpUiITGmvGWEo= Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-797a7f9b552so23189085a.0 for ; Mon, 10 Jun 2024 07:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718029881; x=1718634681; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vmkoYQdN2TcqhXW6bXeE/domfSCU9DERaxqlSrdPGI0=; b=U+v5qhUwxD1pI0RpYSu8mvCYVjhjNLzO/Iuvikex1IDHJ0n5r6dVcWDWzq5uJuCVMm cn2kTlhaNeRBovYOcb0dHWuNj0qcQIJ4V3F0VU+WDrBRyyjj0vo3+GbSxxdZqPMJwfC6 pAmX/+6f0OIFQ02s/H5WpOsz2cseLKCNu6lkzJ/Aee7w+numch3K5b4mEilLF0ek9fV2 Rj661E+XNDyYLo4G0wxBvLqwnNJu9DO4AXEGF/sYGUVqt1WbtuRM5o5RxQrXj1KtXAnO UNnwUavRC7zc2C0jfwSH5+67XPVDOHzyJ86yN+F1FlRcbv9ZUWArcSvx3Wj5kX0l7NQ5 t8hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718029881; x=1718634681; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vmkoYQdN2TcqhXW6bXeE/domfSCU9DERaxqlSrdPGI0=; b=Pe3cZd4N8xrDgxFC1HBkGXmc1z+LTA6iLluuzr61bVtK5F0ymKbMGWSHfiWm8C1tH4 ueW4J/9FOJ3EfhBMTCWKtJY7dUTwanAGa8uCYtV2j53dNgPVo8/p+UMb+4KZ7e9P7g3B oGwcVyzINpxSD+jhmx/WROkjrs5VDMQdMzmhe8FjHTL6/30DCEHzcqZlIv2hojn3nHNK EWCW3+F6uM9N0Nf3qptKtbtAcCvhb6phuIkDpsPmGccPTDypeSWmmfhh0lrzvX+n3nCC PxMPHHDtUsIRvlVvTjYipf1X5FPDdiMD00VN1pYEeBuKXOx1lWdindbfLZKM7DANJglc Y/3g== X-Forwarded-Encrypted: i=1; AJvYcCXit75QQfwDA9Mg5uIqrVWBGHYxQeZXloUWhS8l2qP1j4E4YG2K4BM43C1x7eh3l1vTHpIWhC7Pi+L5lfaDtf5bZxY= X-Gm-Message-State: AOJu0YzmZGKTClz6/WHwr5Gged+rYKDKTqm3M6YJLUF4DdfUtbGn8odR 6oMn3OFfD+Dbr+nnvzjG1NVWiWgb7NnQrwXFYiA08o8GwPIwqqHi X-Google-Smtp-Source: AGHT+IFPp5RhKtZQ9MvS14DPNDaymoojuA/+cEjt/zxS95yHDKvW19lgNaZZnsBE9iCx7f/aMTPNsQ== X-Received: by 2002:a05:620a:4556:b0:797:a649:bdbf with SMTP id af79cd13be357-797a649c0fdmr156842085a.13.1718029880727; Mon, 10 Jun 2024 07:31:20 -0700 (PDT) Received: from localhost (fwdproxy-ash-006.fbsv.net. [2a03:2880:20ff:6::face:b00c]) by smtp.gmail.com with ESMTPSA id af79cd13be357-795593165e7sm195488185a.65.2024.06.10.07.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 07:31:20 -0700 (PDT) From: Usama Arif To: akpm@linux-foundation.org Cc: willy@infradead.org, hannes@cmpxchg.org, yosryahmed@google.com, nphamcs@gmail.com, chengming.zhou@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, Usama Arif Subject: [PATCH] mm: Do not start/end writeback for pages stored in zswap Date: Mon, 10 Jun 2024 15:30:37 +0100 Message-ID: <20240610143037.812955-1-usamaarif642@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: C3FA480011 X-Stat-Signature: hqfwxzgq4jct7616b1oy776zy1n7nsnm X-HE-Tag: 1718029881-161580 X-HE-Meta: U2FsdGVkX1/Jk60Ehl4a38yMJlfe7T+X+DVPG0Xouz5t2aATiK8qWRnfQMVo+phMh/95RHEgrzY8EPT7bJ09XjDCeBsN5ZhTKB8rd+mWAZigjQfqMtncn642MI+euIxeHHVuK1gZ5hZCcUiaRve9eONUYaUp0ga+0VEdD78qQ8OM3o/u40WLsY9B9jhkDqv/YHgAOHhsClmm+L5RNpjtJI4SIvBAW26JvQFRbp/nfDtpa6ycbo2pQz/DyGU01ktIMrUCdAxnFumIqn3Z+95G7rL3Sicr2PHDZA4RL7lyogUjn9BYYGu0hvhYhhSWBuiRia5EVnRvd6CO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mP74yNY8yZmQU0ndbg+f0RupLzKur3eMATqizJhpfnfkpxnbF5cyMBAMS6kFYmO6qZrarbLXtMUrT9VLCZGFGN/IjIYmr1f1Zlm/RNKUF X-Bogosity: Ham, tests=bogofilter, spamicity=0.011910, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: start/end writeback combination incorrectly increments NR_WRITTEN counter, eventhough the pages aren't written to disk. Pages successfully stored in zswap should just unlock folio and return from writepage. Signed-off-by: Usama Arif Acked-by: Johannes Weiner Reviewed-by: Chengming Zhou Reviewed-by: Shakeel Butt Acked-by: Yosry Ahmed --- mm/page_io.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/page_io.c b/mm/page_io.c index a360857cf75d..501784d79977 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -196,9 +196,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc) return ret; } if (zswap_store(folio)) { - folio_start_writeback(folio); folio_unlock(folio); - folio_end_writeback(folio); return 0; } if (!mem_cgroup_zswap_writeback_enabled(folio_memcg(folio))) {