Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp346137lqp; Mon, 10 Jun 2024 06:09:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyWxd2o56hmlWlC9oOhRhSMTamuq3dU+96q0sIt0TSvTFxnN6tt5xb+2tBuUPLJgwoA9X57jIFmftMUn/guBEFtICWOleVLe2NQO3zoA== X-Google-Smtp-Source: AGHT+IGRoCvmSdjBNJrsX6y4o2XWMHEeld0V+GyGoqaxGRlI8I89QPk18sJLXQMYpLCxw+pXdyV4 X-Received: by 2002:a05:620a:2413:b0:795:4852:69ec with SMTP id af79cd13be357-79548526c79mr987819885a.72.1718024967932; Mon, 10 Jun 2024 06:09:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718024967; cv=pass; d=google.com; s=arc-20160816; b=ZOrIJEBi5mD1aQMli6YUbfI6BGhztF/1nof5fseaoMVOIb5xX+CPxxS/kAQFEH/+w5 v7S8xvBRTxXg+czlFZg9IqWqLAwcGdjsRwyv6mAtUrjYYdnn8p0ONgJV+q7arYK2ogcu AY6pOYReSdNxrzNS+uby2PLspN/aaNugXCcwcwt/n0T5FCw5DtoP9RH+FRf/0XoLdk5A +SSIT3BAW5E1V5JFTqThZt3M2Buc/mVRUuRCo2U17yiYqqJSTd7mLdK2ULOyQDEdJxf3 dMM2qjv0fBRwktZpy37J41s154Jg77vkRD6gGyGdY32ZDVlwgODgIlH6xfFn00BLAIHi ZTcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zrYKWWmw4V/ZlIEgWmnUno7t+ZXz7+GHNrH3l1iVN3o=; fh=tlFVQg2D1N25fJpJXVPBMUNShyLjYzMI8tca9k9Cew0=; b=eCFIpMdo+YWJFUZlGaB/G8g+PiwrdjSOFPVYKV+K+CuWgQXuMcDhPcvr23bN2mxC6p 7I9rDhzrpdhNtuV0A1NCIymey3oIEKaaUd+7ccqJYa195YQNzGvKChKlZE9K5Bm+GR0B accCR7xMY8hbQFgiKS6L+52sNNgyVybh8Ci9j8LUEa5nMMOb0nUojUmD8LXcHb5aOwp0 nw7+GanGjqEHidLu/VF7ZrOw5j54aBimCFPuq8ltfl3Op4b9oQj1RVXl5cW/g91lCtxq Fufu8UWW+lT15NAesDsWWTjuTqMoOhzDy5EEp7iB57xa5yNdZixxzpXMF3Ib7LMYgNrq yBHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MZPcokS3; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-208213-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208213-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-7955b1a26e1si450453085a.520.2024.06.10.06.09.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 06:09:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208213-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MZPcokS3; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-208213-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208213-linux.lists.archive=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 88F8D1C20FA4 for ; Mon, 10 Jun 2024 13:08:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B53581AAB; Mon, 10 Jun 2024 13:08:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="MZPcokS3" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 5B932DDC0 for ; Mon, 10 Jun 2024 13:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718024893; cv=none; b=Q8+8WcsfpP+kOo+UCCl6fr39FXd834ftlhCxaNbAG6FlIDBrdCUTcyN4L4fSL/qoWtHQpFuQXVhG64zMwYm38y1R5KCSNGe+CC584TsiET3FjNf1x3+/MotJU+kg3OZX7v7j71LEa3NU1wX9KL0dxFgZHsbWl9EMWQ8QdCAIZTc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718024893; c=relaxed/simple; bh=vracCK0VNWSOKtwr48iUSsEQ4cLhIjq+bZMlZQavCbU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nSB0wXhuMCN2Ugeo+4zl5zR6pEi7fTr9KkMx5/7Oo8aJK55CulXYg4WOUFHVKj7beAT0MeeDKSLQmajYZb7nG8tT58IY6bmcGup7cI59TA4bBsWM0EQD/6HhpCGgdjM3tbFhfs2R7tbmDlT6FojFWAEYHlxr41nH31ronabuukI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=MZPcokS3; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=zrYKWWmw4V/ZlIEgWmnUno7t+ZXz7+GHNrH3l1iVN3o=; b=MZPcokS35qGlIRGdqJbwCnA6K0 sk/6bbeZ/oFPqrTkuYcUEvvG7+4Ln0FyGd1e306YZu13Xg8U+NQSK+VztfZcSu2CQuYHwEYk0Qreh yDKHr1ki1A8EI2ztLt9EwUkDuR+wCdOEQ32Oo86FaNFe8A+mWadz71E06+a3hzT/Si4DYyA3h+F/k xFe86x0mjZDUsSEQdhR2zAUDjCjUiOGXvFUYMKeU03gvHP0uPHKETGE9j+Jl9RLe8LeNxAiaET8dF vC5Iji/qcXZvKbwfqs9r2QYUfPazIrFw3hdinC6U1MTcw6iYW/9AH4CPoYgKAEng4RCQxRlD5kXQD EDQKywNw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGekh-0000000989e-0ZeJ; Mon, 10 Jun 2024 13:07:59 +0000 Date: Mon, 10 Jun 2024 14:07:59 +0100 From: Matthew Wilcox To: Usama Arif Cc: akpm@linux-foundation.org, hannes@cmpxchg.org, david@redhat.com, ying.huang@intel.com, hughd@google.com, yosryahmed@google.com, nphamcs@gmail.com, chengming.zhou@linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v3 1/2] mm: store zero pages to be swapped out in a bitmap Message-ID: References: <20240610121820.328876-1-usamaarif642@gmail.com> <20240610121820.328876-2-usamaarif642@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240610121820.328876-2-usamaarif642@gmail.com> On Mon, Jun 10, 2024 at 01:15:59PM +0100, Usama Arif wrote: > + if (is_folio_zero_filled(folio)) { > + swap_zeromap_folio_set(folio); > + folio_start_writeback(folio); > + folio_unlock(folio); > + folio_end_writeback(folio); What's the point? As far as I can see, the only thing this is going to do is spend a lot of time messing with various counters only to end up with incrementing NR_WRITTEN, which is wrong because you didn't actually write it.