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 EB944D1AD5E for ; Wed, 16 Oct 2024 13:45:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 834686B0089; Wed, 16 Oct 2024 09:45:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E5A46B008A; Wed, 16 Oct 2024 09:45:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6ACA56B0092; Wed, 16 Oct 2024 09:45:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4DEEA6B0089 for ; Wed, 16 Oct 2024 09:45:32 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 77DAC80319 for ; Wed, 16 Oct 2024 13:45:23 +0000 (UTC) X-FDA: 82679587368.27.066A3CA Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf04.hostedemail.com (Postfix) with ESMTP id 2729440022 for ; Wed, 16 Oct 2024 13:45:17 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729086297; a=rsa-sha256; cv=none; b=GqBCp01uRhVoqJoNVMlZVjT2W1Gu6eImXvYESvXI95hhe2si54DUdqIWEVaLJp3/2krcEl GZWlwoXbOhH6Vlv1XVLhSPcSqFroukPcCaHy0kUvTTaZrcNvkap8KLZCSBObBf8dPaP0/a 98KTwFTENRCSWsNmROjICIePNq9K/Zs= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf04.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729086297; 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; bh=5akEblEfrQ4F65acGXyAmRtObD5wQoMMd70Sd0Olf8A=; b=xPWt/vinh2BxEI3AQLMN75lC0CdnisxlqlHT+1yXxygTM48pa4XtFRc6o3UZ8l13Zbg+hA DpJIQOUzWCUhd7THq2kMY0/3IqGGlRrHB1Z7Xs6+w1C9rJkHLT69m52x+GdH6mPtChvKVC xjeMhGlA3f/gq/JSd9NxbHum9FnrqWI= Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4XTBxw3ZtZz18N5p; Wed, 16 Oct 2024 21:43:32 +0800 (CST) Received: from dggpemf100008.china.huawei.com (unknown [7.185.36.138]) by mail.maildlp.com (Postfix) with ESMTPS id 2B1071401E0; Wed, 16 Oct 2024 21:45:25 +0800 (CST) Received: from [10.174.177.243] (10.174.177.243) by dggpemf100008.china.huawei.com (7.185.36.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Wed, 16 Oct 2024 21:45:24 +0800 Message-ID: <6457b1fa-9afd-4552-ae5b-3a0379bcc3e5@huawei.com> Date: Wed, 16 Oct 2024 21:45:24 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v3 0/4] Support large folios for tmpfs To: Baolin Wang , , CC: , , <21cnbao@gmail.com>, , , , , References: <007880ac-d73f-4eef-9978-a4f844338522@huawei.com> <584662fb-cb1f-4b2c-9075-f70d31473c9d@linux.alibaba.com> Content-Language: en-US From: Kefeng Wang In-Reply-To: <584662fb-cb1f-4b2c-9075-f70d31473c9d@linux.alibaba.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemf100008.china.huawei.com (7.185.36.138) X-Rspam-User: X-Stat-Signature: o3zd4ydgeqhiwqtx89zyxm4t78cp4nrs X-Rspamd-Queue-Id: 2729440022 X-Rspamd-Server: rspam02 X-HE-Tag: 1729086317-586585 X-HE-Meta: U2FsdGVkX19Q6DNFmHIv1hUvOLPhrOoqXFPIiThkiOrnSI6mEcHnjMBPgPDsgDpIsSXONFSlLRHbV6++iiFKG+J3L9LzbP0hI+mR53TbCsLcmZZ/HolXYo1yIBYnVLL7HQ1n4OQgV4UqgIkLid1g35gfoquZY0aniz8/hpXmlNCnhJUqnM6wXTBNOvAbkjL1pSAjr+mG1wXvPq4N6z+f7MkGxjLuQ3jvSiq6IKQHZA7t8O1gSi10nOvmr1gejwVFc8K/z45VVP90S5y0HHmDMEUPPe0xTQ/dNqGrcoSgHuhL0aE6gRi2gUrYW8Pxu0p/y1cTPgEheX2JrMS5kbElb2Bd1MbpnADeQX2SWBeGnb8wjELDbq0A/iIh1oHeIiJQbAYbTwBsZ5+ZpXJihWwYiI8xeG6MNSmOaLDU38ky4n1WA2bSrUW0ddR9ZcvwiZJ87iLtOZqEnLaEt5/SXtOkPh2zjrOR1wpHpV9da/Aaw7ehKw9ythMONvw22XBB3Qei1/UekyNUd1jRAfpHVt4Yhade3qGrps2bSRXA2Wl0X/VK0eNLnS36VCfhxLvf+IK4aMO9nHIfP40NSU7yHTEAkOltM8JiBjloAbXTlqXJZiq9LCFKCPn+LLR4Qn0KxWyHTovNYzkmWoJPFZQbdD+TZOjIWAWBKzuiHFeKfAkgwlIG02+aX6EqcvS3OfsosxK3CJ69ZzuVbMqY4v7eQ0iBxCtjEwp9UYrrJ4T6u+cs0M/g9oWYDKAQa2jc5A2KDI6aHIE2ZzsLg+3a1+kM9Iid33p+3TriLiusb5Z38MmTYLbbTPu6/6I/+UehOqTbUUKrSnt8uXOZDjqzSdeYBr3WJv9fSr4sHDH01unrXr8OHeHOlg2/XV43r1VyfSA3m3egvbbwVafVD5FLmY6j4se/6PKSq/MtbLNG2dU9OrzRLN58V8NjCFpG9bhJMHRAqdW5Mc+BuaAWTKli3pBWyf3 iLn91Hxh 0JRAO4YoUb+yiPL7SB0B8GfRw5XKrPgHMA7VRNWhzuQyl7iZqcREKqa8MOwFYwIgq2gO2kTKxSJtzlxW/V+JzlE1ilwR2QH5dRuOyRyDbB9Jk6qvGWiPVvMZX3k+TR+MhjkeH3osN+vcWbOnv7g3U5zVxM5Za5zq0eBZLwHTm+X09tgo= 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: On 2024/10/16 17:29, Baolin Wang wrote: > > > On 2024/10/16 15:49, Kefeng Wang wrote: >> >> >> On 2024/10/10 17:58, Baolin Wang wrote: >>> Hi, >>> >>> This RFC patch series attempts to support large folios for tmpfs. >>> >>> 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'. >>> >>> Add a new huge option 'write_size' to support large folio allocation >>> based >>> on the write size for tmpfs write and fallocate paths. So the huge pages >>> allocation strategy for tmpfs is that, if the 'huge=' option >>> (huge=always/within_size/advise) is enabled or the 'shmem_enabled' >>> option >>> is 'force', it need just allow PMD sized THP to keep backward >>> compatibility >>> for tmpfs. While 'huge=' option is disabled (huge=never) or the >>> 'shmem_enabled' >>> option is 'deny', it will still disable any large folio allocations. >>> Only >>> when the 'huge=' option is 'write_size', it will allow allocating large >>> folios based on the write size. >>> >>> And I think the 'huge=write_size' option should be the default behavior >>> for tmpfs in future. >> >> Could we avoid new huge= option for tmpfs, maybe support other orders >> for both read/write/fallocate if mount with huge? > > Um, I am afraid not, as that would break the 'huge=' compatibility. That > is to say, users still want PMD-sized huge pages if 'huge=always'. Yes, compatibility maybe an issue, but only write/fallocate side support large folio is a little strange, maybe a new mode to support both read/ write/fallocate?