From mboxrd@z Thu Jan 1 00:00:00 1970 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 863D8CF34C3 for ; Thu, 3 Oct 2024 20:01:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 091996B0442; Thu, 3 Oct 2024 16:01:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 019E06B0443; Thu, 3 Oct 2024 16:01:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DFCFE6B0444; Thu, 3 Oct 2024 16:01:38 -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 BDB7D6B0442 for ; Thu, 3 Oct 2024 16:01:38 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 493721A0929 for ; Thu, 3 Oct 2024 20:01:38 +0000 (UTC) X-FDA: 82633361076.17.1D6CC34 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf22.hostedemail.com (Postfix) with ESMTP id 7F148C0023 for ; Thu, 3 Oct 2024 20:01:35 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=cCbsgQMv; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727985630; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Cp3qA+Kel6T1oBRuMdgxLVHTLxkahuSUEamgeCFGgNk=; b=rW37Jf6kRlSLhWwTPxOHwA9y8tesBo0xpJWFG7zDvcbdzEQhG+hyL6iR6WA+gu6g4Vr+6i 47r2KCKN5alGyXEmlO0MRXhpcfmdPrPXrHnW6chB63SguBzEO8hjmowozcUDeI679djy0S s4m5qHsvSqXPQh9WS+xlUzYng1t+JO0= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=cCbsgQMv; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727985630; a=rsa-sha256; cv=none; b=xmlFP7YSNC0WXJv6PrlRqKw9ixMsKa17pC/ctn65ZwTRsbU3IEe/rD/GpWaUHxxv3iHTjT KhrCoM+K/IMfCrQ1TB7nfpA59sqC9fXYEHAZARl6zolSReeZkL1jLBsfQ/d8kXf3DqSeSf 6AmLwyruBSGaWCzOph6hNp1zLBuExrE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4B92D5C5DCD; Thu, 3 Oct 2024 20:01:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1D2EC4CEC5; Thu, 3 Oct 2024 20:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1727985693; bh=RqvHe7FU3fH5p95Bh+yW9c9wRy4QevpHahv2OjiepJE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cCbsgQMv4beJNsGDComQA56FRALBKQ/tfqX/N8uf/WNy+YhDxz1SJ4HvrNYalZr59 NLQ0webp0FE1qcMxRH94bFnuJKnNIA5yhCIgx8FAKNqTsxLjoxFugbDAC2bB5Hroke vbuDkw9SQ9foeP8Yh5ndTbCKfD8Yf/nhPhkH0JvM= Date: Thu, 3 Oct 2024 13:01:33 -0700 From: Andrew Morton To: Shakeel Butt Cc: Johannes Weiner , Matthew Wilcox , Yu Zhao , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team Subject: Re: [PATCH] mm/truncate: reset xa_has_values flag on each iteration Message-Id: <20241003130133.afb8e8bbdfa8f638b0343473@linux-foundation.org> In-Reply-To: References: <20241002225150.2334504-1-shakeel.butt@linux.dev> <20241002155555.7fc4c6e294c75e2510426598@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 7F148C0023 X-Stat-Signature: takg4jysai4nkchizyrm89htcmuqpm1y X-HE-Tag: 1727985695-594051 X-HE-Meta: U2FsdGVkX1/O5OyREl7aJBXuzC9DhGfD2IoORHCd0i0Tl/PxiV379zXxeWW0fK3rE5kKyW+sZ3GxBGeVvj+SlaI3N7hkxyCSvX3gfIZtjxR6Xn8tqkgQ81jZlvrDcApFrkj90LnXV9Uyhimnogivdt89vJZlU/daRalBDjUe4pHYfgeLoLx6ChRYwqOpVmBFVrjwsuw1EhvjU0AsqgoVrTpA+Z1n48W5A1ZNhFwUZmiPYZGT6DzEh0kGGr79frS03UZV9sXRFf1F4HuTgxlGFe/k425D9PM03Z23jZ0h71mtW9NIUFBO+K0x99BuTeKFY4D1BfcbPohqXUJwTeTxETainCSYwDZfB3clBvFfGHwBOXeZi0UxNuVQN5KaPgILjJgPBPUdBz03IL5cGYOznT5LNcdgs+NGUrQUzvl3/5SY01fdrqh9IqkvwYZjts8Xs9fIUDApLcZV1xsyCJKmfVb377EDqzWn+nRGcVQxXCd1LE2vFC3zcXGZ0WjQ/YRWj3INMIhraw6cGLxwSq+ufc3qK8hbZYd/LHpNoGUmYYmhWeBi1As4uuRrGBaAUA7GJa2xdYSNjCWi6S6O7NoHIs0HvAcnDzXuWxF6KrBu6e6V0oa1hpZhxAyrltvopA0/5kB3HJxaWQ7SgDhmMQ5vUs40UPauRGgbNpgRY+d06vMucCE9WqK0jkZPKTEvLjN5lwAPU/vLJWiLrSbnhr8sxAV1qTEV5bvtd+3mA8SU+vZ8KrAYiELGFPt0xEtp3GOs0ORRGm0qxTnTN1XqcXSoxZiwP1G++L52dSo/LCKvexqTdnED6nLZaigFUFvEMrrNd3CSu4fLqhHG4bw5Nxvg5Ex6Q4MAlMPs3jxALNiAFcGBV7xyNnkS85pl+M7z2evyQlzmjJR7x7faPhVzhN6GCrFJWK7Fz3YwENBC1M5KlTa5s53jlno01MqWn1yF5RaONL1o711GCqV9JfY2Wjt AjA2WAMW fs1Ymw738XLsBqmGhIl9KOe2IddAS4APmsLb/iV4edbcO6L4dJ1avPHzB+sDHHIyENx3qRejReHEEJO+rFyZ59WN6lJEJGtCKG0EbekClEO+9y+FXoFznC3on30w4CGTac5Rf46v047cr4RF8d9OWLX/Bet7nAskDLw875EfvF6lg9+qlU21RShHXdm2dJwVnDTuRsSr0CFmpVEF9+rxwyK49X/v69kn1eCsqC4oPyA9nJQxEqRRC40U9+eIfgJhi4fHyNJzB3Y8XSIcsEydu5Dd9Q+84qkM8l/q8OgtpygVPW0s= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, 2 Oct 2024 16:09:11 -0700 Shakeel Butt wrote: > On Wed, Oct 02, 2024 at 03:55:55PM GMT, Andrew Morton wrote: > > On Wed, 2 Oct 2024 15:51:50 -0700 Shakeel Butt wrote: > > > > > Currently mapping_try_invalidate() and invalidate_inode_pages2_range() > > > traverses the xarray in batches and then for each batch, maintains and > > > set the flag named xa_has_values if the batch has a shadow entry to > > > clear the entries at the end of the iteration. However they forgot to > > > reset the flag at the end of the iteration which cause them to always > > > try to clear the shadow entries in the subsequent iterations where > > > there might not be any shadow entries. Fixing it. > > > > > > > So this is an efficiency thing, no other effects expected? > > > > Correct, just an efficiency thing. Thanks. I'm assuming the benfits are sufficiently small that a backport is inappropriate.