Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1847395lql; Wed, 13 Mar 2024 09:42:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW39QP26Um0T0axEIX9d5Np/5p2qy/y14N+s2wwQh5Prs+FrjxC467Ejc1JyLgS9XBITVaXcJeOxZKVXp8snKAFmMnbiUzypFhNxprQNw== X-Google-Smtp-Source: AGHT+IFZPLjnWzte+xlUoGixckSkE6tcUEktdbsKoyvF2uoNiXSDoDLt0MsRs9tJlJxtJGfbzJXM X-Received: by 2002:a05:6870:1642:b0:221:a881:e07a with SMTP id c2-20020a056870164200b00221a881e07amr14356238oae.44.1710348145192; Wed, 13 Mar 2024 09:42:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710348145; cv=pass; d=google.com; s=arc-20160816; b=Mu/xVoQIKNQpsC5l6cYfOGXY4Hyy1348neueZhznrXl0UewYOB3VElPxd03JmKKsdE kMOw5uoCAhgVt2YzTLgzpapFrnk6bLiZxuSMmT+96q6vElZFpqm3jAK7ldhP32QHYHUT PljrKaMgE9LigOB1WWQOi69GmMg9ycAmOQ+zQHR8BbSo2odlgDuPrr+Mv1Oqgx7X5mDG WmS9+51Gsk8Md9n3yOeqiVG3NnCu0yUgluO34S56c1830YWKFZKMC2D1RQWPKQzjC1yu uy2HYkrfn0JiIJTgC/0TvHe4I511/3ginuFvHK5L151FBM7UZyloXo8z1JN9Cxg+k5LT azEg== 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=I2XjTmMsPv5cj8m/t/JM0PtyER3p2SWm+rbVUSDquzs=; fh=Ez0vjbhtjLturRKWlSQR5bsCRVjqKjMRtOZ0WZVUIj0=; b=b3lpAIKu8BR3iYweasu8pasX9GMxqQy2irS1Cm4wEDv5nz7CGcCVi22jHppHXhLJHd tSrmqNfgx9KKZRiPjMXmRE07aSg0B/IvImEXSVaJAKyAz2ybommyKCGfSjMpv8m4FP/O 7Bpd9Mq6hXqtShbDDA70rdutVVmvFDc/D2XCmlaZaEBvn5E8XcOKvA/94iARi2zfxuH+ ZZVObvWZaM6W3nnC8fqh4Vxu/KeKJozdWBIrNpNlEdBFGgpUauRsYGcmIDgcrq35PqV4 zZORv4s/jr4JsaLUuLKD5lkn9aLJgts1QQ369x1+M/V/OvhV1XMQbBxTqEzLxQoYjvNy S5Wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mm7OcMrD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101781-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 u28-20020a056a00099c00b006e6b95a346csi1626501pfg.330.2024.03.13.09.42.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 09:42:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101781-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=Mm7OcMrD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101781-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101781-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 D2D2028ED17 for ; Wed, 13 Mar 2024 16:42:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D945B51016; Wed, 13 Mar 2024 16:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Mm7OcMrD" 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 0999950A9D; Wed, 13 Mar 2024 16:33:30 +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=1710347610; cv=none; b=aozwIzyFdiMWILrRtzMRih3aBjoGZO2P1A1cGScOvZ5JdZXGOSx/ssOKyLWPvCY1DoaK46sv+JJvc9WZLdIle0FNilzWu8W20ubMyTQAoleNnvOwDT9cARFAnUetKJ7YoYLjULK+yyzIF9dV7FNVvtdmhRHsFdIT1mp9pZTHgNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710347610; c=relaxed/simple; bh=KtxJDXB2dqy8VWH3BBhIQfZR3UVd/6MjguJ6kwSTkx4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B1CIE8BddpxDDfKNfESQJLhbyvDqX3cPV+vFAFVWcC2+IQ4QBbITaPwMoa9QxPlHA2MdcF3FhmASq5P5cmv566pbnrlQ5Ui0j9eZFl8r73qxvym1BiRG7SWYNIfVWsGeEJpbiB+1iVGNineNHEITnCV+69DfkKhNgGWEpvAO+YE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Mm7OcMrD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B9BFC433A6; Wed, 13 Mar 2024 16:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710347609; bh=KtxJDXB2dqy8VWH3BBhIQfZR3UVd/6MjguJ6kwSTkx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mm7OcMrDsZ4mWA+2sxdlqn8zg/aFUr6NoV1mkHly1DT7daNhMuu+ORTqlI8m85r4p 6BcGLXmP9oEE1OP5DDdOwY+/PE4nUIyA5vdgEvgaLFkJ9BI0cypmrJ9Koq2rF8EZj+ JPoMx4a7TPML8G9ckCcUZGL0yP6A8o+mxHLYMtVt1SshISo8zBLOGuC/6o7YxIV414 S0ubEL3kn9XRYL5GHrjQ3YQ3R3mYX2Z5bsbSJay6ZCxMk5D3iHukuwSGwI+ufSewys n+q6ft4g3UMzg+dwECpJVFVBKshyx7j/avPAAWzYYGFaMiN6D5U48icOp0YWv/Fou0 V4WgWAhNDHRag== 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.7 42/61] erofs: apply proper VMA alignment for memory mapped files on THP Date: Wed, 13 Mar 2024 12:32:17 -0400 Message-ID: <20240313163236.613880-43-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240313163236.613880-1-sashal@kernel.org> References: <20240313163236.613880-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.7.10-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-6.7.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 6.7.10-rc1 X-KernelTest-Deadline: 2024-03-15T16:32+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 c98aeda8abb21..3d9721b3faa81 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -447,5 +447,6 @@ const struct file_operations erofs_file_fops = { .llseek = generic_file_llseek, .read_iter = erofs_file_read_iter, .mmap = erofs_file_mmap, + .get_unmapped_area = thp_get_unmapped_area, .splice_read = filemap_splice_read, }; -- 2.43.0