From patchwork Wed Sep 25 22:47:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 13812500 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 13CC7CCFA05 for ; Wed, 25 Sep 2024 22:47:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 919866B00B7; Wed, 25 Sep 2024 18:47:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C7B96B00B8; Wed, 25 Sep 2024 18:47:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B6B66B00B9; Wed, 25 Sep 2024 18:47:35 -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 5E4746B00B7 for ; Wed, 25 Sep 2024 18:47:35 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0B0F6806CD for ; Wed, 25 Sep 2024 22:47:35 +0000 (UTC) X-FDA: 82604748870.09.504B817 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) by imf22.hostedemail.com (Postfix) with ESMTP id 366F0C0009 for ; Wed, 25 Sep 2024 22:47:32 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=C89w00GP; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1727304364; a=rsa-sha256; cv=none; b=SWCLPvEl85E4daJ3+O0Lpwjv40UAUdrDDa03g3n242TTUwe1owjOnqDm4W52V5y4yVXOdL AqfASj/8mQPh1JHi0n/UnxGLVKDOGYaGYUDWuC+po8ltBIr2W8bQ6FS5cjDCTSHYnoLu/5 tXeegGDgQlhah8DwPdxcFd5b6iUSU14= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=C89w00GP; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf22.hostedemail.com: domain of shakeel.butt@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1727304364; 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=/B1kxCt19FnSzGhJtqVM2Hk/XjnG0/kbcpwDshTcxlg=; b=odSP/GzX/MJ4Sg+kHMdTY62QRMVWJCKbqzcKP0fQFS5K+S+1om3fLIWw69+G5kX9s/N3Bk x12gyzzdVhLyNyPySW1IL3RRu9Bm8oMKiy0LYAkgkol/A3QcLnEu4QcFfnOr6SY4GOUC1r os2Bk8McOhS8B0kXk2W2PLigyw06OBI= 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=1727304451; 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=/B1kxCt19FnSzGhJtqVM2Hk/XjnG0/kbcpwDshTcxlg=; b=C89w00GP0fkkJIUQJIETvnm5w9AeH36DChrxj8APCp3D42Qg7tv6rlx9+FeeXuaveIIVnA 2fvmx28RoNDoJIzg305uVgLn9Zum/CjAr0tdcm0hYoG/5K8vRNaaQ47WGNwcRRtOOOS/my v2Wpl7w/Ks1vbsiL294UPYuE2d53E8E= From: Shakeel Butt To: Andrew Morton Cc: Johannes Weiner , Matthew Wilcox , Omar Sandoval , Chris Mason , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Meta kernel team Subject: [PATCH v2 0/2] mm: optimize shadow entries removal Date: Wed, 25 Sep 2024 15:47:14 -0700 Message-ID: <20240925224716.2904498-1-shakeel.butt@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 366F0C0009 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 937de57yfi8zqnaz3bcncau1cbw9js96 X-HE-Tag: 1727304452-963213 X-HE-Meta: U2FsdGVkX18OMSiP6yx9oFp3mRipsZlb6cD/dlDZdiOEjOtsGZApLt0AJn3afRcP6oSiRDVCncABIZr4HlMTLOgwn9RUA8Q88w6HbZFrUhi+QUV4WnpvTRZLLb61t+A3C9N0COHG8g+EzjpYZ0IljcU+Y+rFcICfU9fZHRZ8/tjKl2f4useQPlQ7J+zkocozC6PlCjHz3EWX767fmIjB/VixB03MDKHefQdczpWzhHvHUSlDtVYWErJ2u3Po5/kLvhfMrUacj64xruk09fYvsZ+K9v5n/zYaEive+u2PjORN0uj8KWxQmkJYl1/v/5LwA53YaVwuQuQEvZpBJErib/YUIdN+5kCi8dYGEmwPuZrDux4U0p0HWYrkEjBysGpzcG+gYasUnK1XMnQH0NlGx2xkn0SRn3H63lM9/a090tJjzL09dHn5Js3oOVMTocLSRK6yI7Up5xhhK7wofKv0JAulrD7NRlDVUABdx/AVUXwkXsQ98uLUnGtB2du2czGqkjckyVDh8MBZJakecV2lajnLu1KqOBP303r1ozmlljD9X2MYligHMJblcKEC3x+1WLm13FritDZ6iW9yUNoBRWS7nvOypHIZPvYqteXUsbHPieVHIJgYh536/sQsYlnGDbg0mGu3ko4lbUKuVZHDpAmP0K1+2mipmlxnRZTdYSAJ8KGYtMfcXpGmT9ujznPj59uqOopU7ZIRdJDfzO2pgIxygMzA5Bi+2IqCX4OvAlphlQwxbhO7f9So6/u9E6/aSjS7qbpi2B8BQyRyDpzCVEP8oRwIl6s12G/ebTuTFoFzRzQ9mgb9kz27BDQ+9gK+VaRa0AFOGAPWK/tq4RCZxt7c+PDPCaqDy3q+oYi1TjHg1/mhbqmx0m76OqCVANBCtRluxc5TphhVQkbHInUPvkgLf06M2fi4PL1tA+OU1uoqA7OUIm2FpVq1fsAzIhAfQelkxskWyrCDH5TSWsi iomzZux/ rFAM8wbVMLQvik0XwY1rDFsjyNi6i/OiFjKhfHcZVZeHnyWY2syUseDg3ed8nFEZ0c26qR6w1frDJV0ESPZ91sTYFwvnc9XMeeHZV0rhGTgeCH8gVqXYqxxWiYKqhPX/yRzcVv+/qz84msTg= 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. Shakeel Butt (2): mm: optimize truncation of shadow entries mm: optimize invalidation of shadow entries mm/truncate.c | 99 +++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 55 deletions(-)