Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1876381lql; Wed, 13 Mar 2024 10:29:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxGnfv2jJy8bgT6eYH5SNffaKEBTxl0EAGZTPVduoD9HM5ucIIbCxD2EwjOlK4K2At8XG/NRy2Azlujaundf/OjDKYf9CqTRKuAUuRkg== X-Google-Smtp-Source: AGHT+IFoupPPOGtSka9MsLUJqZUQo0MeDmLmt9ZzmmfW6mTWG5ro6j/KxmPVE3fGxD6hk1otulPb X-Received: by 2002:a17:906:1d5b:b0:a45:3308:560d with SMTP id o27-20020a1709061d5b00b00a453308560dmr7902656ejh.71.1710350983537; Wed, 13 Mar 2024 10:29:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350983; cv=pass; d=google.com; s=arc-20160816; b=uFBZnqzkr591X7T3Mb4SbW121lvKM8NGwkV60TjPTN+qtWNpoRe7HtTDU4vWb1LLOS +O4M1smwGNLxBrvufBHrCTNxqUA9cro2AxWK8P6JauFJ9frdd18YS65m5sL+0xHt49/I 645AqNZx07FqJ6p26nRfyHuXDcQrRyI08qkRlP1YjhytgtbBKijOv2TQQiTfHERKzYm8 3HTK7WJkhJrljFtoIV87RMk+2z7ywL8Q4KcM7jnaH6lGQmrpOX82lH/Rj+/SXxON117t /xg22uCODpKdb36N8GpT4yEBxKq5WKiGxc9k57yg7B9OEwCpISvsMxAcYbxdM5z9pi0Q KLDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=kp7fKz4kJCre2XWUacn1sUMhRCiU3y7qXaj9vXLFcBA=; fh=Ez0vjbhtjLturRKWlSQR5bsCRVjqKjMRtOZ0WZVUIj0=; b=Yo/+Zx81O+HWo5DOhB3mAjp6ljV5qgUC0yv5P2z8QKW1PBKp2S8Erq4ZE3t+UkwhDT VOvvaSvoL/aIWs/OKWu9UNcvyNfMT5eqt77lV38sovdsP9q7ktnAaTKMySbUl0wYbPMR 70NfAALgz+vm7vz5JggvfkomwWhM/Mg64r9UNXljpJJhoOGCJfr/i17u42cNH1zNATmi am/HrjDq4eWXSplAr51DYC0/tidG5KsFusYGjw8jvo7gMD138RV9LNUt+N0P3PQs1CH6 Fw6X3j05JWFTE9kXbFQD/6kEqzANNg1ONqUhM/L55SwV8G7+gkdPyQDEBu9b1TB7IZkq PzjQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=flo1eiRL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101955-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ho30-20020a1709070e9e00b00a4523024e21si4534927ejc.336.2024.03.13.10.29.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:29:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101955-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=@kernel.org header.s=k20201202 header.b=flo1eiRL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101955-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101955-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id D40DB1F26513 for ; Wed, 13 Mar 2024 17:24:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0797813AA4C; Wed, 13 Mar 2024 16:42:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="flo1eiRL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2E1D913A89C; Wed, 13 Mar 2024 16:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348164; cv=none; b=RFHSlvmYRuARkWUOIzy7ZW0vkSHvr90MnRmUxR63LRpXdRAxIUioVBOPnPHTJ/8qsBDRvQXz5P3f/Rxxa2E/wDMaVUvzaa/99bIx05IRzl+SXDYJ57QfKdTb3nPB0JSiFO1DbySLbb+X7IdvzDpm7L+lHawbD2D0ASR0vVsANQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348164; c=relaxed/simple; bh=/PQF0yX/ENGcXAUA1kKDscSZKucRJsSGt8v8NkP/bHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YHWl7ki8xft168CGkkZJCcwcCyct7P1GzArtsF+DQ/zaen+cT0Hlfp9UXAXGhK6qiWNn9bLoGfE2QUnMcznctlNb1jEa1mULN9kQ5keIkopLtPZ08YoB5AZavUTg7p1CTWesiCaTv/E4aY+jqD3I6gN8Ginl0q8jUW8j5W4J3oo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=flo1eiRL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2BDA5C433F1; Wed, 13 Mar 2024 16:42:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348164; bh=/PQF0yX/ENGcXAUA1kKDscSZKucRJsSGt8v8NkP/bHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=flo1eiRLsyoVLnrKIErZZC9bQS++9UqX08CRX2pi7eQgAcOmx7RN4/YRhy0TWx423 OuAzJf7Umf1gwPJBapv/Ih0YDbj8TjcrksWllDJTIFUC14BJM9x8NmJPwDufRFYQ+C hy1o8s5D6tkCuIpICgh8VKLDf4wFHzUYtHINjrC8lzigvT/5/xrcxPGxxXSwIW4Sxc UUegtwg4kk2gFldVQZbIzsB9e7ZubT6RKWnEOO8bqHFCOMaVLPV2wsew2cUTa7UTKM DTM4RvguIItC0ahbWVHcoZCVsel0Rw/+QXofrL4hTO+0mycKJjimh29ALWc1URyUUl 7Q7oVAiiksQ/w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gao Xiang , Jingbo Xu , Chao Yu , Sasha Levin Subject: [PATCH 5.15 15/76] erofs: apply proper VMA alignment for memory mapped files on THP Date: Wed, 13 Mar 2024 12:41:22 -0400 Message-ID: <20240313164223.615640-16-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313164223.615640-1-sashal@kernel.org> References: <20240313164223.615640-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.152-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.15.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.15.152-rc1 X-KernelTest-Deadline: 2024-03-15T16:42+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Gao Xiang [ Upstream commit 4127caee89612a84adedd78c9453089138cd5afe ] There are mainly two reasons that thp_get_unmapped_area() should be used for EROFS as other filesystems: - It's needed to enable PMD mappings as a FSDAX filesystem, see commit 74d2fad1334d ("thp, dax: add thp_get_unmapped_area for pmd mappings"); - It's useful together with large folios and CONFIG_READ_ONLY_THP_FOR_FS which enable THPs for mmapped files (e.g. shared libraries) even without FSDAX. See commit 1854bc6e2420 ("mm/readahead: Align file mappings for non-DAX"). Fixes: 06252e9ce05b ("erofs: dax support for non-tailpacking regular file") Fixes: ce529cc25b18 ("erofs: enable large folios for iomap mode") Fixes: e6687b89225e ("erofs: enable large folios for fscache mode") Reviewed-by: Jingbo Xu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20240306053138.2240206-1-hsiangkao@linux.alibaba.com Signed-off-by: Sasha Levin --- fs/erofs/data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 16a41d0db55a3..a859bf0f31df2 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -340,4 +340,5 @@ const struct file_operations erofs_file_fops = { .read_iter = erofs_file_read_iter, .mmap = erofs_file_mmap, .splice_read = generic_file_splice_read, + .get_unmapped_area = thp_get_unmapped_area, }; -- 2.43.0