Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp913028lqs; Tue, 5 Mar 2024 23:55:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXuRp7/5XNqxHaajE70hcj2GsVW1HtMDl8/jrTKY9xiN6pa6QpX2xAaFuBdSVzOv+IZ5Q4WdFdpMFPEbvf0WGgvD9TKSn//ElNMWfhNvg== X-Google-Smtp-Source: AGHT+IHECC5dBoJXuUsuvoMjp0JuVmtAvzygaba+oggE1HQlwzfSav195xuXvWnEzj/e3UjFquUJ X-Received: by 2002:a05:6358:54a8:b0:176:99f3:8d11 with SMTP id v40-20020a05635854a800b0017699f38d11mr4177245rwe.32.1709711721172; Tue, 05 Mar 2024 23:55:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709711721; cv=pass; d=google.com; s=arc-20160816; b=FqWvUQPKwHQZ0ZhY/wICXw3pbpCirvDvGb6Ianlq+1Y1Vhv+TWgkIYuxQzUHUAQyF6 YNOgPK0YDSR8SZMpgSIzsOIXTii6ee0mQXfQIt50ubs+MLJICMmlGaI2cFFfgwHeGzvV CxG9aCtl1J8l6pt/0yEEhZDdWqM0tl54wAr2nffDRBEGo542LzBm8ghWtdlbEWwBVCYl dAepf2HAwN4+BTasLvnU94A2C1OOMKGG/NfTndfxbhHdNchcnBxOeGwgCrJqdqhezaY/ iTMvkNRCoLxACYgyVqQFVLnOvfUgVtGpC76NvUsm/cSlU0fqIXW/rg4JbgUuJZ9f9QVU IsTg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=6m9vEWZGyUoYUNKNnaBD15J1Z0XArlRy+U6S81860p4=; fh=jsJwwuYTy3Q3bk3qROGtmq2W5LGrWtFhrJYiKtfg4qQ=; b=a+DOxP3VjKw+12xU1WrKNiV/+GNbx5RZNM7Hggc1NaAHN/NmdCS57DFqQzCXqfG2Xt K1HAgD34f+UvNZ/l/jPilF4+7DxTyw8YeIGLiz3GXAJKtx2tJ7SE5PsqxbKyeeFLn8En 8sKrJx1scfEB3NKRaMmk6DRogPvwVsJpE6Xlsib7saiwtWLLoBO8E3Rvf5Eh3FZcl5In cUMFXJReNAZIauMlhdeHi8rO0Jnl9oKtOJWJ5qpbpGyXvUPen6xvnYU55Pb9cBn0AR3D xrejSToiobMmXZizETIah/omHZ8WUHbetrmgfRn4dG7KQu/+4nW9Fd8ld2pq7vIhQuFD 0TzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b="RZMYyu/m"; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-93449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j26-20020a634a5a000000b005dd565d7626si11012454pgl.900.2024.03.05.23.55.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 23:55:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93449-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=@linux.alibaba.com header.s=default header.b="RZMYyu/m"; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-93449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 B298E28960B for ; Wed, 6 Mar 2024 07:55:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C1945CDF6; Wed, 6 Mar 2024 07:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="RZMYyu/m" Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 7C1165C60F for ; Wed, 6 Mar 2024 07:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709711714; cv=none; b=lvmsZANjXIZGpybX5IYcAnof8bzchOY4ZEJrisuS+BDWfOA+gXOCEjYg+Udjwcq/KXYUJVGU6+FobbOEeuLeh/RtpNf5KtDEEOARrd17WU4SryKPZtWbx5r8V/sZoWJrl5zSnnCRImiM0JIzGKwp4MatRbUvv36T0jZoHgfY4T0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709711714; c=relaxed/simple; bh=vw1Do1mdUeSYW8XeseizCXsoA/vB1CreAqCRX8tXwoI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Mn7k81cAQFxKuEUJiZBRwXQkzptrKuI5Fz9pBa19xi5fKuV8K6khwQ1H3GeDHw/ayVTJYxLsUcVhEChtbo/Ly3AqUSpcJcT03JQJJF9QLa8nxyGz+3VlEOqMc2B2/85TZroULMx13TLgH4ivocsiRUo2zYd2ymgKcCSqqrxfE8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=RZMYyu/m; arc=none smtp.client-ip=115.124.30.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1709711708; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=6m9vEWZGyUoYUNKNnaBD15J1Z0XArlRy+U6S81860p4=; b=RZMYyu/mWJUEasutgo7FvnE/M2gGaBnUL9CI3RfDG7x6IeEMCRW5DS6cnROxadx/f0t3M3Xk1O8L0m8kDFUJ1L7fTMzzPvBRUSb0NIAK7L+BCATm+VMQiSv6zjA2X5FlVFQAt7HJJSQvp/T+0Yt+vPak1fEwHU/CqJR3sudXRrM= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R291e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0W1wff2R_1709711707; Received: from 30.221.146.143(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0W1wff2R_1709711707) by smtp.aliyun-inc.com; Wed, 06 Mar 2024 15:55:08 +0800 Message-ID: <3db6b039-a071-4736-aaa8-fe1a7934f981@linux.alibaba.com> Date: Wed, 6 Mar 2024 15:55:06 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] erofs: apply proper VMA alignment for memory mapped files on THP Content-Language: en-US To: Gao Xiang , linux-erofs@lists.ozlabs.org Cc: LKML References: <20240306053138.2240206-1-hsiangkao@linux.alibaba.com> <30300dc7-3063-4e09-bb21-22951ec23a38@linux.alibaba.com> From: Jingbo Xu In-Reply-To: <30300dc7-3063-4e09-bb21-22951ec23a38@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/6/24 2:51 PM, Gao Xiang wrote: > > > On 2024/3/6 13:31, Gao Xiang wrote: >> 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 CONFIG_READ_ONLY_THP_FOR_FS which enables >>     THPs for read-only mmapped files (e.g. shared libraries) even without >>     FSDAX.  See commit 1854bc6e2420 ("mm/readahead: Align file mappings >>     for non-DAX"). > > Refine this part as > >  - 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 >    ... > >> >> Fixes: 06252e9ce05b ("erofs: dax support for non-tailpacking regular >> file") > > Fixes: ce529cc25b18 ("erofs: enable large folios for iomap mode") > Fixes: be62c5198861 ("erofs: enable large folios for fscache mode") > >> Signed-off-by: Gao Xiang >> --- >>   fs/erofs/data.c | 1 + >>   1 file changed, 1 insertion(+) >> >> diff --git a/fs/erofs/data.c b/fs/erofs/data.c >> index c98aeda8abb2..3d9721b3faa8 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, >>   }; LGTM. Reviewed-by: Jingbo Xu \ -- Thanks, Jingbo