From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) (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 4A92F2556E for ; Sun, 26 Apr 2026 06:00:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777183248; cv=none; b=Znfax+opEmi92o3kEMwfEB/5R2D0MgsBgUjMrVkp51IKHH2tHmP3OvRz0YmZh8UhDhMb3WWBT45pQ+LJAVAsyo0d/dU0lJIJ1v9iq6B70EBH7DLgRayNyIrQaQKcnY/3+uJBB59i4Bg7wr71yE8rUTDBv6gyKAFHBDNoGb89nGY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777183248; c=relaxed/simple; bh=AhfAZbe/q09J/SIG4oVMVCkvhpThebubuOyBLFNPa38=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TP5Eh8/bzQN4QzOuUnJKQC0woJzFqKPD0e1zC79xxC3/mLToR95Nd5JQ6WQhxoIcocTmCdgnFXN1tOgEiQwEDMs6wRMYdoPbimJTM4NNWeVjUu+GdUE5in2sTVuOrE4rFrKmzqJqP6BSh8J9P6X5TIji/rhiJecUxtJGRIPPeYU= 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=jTUM1K97; arc=none smtp.client-ip=115.124.30.124 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="jTUM1K97" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1777183242; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=O7hla+waPd4X+8cmZRfq3UTNBtiWb6lpCkJ8BRZsSoQ=; b=jTUM1K97D8MRYNqjTtTlPgsQgUJRxcilUaIiY/3Uovtk0sGKlqqpbySs9unea8nQrtXISRsz9Rw9rsfD8CxKfooY10MuMqKEFPkxlE8VqZKWZsgXMGtDRtrPkWYmKo0UzcwG4OjoKE47Es/E0DEu/cBrdRBtuQvqvsOkrzRMogY= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037026112;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0X1gM7MC_1777182923; Received: from 192.168.0.100(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0X1gM7MC_1777182923 cluster:ay36) by smtp.aliyun-inc.com; Sun, 26 Apr 2026 13:55:23 +0800 Message-ID: Date: Sun, 26 Apr 2026 13:55:22 +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] Revert "tmpfs: don't enable large folios if not supported" To: "David Hildenbrand (Arm)" , akpm@linux-foundation.org, hughd@google.com Cc: willy@infradead.org, ziy@nvidia.com, ljs@kernel.org, lance.yang@linux.dev, wangkefeng.wang@huawei.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/23/26 9:20 PM, David Hildenbrand (Arm) wrote: > On 4/23/26 03:41, Baolin Wang wrote: >> This reverts commit 5a90c155defa684f3a21f68c3f8e40c056e6114c. >> >> Currently, when shmem mounts are initialized, they only use 'sbinfo->huge' to >> determine whether the shmem mount supports large folios. However, for anonymous >> shmem, whether it supports large folios can be dynamically configured via sysfs >> interfaces, so setting or not setting mapping_set_large_folios() during initialization >> cannot accurately reflect whether anonymous shmem actually supports large folios, >> which has already caused some confusion[1]. >> >> Moreover, for tmpfs mounts, relying on 'sbinfo->huge' cannot keep the mapping_set_large_folios() >> setting consistent across all mappings in the entire tmpfs mount. In other words, >> under the same tmpfs mount, after remount, we might end up with some mappings >> supporting large folios (calling mapping_set_large_folios()) while others don't. >> >> After some investigation, I found that the write performance regression addressed >> by commit 5a90c155defa has already been fixed by the following commit 665575cff098b >> ("filemap: move prefaulting out of hot write path"). See the following test data: >> >> Base: >> dd if=/dev/zero of=/mnt/tmpfs/test bs=400K count=10485 (3.2 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=800K count=5242 (3.2 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=1600K count=2621 (3.1 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=2200K count=1906 (3.0 GB/s ) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=3000K count=1398 (3.0 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=4500K count=932 (3.1 GB/s) >> >> Base + revert 5a90c155defa: >> dd if=/dev/zero of=/mnt/tmpfs/test bs=400K count=10485 (3.3 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=800K count=5242 (3.3 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=1600K count=2621 (3.2 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=2200K count=1906 (3.1 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/testbs=3000K count=1398 (3.0 GB/s) >> dd if=/dev/zero of=/mnt/tmpfs/test bs=4500K count=932 (3.1 GB/s) >> >> The data is basically consistent with minor fluctuation noise. So we can now >> safely revert commit 5a90c155defa to set mapping_set_large_folios() for all >> shmem mounts unconditionally. >> >> [1] https://lore.kernel.org/all/ec927492-4577-4192-8fad-85eb1bb43121@linux.alibaba.com/ >> Signed-off-by: Baolin Wang >> --- >> Note: for more investigation and test data, see: >> https://lore.kernel.org/all/116df9f9-4db7-40d4-a4a4-30a87c0feffa@linux.alibaba.com/ > > > Maybe add that as > > Link: https://lore.kernel.org/all/116df9f9-4db7-40d4-a4a4-30a87c0feffa@linux.alibaba.com/ > > above? Sure. And I noticed that Andrew has already helped add this link. Thanks Andrew! > Acked-by: David Hildenbrand (Arm) Thanks.