From mboxrd@z Thu Jan 1 00:00:00 1970 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 E66DFD21262 for ; Thu, 17 Oct 2024 09:34:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 634CC6B007B; Thu, 17 Oct 2024 05:34:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E5A96B0082; Thu, 17 Oct 2024 05:34:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4AC856B0083; Thu, 17 Oct 2024 05:34:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2E0296B007B for ; Thu, 17 Oct 2024 05:34:24 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4C6E5411B2 for ; Thu, 17 Oct 2024 09:34:17 +0000 (UTC) X-FDA: 82682583354.10.3751239 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by imf23.hostedemail.com (Postfix) with ESMTP id A5837140005 for ; Thu, 17 Oct 2024 09:34:14 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="b/7jD8jE"; spf=pass (imf23.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.119 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729157588; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RUqGXU3RkHzyvCYbooGPW1iKMjc3Qe6ArGx8XaGP3HI=; b=IINkxUQcNRZ/qTnQyIY7JiO6p5jq8pnvEZnu4UPo6bLhgXw11IGXnKr+oV9Qzu597lundV 7cApDQEM2it/vHU08dSRifGZvTSG7DiqJQMzSktO6dguqsUkXTLCmuevfv4yRwXVv5VvwE TQeNajYIZbwFyM+4HhEV9ZgNqI5yUic= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b="b/7jD8jE"; spf=pass (imf23.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.119 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729157588; a=rsa-sha256; cv=none; b=z9LMWNTfkmpuBafqSh+5/C2lWrUJKoaKO3NpFWIvhYqIjHH7B8ujM7GNXeE1HkPqILDEUH DhkdHt8+qSRN94L+7EVaDdg4O2JEKmbUwk4L0uOte70mnYp9zBqWcv9MSjvc4+p7x2rT1t vBOqOS/g0fVrMu+XBGCcqUV9TCIw8vo= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1729157657; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=RUqGXU3RkHzyvCYbooGPW1iKMjc3Qe6ArGx8XaGP3HI=; b=b/7jD8jEfp5vqJp2lVjFb6ST6J8kSGwGqarR1uwLHh7L4/83g5tU7DvUEhJ6XJYRIP+pdXly0ShXTUdljXVG4EAEVYjqkVsktqD6o1svPsTGae+jnPDhqFKReyRK/3TX9w8jpISkiidg3gZSDvV1asx/iG8/Jz8IIP3dQHDlX3Y= Received: from 30.74.144.140(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0WHKPiJ2_1729157655 cluster:ay36) by smtp.aliyun-inc.com; Thu, 17 Oct 2024 17:34:16 +0800 Message-ID: Date: Thu, 17 Oct 2024 17:34:15 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v3 0/4] Support large folios for tmpfs To: Matthew Wilcox Cc: akpm@linux-foundation.org, hughd@google.com, david@redhat.com, wangkefeng.wang@huawei.com, 21cnbao@gmail.com, ryan.roberts@arm.com, ioworker0@gmail.com, da.gomez@samsung.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: A5837140005 X-Stat-Signature: euzmgt4aggi3jyh3rur4krttk8zp35py X-HE-Tag: 1729157654-974765 X-HE-Meta: U2FsdGVkX18QIQUqcWe90IT/Zn+ldXxQjlt4qz8K/MCO5Qb6LmdIuH0PK6TX9a5MftXUSD/DIJZtdvwmvr8WJ3H5Jd01qKHmjDK4l+F0/x1MU8SR2y6uOQa7tgh5TDPZ8ASQWpcgwxKpbgn0AUXX8ohEhcFoRHiqAy7/N3F3MBKo40fk9iJEy6HNEfiDr5ApI4qSmtgmGDV+h8o2cAilde9NIzSqWKZ0ZnR7dhiD6MIecQJ9qXmDVCTi6hKTxF2Wuy4ocvsF/K1hf2CbmsmwJLVQ7NXa6hNEJ2uG5smYofwcFzP5CxiVVbbrhr+q27gWl5lNo3aGXftLsx4ADjfCcZ2OSvdAmubCMmahqCMsGQurGviwn0lhmGWP2Bc4FJHynAEXQb7HJe9JuidsgJvCQjjsM3lhRIKsPHzqDK/aoKN+PWUFqLQjOO2e6Fc/puEmcTqNAFHcXQ5Hwq2m7jSwaXA+gUjfDuz+hHS4mKMOn0N+PIoTYXpQ1X8X+QcXR9wcPyc+5MpsYXf/l8w2AHo74j+1gF6bkl7MUkLchnurrQIXX122BiEoC557PKjAXiRIyY0lIfXHFFoIlT1VkpKDFBm618/Sw00kwKBFcGmQVy9TQIuHB+0uQ9RMEc4WRnofZTvh/2+1T1CzzYFCgLPeJ6IkaDiwSEtxH2ANKqWzSLEzIUm/DbZsQa6najumboJSJXSGNMRsIGtPWmC8YGrj12F3KH8Cye6hLH0JXISVTTUic2V7SmIB2VjNHtosfh4riRIkTUwb5qpU20DUUvdhF0adT/bX7m8zeo2Y+jvBIZVd8KHbIxHgomC7Aa1Mdw3qL1eTieDWe+7CBMioh7wGVVcHwy8p55tOnN2mEh7DEvP6cUq+nXfZaidrn5zQFJn7dpHZ4AZlnZv/Uh2ZYDSDt7nvpGlynAioAyv3V9XfwvcU9de5418VqAmHPKlEtm2jDvdKJrcxwwFX7kYai+i Dr0NgdIj Z6u0y30rSEo7LAwfCymeHCI3p8j+qlaBEzKzkJqTuxvg2lFDFZ1X60e6T9LP0lAuttM7SdUsP2lVTPFBZzP0nkAeqvkQ3MePkG/ggrfSEXj+msA0X6a0ZDpdALWgq4IL3L0F6CVCzuURvLzVRQ5cDK5ksITlZhevxD+JgWGlBXy9OpfLFI7XushF101aWtVNXYUt8cU0g+SFO2fRKnC1Naw5usGLT034xlY/v55FGUw89c6UN3AyJE/MZuRIf/CKlzKKO6BoPGq7GCxoQRfH45Wv/sw== 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: + Kirill On 2024/10/16 22:06, Matthew Wilcox wrote: > On Thu, Oct 10, 2024 at 05:58:10PM +0800, Baolin Wang wrote: >> Considering that tmpfs already has the 'huge=' option to control the THP >> allocation, it is necessary to maintain compatibility with the 'huge=' >> option, as well as considering the 'deny' and 'force' option controlled >> by '/sys/kernel/mm/transparent_hugepage/shmem_enabled'. > > No, it's not. No other filesystem honours these settings. tmpfs would > not have had these settings if it were written today. It should simply > ignore them, the way that NFS ignores the "intr" mount option now that > we have a better solution to the original problem. > > To reiterate my position: > > - When using tmpfs as a filesystem, it should behave like other > filesystems. > - When using tmpfs to implement MAP_ANONYMOUS | MAP_SHARED, it should > behave like anonymous memory. I do agree with your point to some extent, but the ‘huge=’ option has existed for nearly 8 years, and the huge orders based on write size may not achieve the performance of PMD-sized THP in some scenarios, such as when the write length is consistently 4K. So, I am still concerned that ignoring the 'huge' option could lead to compatibility issues. Another possible choice is to make the huge pages allocation based on write size as the *default* behavior for tmpfs, while marking the 'huge=' option as deprecated and gradually removing it if there are no user complaints about performance issues. Let's also see what Hugh and Kirill think. Hugh, Kirill, do you have any inputs?