Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp233371lqp; Tue, 11 Jun 2024 02:53:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVS443MxPKJVv61UeH4Yaa9sN1w8oYtS87DroD+HqSya4ojaIAGuD1bIkWDy8EnkpFbdl6BZzuYS4m/FjiFSBr3aeQcgjHCNkXPfkehHQ== X-Google-Smtp-Source: AGHT+IHVk/E25Lypwrg7n5TtF1XHdBtxmmRsYqmW0biE/UM2R5rWVbx01zVlYQ7Cw34bMCToGLlf X-Received: by 2002:a17:906:3548:b0:a6f:132a:8214 with SMTP id a640c23a62f3a-a6f132a866bmr381228766b.39.1718099617677; Tue, 11 Jun 2024 02:53:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718099617; cv=pass; d=google.com; s=arc-20160816; b=Nd3xzEihsYtPTUmOmx9/xnC8i+B9avHDl/kDXMlIihhM2Svz3kXwzoY+Xr8UlarBYZ ZiCH7FNg7HwNrzEFrOSl9rC0nqO/gYGN9O6YJC4wVHBp1zEuhJ7G6e2EUYrSG3QzEkIl 38/vja7ayBB+XN8ZgGDEgCZN+QjapxJV3noYy2HJ5J2EFJjgzCQcCTM33HDPnDXSKJDQ cTldrv403I6rDcAVO13sB+MGwJTTyXfqxJN4dQ4mR8ZRwOb1LDaruQ3SYyXPGuQS2llp FLA0Igdc748eyog5U0EN9ehSCeHT9O3Y5UuYScfBon+h1A99h61uB9TDYRDJLiUKTU1Q zw2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tZME8sShk2kQ0RQHoagPPnoqrAeCpuE0ELxkCzr8HcM=; fh=zWBziVdaqmKrbDerC6EFbjvoAX0t/K9MBZVGA2FkbZs=; b=zSZ6f3FuC8oxs8RoTEEC5+ILbFVmZKHVe0L8udjJHq5Pyj26krF/q6MfUv9UBLYx/j 3evI5BjSE3lZPX+C/wiWojfYqfjl4X71KvFKeFDjtrTMyyZbTs6YgunJO2sQ/QSCmV1s QDxrwRhbR7h1EP5XAVfzNRZa5yg5DnF1MYOJXbqyOnP18Yf0K/nUu5ZrPOzDwijV6OH7 b7fBk0iqgGyDpWmcv43+53iSdyd7ou0uXf/KTpwiMXYJA+8dQgPnzRcwBbcrkbeOH7ZI AvWL6JcVShxbAQbbIjWLxOD4RuV86vSVhorsMMhv7dh8ONiw7nksrELysCoTjZA/koQN DtVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dx9x+I2d; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-209598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f31c77965si93534866b.30.2024.06.11.02.53.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 02:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Dx9x+I2d; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-209598-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209598-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 64F211F23627 for ; Tue, 11 Jun 2024 09:53:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F1DE178360; Tue, 11 Jun 2024 09:53:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Dx9x+I2d" Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 B198C16F900 for ; Tue, 11 Jun 2024 09:53:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718099610; cv=none; b=WI9KCqfbIwr3hBI8s2TgfCL3JnslTS9r3KXKAFjlcUlQXaXpiN9aRrOsdOIRvDOGYEDuSI3MuglbxZ34NPp/q83fTe4LUMaksgSnBBdvFgX+4YHmclAFK5qc6rSnhmfg5eFqafz8CK2LhZWNaByzShf2lKjubb4Vz6tAMpt//I8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718099610; c=relaxed/simple; bh=hR6p4+dSS3cxtO0luCHlTXEIhaPWgeI8DfCZAZXynYw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mghvPT695cVezF/98+2QxUzxtavWx9DcpXhBgqsXdbNsO6k/DOLbN8emNFEaj6cqZM+XJKoGFplwt2T0uI1DCg2dejV+J2p4L9wzDq+iPjF0O+SA35n94H6qytIFCMeUps1FjxhHMLsedlKQ+oLHHP8C4j2hP+MJmI8ep7JSW6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Dx9x+I2d; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: usamaarif642@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718099601; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tZME8sShk2kQ0RQHoagPPnoqrAeCpuE0ELxkCzr8HcM=; b=Dx9x+I2dMTfsmx7Y5v0uA4z1QMT9EX39/98SVtUgORIbsv9LcWYlMYxd9rAQQHU0VRtZk4 tGEFSZeStmTm9ozA0tUzxCnuP0tADDb709AHv8WduazDjKJELn3BvYhVNHwmt4sT00z3rc Ur2l1rnuvnrJ2PjfDJOlPb86Ciug4Lw= X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: willy@infradead.org X-Envelope-To: hannes@cmpxchg.org X-Envelope-To: yosryahmed@google.com X-Envelope-To: nphamcs@gmail.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: kernel-team@meta.com Message-ID: <5d051998-015c-4da4-83f0-1b4fb9009c68@linux.dev> Date: Tue, 11 Jun 2024 17:53:06 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] mm: Do not start/end writeback for pages stored in zswap To: Usama Arif , akpm@linux-foundation.org Cc: willy@infradead.org, hannes@cmpxchg.org, yosryahmed@google.com, nphamcs@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com References: <20240610143037.812955-1-usamaarif642@gmail.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <20240610143037.812955-1-usamaarif642@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2024/6/10 22:30, Usama Arif wrote: > 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 Looks good to me, thanks. Reviewed-by: Chengming Zhou > --- > 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))) {