From patchwork Wed Sep 11 17:37:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13800936 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 05AE5EE57CA for ; Wed, 11 Sep 2024 17:38:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F97194007E; Wed, 11 Sep 2024 13:38:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 680EA940066; Wed, 11 Sep 2024 13:38:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 521E894007E; Wed, 11 Sep 2024 13:38:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 32359940066 for ; Wed, 11 Sep 2024 13:38:20 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 98E3F160A9B for ; Wed, 11 Sep 2024 17:38:19 +0000 (UTC) X-FDA: 82553166318.29.631E1F3 Received: from out-184.mta1.migadu.com (out-184.mta1.migadu.com [95.215.58.184]) by imf30.hostedemail.com (Postfix) with ESMTP id E595780016 for ; Wed, 11 Sep 2024 17:38:17 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=MyjsxIDJ; spf=pass (imf30.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.184 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1726076193; 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=n9dbFABmXb3RIIbrmIFVCtUVXXsfZQnmMR4MaaV4ITI=; b=hytmxmIbQt05TMw6jWeu+wQen6Z7VPb1sJTwVCVzzbLXniiwWc+Ryq6ewWu7GI1k1roYkR Ac4/wGS1FT/cUbcmRGjsaBVysdwSY/i6yY7kHWErCPfB6KPZOAq9hAGjPwgy8+O/fuSyij yx9pIGmq2tPuIN3D7AUD1tNyWFWwA7I= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1726076193; a=rsa-sha256; cv=none; b=zH9Eg32hPVAVZRiIFQBOFpBKaclYQ8gql3nYMEx5BXoEnI+XN1rSjsu6qtKJPRbOy4e077 EofD82KQdA2Vs9eoEg07nZa6M0/kz/O58+AgH1Zmj0LoOnVC7FAMK88Vf94xQRLbly4Xjn UKpB9ipmekWjYECw0mt9ip+I/aX+c2w= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=MyjsxIDJ; spf=pass (imf30.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.184 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1726076295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=n9dbFABmXb3RIIbrmIFVCtUVXXsfZQnmMR4MaaV4ITI=; b=MyjsxIDJ7+Zt1oh0vV0MZYjTMFdCSfRd/us3OUZIPMb2ibDh+/ekKKbvVvirWTsGtXJqgz MVlH0RzgdiimUCXZdmgjAKvLm0OEnGRv6648Ta4ALllFbXUrTivYiJ+hiU1T2Cq46+op9f 3WF+Dpz2/u0Tyq6qoJHgfpcIfcgxVFI= From: Shakeel Butt To: Andrew Morton Cc: Matthew Wilcox , Johannes Weiner , Omar Sandoval , Chris Mason , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team , linux-fsdevel@vger.kernel.org Subject: [PATCH 0/2] mm: optimize shadow entries removal Date: Wed, 11 Sep 2024 10:37:59 -0700 Message-ID: <20240911173801.4025422-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: g65jj69eo1ui81ykcmkrktu3fnezmc1t X-Rspamd-Queue-Id: E595780016 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1726076297-806546 X-HE-Meta: U2FsdGVkX1+qYpbAlcsCkiGIbUj0HorulXVjoe+8Q3hS0gjZ9yhHYkjFawRUgl+V2wmQvhmB4blO4E+ncJQOaNWDGFoju3t3p7DIrRKd41FWpXiQdzk4PRC7qU9CorpiqwWLiuy6h5YEeKpRnluSiDzJWIL9TbyYH4tI8Y09VboVOuU6Lppbb9ak+Hw1KRF7eUfwEQNPbA8qqR4jTBCMSbgUZqMDwzVofgGCfrT/Jw8UxqmtNWInMuv9M+WlRGI2/SfQRu49Fu7cj57vccdnR66lS3LcZgGKMCYZDmPsiWkdBwPL8xO9q/TbZjuIZj7+5HHEaIlPa1S5sbLTzSt5dvWTzEmngmWtEB+jND1DpTmTH/MfneQmvKaObS831dlWpEF1fOXnvWT05WJuPKhbdyeHRjGn/GQ0F/jz2bdx5dhJ7rpxQfSR/plfVlJQat+Xb0nQLfY9ZogQhEIq8yJw4/XFqfgHZYgnhnPKrx9p6xd9QA709ztpvTlm2kOax9ux0SoSuNxYEV9+sk7WikNVUroevokprVw+EtHEA26IaJGYlwQ358X6qKgLvY31zeCjrerjAuK/wbEfkxhyrNTyfWJaPzFP7s1luLFkI5yLM0pywR9F9dD7HZmqlvihWDjL7EP/uLOpnnzkDNJ81eQnlCZMo2xYyEyTU4sQfp9oXdCX0miqUyLVYLvd3QwpMWk+p0wa+gqcsrhBWLOn8Q+QK2c9ZBo9dL/2QRo9+LNhmTHwcCynED8vXD+vmkVowDYZncGare8HBt6wqzjB6fD/ZtMKgZl6l63BLVqHZtvXCp6K0ZrMjTHJqIX1+NQsQWIyDrv+7AXcfMLBmCEJYy26bDVbEgcFNtjiGHASC0p1HUzzulIu3fHOqC4Vib6eY3pvC55LXZyzd96y/Xyj1fGgS5JyFLmrH5yFo4uspX/WaOZxjkPwT+bf1ICHq09LSGU1vcWXzN2BBpsuAaBcFbc CIlGQGGY 9pMuSQEtt9p6JDLNh4P/YcXIcf7Tq/LTcpkr+CwG5wvzwXEamxDq2j1sGVO+XWl1eLUEaFtGgZlBFFKmU8QDWjc1fpzDnNC5IRRVHpmHn4LSYSamGReZujP0HJpqpxKDnLN9O 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: Some of our production workloads which processes a large amount of data spends considerable amount of CPUs on truncation and invalidation of large sized files (100s of GiBs of size). Tracing the operations showed that most of the time is in shadow entries removal. This patch series optimizes the truncation and invalidation operations. (This is 6.13+ material) Shakeel Butt (2): mm: optimize truncation of shadow entries mm: optimize invalidation of shadow entries mm/truncate.c | 96 ++++++++++++++++++++++----------------------------- 1 file changed, 41 insertions(+), 55 deletions(-)