Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1870195lql; Wed, 13 Mar 2024 10:17:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwLFJgnGm8gt98eAc3gsYaoPZ7blfrntVxjq7u2ZRtY40TLxpaKfcXJanqwyw/SrOvfO9GvKZrFMvPz68kss/Kl5yE3Zhgyj6hcuyh8Q== X-Google-Smtp-Source: AGHT+IHYuM58H0iBYPKMAs16tPe99YOQ/zfTQbgtsN0V4iy3cnonD6I2Hjk2hlG9j2FULEZ7srBL X-Received: by 2002:a17:90b:3143:b0:29b:c306:11bc with SMTP id ip3-20020a17090b314300b0029bc30611bcmr4573575pjb.5.1710350254456; Wed, 13 Mar 2024 10:17:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710350254; cv=pass; d=google.com; s=arc-20160816; b=PYQGnmhvQK+81Cb47Rt9mCEL+pcS/Sbcs8yID6/Sh2Q7jQlxhD8lkAaLg8XA6A7FWb ztRiVXPplZow0/LjOpHwFVJ710P96wh9hfbF2gMH6wc/chYelGkuJ6buJMPadx81LNe8 YSAzyxkBy1j9e2s9VQdMGPSid8bHcLIqvfsAQRkIyeOBw6AZjDgVSd0RI9hz934bX+EV hoqlMOsdwVdWLJHqr4WNjMV402zqR2/4/xreIq3EjedL2YjUk3W9qxEO+2+eFiHbZs1E Ij4p9q5jdk17EkQUYBDlAtEQF6/EVCgztBgTc25iY0MEvg89h+2Y2qGLEc7e9UQPF11A Z2yg== 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=4P2y3lGz2CFGkP+90P0kOXQ5N6AlBIij+pYEvcFsZmQ=; fh=Ez0vjbhtjLturRKWlSQR5bsCRVjqKjMRtOZ0WZVUIj0=; b=MUXNRWJLvSN50xZPQrP2uyWnfL0qi0c3rMN8QNnb69MPrDEUNNVr4m791xEqujxLzM 2rzyUhWJ7eSqaJIS2f2cPscRq3E79PwY+/8p/u00Dqp7o6JIMAkzfb2T+3NG4mFHAks7 5t3WHgkzcM6ri4o9flAG29QsUwRLE96Ui9ZBJJGh715+obBdzFPFpkGBPo73DQm8dUqe Qw176VmNjEApNyTK+YB21/oRzy8W0CCayY3oUkYIGNay30b80RVcJ/auL/zgSUXbOIZT /nv6d0jxKG6T3tV1KK30eEjB7VRyauyzV/rfk7t9G5yokNgQQ7aebC523Yji9WPHtOjz XUhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1gafIOj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101886-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101886-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id z19-20020a17090ab11300b0029b9f2bb635si1722509pjq.178.2024.03.13.10.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:17:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101886-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1gafIOj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101886-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101886-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 791AB28507E for ; Wed, 13 Mar 2024 17:08:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8218C7AE72; Wed, 13 Mar 2024 16:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="t1gafIOj" 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 A50907AE42; Wed, 13 Mar 2024 16:40:21 +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=1710348021; cv=none; b=eU7iWVOIlPuZlWyUkwjO3aAz9WptjtXAMXHEVlKlOce5XpHidHstE3RakUBulDYqbwW33VS7r6+va5Rogkqc9oN7v/kSUT445GFnVL9oeaed926zb7+Y8Ii45vq3tMF9xv7lfBCl2mAIv0u8Sg+iLQufQXZxYhAeMQa+AoUIKvQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710348021; c=relaxed/simple; bh=U8MyWOAzXmXdXBKgmnHFvRhuLr+sEeBKWE4T0slEaZ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ug7OHOvRJvN8PKAzeaMQUsj8uj4wTPK8K5WbeZc6lXcrLP3ItaorVSuDqciagRi5+CSJ/ssgyJp9X7bndTZt2wa5DSwWc4EqdxsfYU9YbHzOs3B8jA7aI2zRfgvD/CVWivd48fO0w9BKZc1HaNcEqitKDovWu7lYBQKac9Tb1OI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t1gafIOj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A93ACC433C7; Wed, 13 Mar 2024 16:40:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710348021; bh=U8MyWOAzXmXdXBKgmnHFvRhuLr+sEeBKWE4T0slEaZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t1gafIOjPaUE3fMdjnjTJn+HQEOId4HQrEQ5ajRCCHbEw5P87Z9XyDZ2gXFuMZiWu R450aweHumAqM4snIaYgh6oXBr+vADQ/LNqMHF6/v1bDgTkUXp7AdR3nACZwE7mDBD xVohNmoxXZiFYB59fJP9qMJ1kTDSVFikdcQBWa1XwHNn16YKIO+GFRaTIgeDej/BZD nQo90tovI+ObH3f49yQg9F6Ul2wwdnE3yjDPMPjsVhCAbvMLyKZ7AYICf9xSucsvFH GiNDVA9diqERo1F7aa/A5H8ry6X/+Og+aXztIM4Vdmeu3j66tPxziGWc+L24RufaUg LoeyOMWeHsqUA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gao Xiang , Jingbo Xu , Chao Yu , Sasha Levin Subject: [PATCH 6.1 18/71] erofs: apply proper VMA alignment for memory mapped files on THP Date: Wed, 13 Mar 2024 12:39:04 -0400 Message-ID: <20240313163957.615276-19-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163957.615276-1-sashal@kernel.org> References: <20240313163957.615276-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/v6.x/stable-review/patch-6.1.82-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.1.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.1.82-rc1 X-KernelTest-Deadline: 2024-03-15T16:39+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 b32801d716f89..9d20e5d23ae0b 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -440,4 +440,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