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 15E38D149EF for ; Fri, 25 Oct 2024 20:21:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9D25A6B0082; Fri, 25 Oct 2024 16:21:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A9396B0083; Fri, 25 Oct 2024 16:21:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 822CC6B0085; Fri, 25 Oct 2024 16:21:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 661586B0082 for ; Fri, 25 Oct 2024 16:21:48 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8C8C3121094 for ; Fri, 25 Oct 2024 20:21:29 +0000 (UTC) X-FDA: 82713245034.16.8EBFE95 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 8488E40019 for ; Fri, 25 Oct 2024 20:21:17 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Bf1PDzEX; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729887535; 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=hmWrcQHrubijNgrM9wcac0zcqNDx1DJ/kwEtlOjPgl0=; b=a66QvGC+e8T/Tt3VZtUPaAgqrIyixF7Hp0ipU7k2MYj2nrScyo74nScSHxVoaetGOfO0Uv +eDyBc/4fd0jU6wxyCjFxsePhqsoUGRAdv3Hg2xgf1UztD2+vGBkxudMvWr9fRTm6yLfP0 a6Bab3kKj8TGqk/6g3lcNKYU+1VJ77U= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729887535; a=rsa-sha256; cv=none; b=sw4X/qn0uS5qqZ6FbtYm0mLb9E8gaXLysylZHvI89tUjopNXTFocegdGnw8/1pDqUaJODo oVFtvWFuWtqvrWio7vcLjrRDvcXo0KxHjVZI5fMpSQVlkr32/kboO+5AnRnYoI7MSVkhTu 65+3uIFGQ89YYd4o71yAzTDMHq4kvuU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Bf1PDzEX; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf07.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729887704; h=from:from: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:autocrypt:autocrypt; bh=hmWrcQHrubijNgrM9wcac0zcqNDx1DJ/kwEtlOjPgl0=; b=Bf1PDzEXsNGMl+7mYfBocfbwIrXWgIMszDk7vuBIxuYdB5D8fMKJX7mtofLyvLVmZvA4pM WywlDVKhIFScCUXkpIUEWxJI+JZg7viMLPEJdwjmS7Ja9ZORAfahGs/fcqltqhTMdjySts 4RpvUIxJ3vSQnmHafuu8baE8Wq+0mzs= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-690-wBn9ci6vMxiPuZy9-o2MfQ-1; Fri, 25 Oct 2024 16:21:43 -0400 X-MC-Unique: wBn9ci6vMxiPuZy9-o2MfQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4314f1e0f2bso16838025e9.1 for ; Fri, 25 Oct 2024 13:21:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729887702; x=1730492502; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:from:references:cc:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=hmWrcQHrubijNgrM9wcac0zcqNDx1DJ/kwEtlOjPgl0=; b=OVB3wmYP+OIkoxI3lakIpxkP9WGzb9Q9dZXbZnaL1i7jVy3qkREcO8N+M+3sTbVgMr Uas7iTg4B5ExXJW5qwtM7k08qKfYxj1ErbYKLaV8zG34N7Usq0irZOZWEQG4Qkj9IfZ4 3U4+0eQBG4Lx5lNq1PljUsump+N76+eRI9Zh3KGoxtDHeZoimjzw4arUO15p6WQr1gA5 D4aiCvCr8xDSSA2ba4md7coJ6B0CcAy5T74eWGbCZjp/RwQtSalcCSOSHSryOPBQJDbP oH6qiSK36zrKAc92j4nU4mIeNniLk2I5CkUrjR3aTP7VsNMPU8dq1Foou1WUbHYj6K4j eNfw== X-Forwarded-Encrypted: i=1; AJvYcCUeVXf4Y2/jXdZEpYgk7vrDvKQfQ6zU4my0KdfI6mvjP6vSbmO8U9kd1NuSAgLO/Mi4Ty912y3l1g==@kvack.org X-Gm-Message-State: AOJu0YzHkTWi+yNO/OnfcRCIYnuMVj7s/JK8+j07nFqalcdv0qXr6WCE hQ5h/jZN0qIPjg5zvbcX/5GfFp48nOdkPS5F2s4glxzcuqz3eJdainxXdYvGlq+2p26v1PIt17v XZMHuZPxetpey6cwe9DfIPhpRnLNbwqAFp8Xnj/sZGtlv5GTV X-Received: by 2002:a05:600c:1549:b0:42f:8fcd:486c with SMTP id 5b1f17b1804b1-4319ad368e9mr2619905e9.33.1729887702152; Fri, 25 Oct 2024 13:21:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEjbnvAVlxjKP31jhI5Ajyw0uuqVffbfOd63N2W36Mf/XLghH9Cw7ZLJelowlHanECV71TPrg== X-Received: by 2002:a05:600c:1549:b0:42f:8fcd:486c with SMTP id 5b1f17b1804b1-4319ad368e9mr2619785e9.33.1729887701689; Fri, 25 Oct 2024 13:21:41 -0700 (PDT) Received: from ?IPV6:2003:cb:c70d:d800:499c:485a:c734:f290? (p200300cbc70dd800499c485ac734f290.dip0.t-ipconnect.de. [2003:cb:c70d:d800:499c:485a:c734:f290]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b57b472sm59534015e9.43.2024.10.25.13.21.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Oct 2024 13:21:40 -0700 (PDT) Message-ID: Date: Fri, 25 Oct 2024 22:21:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v3 0/4] Support large folios for tmpfs To: Daniel Gomez , Baolin Wang , Daniel Gomez , "Kirill A. Shutemov" Cc: Matthew Wilcox , akpm@linux-foundation.org, hughd@google.com, wangkefeng.wang@huawei.com, 21cnbao@gmail.com, ryan.roberts@arm.com, ioworker0@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" References: <6dohx7zna7x6hxzo4cwnwarep3a7rohx4qxubds3uujfb7gp3c@2xaubczl2n6d> <8e48cf24-83e1-486e-b89c-41edb7eeff3e@linux.alibaba.com> <486a72c6-5877-4a95-a587-2a32faa8785d@redhat.com> <7eb412d1-f90e-4363-8c7b-072f1124f8a6@linux.al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K7wUUjDilPQ5QMzIuCL4YjVoylWiBNknvQWBXS lQCWmavOT9sttGQXdPCC5ynI+1ymZC1ORZKANLnRAb0NH/UCzcsstw2TAkFnMEbo9Zu9w7Kv AxBQXWeXhJI9XQssfrf4Gusdqx8nPEpfOqCtbbwJMATbHyqLt7/oz/5deGuwxgb65pWIzufa N7eop7uh+6bezi+rugUI+w6DABEBAAHCwXwEGAEIACYCGwwWIQQb2cqtc1xMOkYN/MpN3hD3 AP+DWgUCXw7HsgUJEqkpoQAKCRBN3hD3AP+DWrrpD/4qS3dyVRxDcDHIlmguXjC1Q5tZTwNB boaBTPHSy/Nksu0eY7x6HfQJ3xajVH32Ms6t1trDQmPx2iP5+7iDsb7OKAb5eOS8h+BEBDeq 3ecsQDv0fFJOA9ag5O3LLNk+3x3q7e0uo06XMaY7UHS341ozXUUI7wC7iKfoUTv03iO9El5f XpNMx/YrIMduZ2+nd9Di7o5+KIwlb2mAB9sTNHdMrXesX8eBL6T9b+MZJk+mZuPxKNVfEQMQ a5SxUEADIPQTPNvBewdeI80yeOCrN+Zzwy/Mrx9EPeu59Y5vSJOx/z6OUImD/GhX7Xvkt3kq Er5KTrJz3++B6SH9pum9PuoE/k+nntJkNMmQpR4MCBaV/J9gIOPGodDKnjdng+mXliF3Ptu6 3oxc2RCyGzTlxyMwuc2U5Q7KtUNTdDe8T0uE+9b8BLMVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 8488E40019 X-Stat-Signature: ss1bi6ssxqs61cu67xpb3nk4teyghdcd X-Rspam-User: X-HE-Tag: 1729887677-594652 X-HE-Meta: U2FsdGVkX18C0eVEI615c/NlUZNNCCQiHOmlrOFLUTwPJBCYE9TEfLXdj0gp45ksKsFheFsH5Z+rm6dGuoKqq3+ZVIYyFGfGfarQnlxK2mIUieOvqabW0YjQcpLID3bck3dJgcprLNzB12d4GoMsxkVXvvMElXLqUcQxjiAX1Ilm5kDsm56NsPaHCfawGENmTjQuiD9YsNajhN6wruIQaCtLM7gfhZ6mbU5U2GnoEL1B+18+lRPbaKmgXaxxUZWeZzko63Qb8n1EEE8AFT8k0YcIPlu5YzQ98RoE8xvPSRFJ1mfqFZKYhbtZOv1C1jO8LICwhMot9WJFUYPLdB3GolZ69LGouyJwjyMqslz2oz4wfT6WF247/VRm+sTfqFA2oZvIguK1DbWBww84Qrybf9oSs+XpvNoUecJ7tAxQfg25NDn1REq9TZ+XYmg51458smc87v9F+QMfRW5ZML0Bam307FQzZ4i4Q6TpEyBcPOrJf4rVn1xXt2JffyYclPZU0kHOMKofErjmumjgrqZIpnXcTBlAbMYWe7FOiUU1VYDUowPf5F672h1ghlFESqkmsVHBq741JCDnhUDaojrzfRa9B03u/cyD+cH5QQs/o6n4XahN1y5wPDo9e4x+uKv4J4pLllh11Jol5/ZYwAgiMMRfwpgKVLlh0lh/yfSVa25H8Ao6qM+OgzdNXR0QE12ETnUEKivQm2q+Do6yCN7IkENr6A5XeXqpCV4BSlfqHs4BSzbspudazCP/PLTuF4aqNJbSeO1YZeJWjh2JYT7vS9B8zA4VHydOo/e3OjRkFbrXaFm5FnusXMfdVxHyfWqdOoFXHdFu7ZQNkHH+FKeJ+F0PGjTyK4z48fExZSPoV/9sRrkOKMpUmqFjIFuQz2gnxAa1ukNaxpg+xYMhePuiR0M+erJX7RFe5u9zaLRT2nc+2Z3+sbWrSZg7Y3cF3wnFhOjvmNU/R2Bw97zoPx4 AH4KBIjz PYY8f1elQhr6vnZqnE7skY6/38I+c7j/xVq5L0sOsPiim7JzevYwj0z0rXS5LCjk6mQy+7Tvn59r5EhnYptHyKiCO4w4mc3GzJ1gzvte01YMc1K7upukZcfAcq0R2zlJ2tR7hpt1QGvZmbLuxePgU0cSyOZ4zSItJ3zOb5pt8lJoQQBkbq+sQRfzFKR1mC4AC56SKQZYkX2seH3vz9zDpIRCah864SSoojByzIqlhfGo0Yzbm9KFrv0QexeUtQWVFZ4r4Iff7X25Qdhj3yi6C8rPVxK5kyQMm6YEGstb02YTA1cd6nx24ROsLfTUOblSyBaALIXq4hCY2z/LHHYBZVV46dwBH8PFnNhsOBxcL5SwidMxcCxq8UdG9vzmydCEzsNYVUbaViqa53rMkZ9lsFzUkVA== 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: Sorry for the late reply! >>>>> IMHO, as I discussed with Kirill, we still need maintain compatibility >>>>> with the 'huge=' mount option. This means that if 'huge=never' is set >>>>> for tmpfs, huge page allocation will still be prohibited (which can >>>>> address Hugh's request?). However, if 'huge=' is not set, we can >>>>> allocate large folios based on the write size. > > So, in order to make tmpfs behave like other filesystems, we need to > allocate large folios by default. Not setting 'huge=' is the same as > setting it to 'huge=never' as per documentation. But 'huge=' is meant to > control THP, not large folios, so it should not have a conflict here, or > else, what case are you thinking? I think we really have to move away from "huge/thp == PMD", that's a historical artifact. Everything else will simply be inconsistent and confusing in the future -- and I don't see any real need for that. For anonymous memory and anon shmem we managed the transition. (there is a longer writeup from me about this topic, so I won't go into detail). I think I raised this in the past, but tmpfs/shmem is just like any other file system .. except it sometimes really isn't and behaves much more like (swappable) anonymous memory. (or mlocked files) There are many systems out there that run without swap enabled, or with extremely minimal swap (IIRC until recently kubernetes was completely incompatible with swapping). Swap can even be disabled today for shmem using a mount option. That's a big difference to all other file systems where you are guaranteed to have backend storage where you can simply evict under memory pressure (might temporarily fail, of course). I *think* that's the reason why we have the "huge=" parameter that also controls the THP allocations during page faults (IOW possible memory over-allocation). Maybe also because it was a new feature, and we only had a single THP size. There is, of course also the "fallocate() might not free up memory if there is an unexpected reference on the page because splitting it will fail" problem, that even exists when not over-allocating memory in the first place ... So ...I don't think tmpfs behaves like other file system in some cases. And I don't think ignoring these points is a good idea. Fortunately I don't maintain that code :) If we don't want to go with the shmem_enabled toggles, we should probably still extend the documentation to cover "all THP sizes", like we did elsewhere. huge=never: no THPs of any size huge=always: THPs of any size (fault/write/etc) huge=fadvise: like "always" but only with fadvise/madvise huge=within_size: like "fadvise" but respect i_size We could think about adding a "nowaste" extension and try make it the default. For example "huge=always:nowaste: THPs of any size as long as we don't over-allocate memory (write)" The sysfs toggles have their beauty as well and could be useful (I'm pretty sure they will be useful :) ): "huge=always;sysfs": THPs of any size (fault/write/etc) as configured in sysfs. Too many options here to explore, too little time I have to spend on this. Just to throw out some ideas. What I can really suggest is not making this one of the remaining interfaces where "huge" means "PMD-sized" once other sizes exist. > >>>> >>>> I consider allocating large folios in shmem/tmpfs on the write path less >>>> controversial than allocating them on the page fault path -- especially >>>> as long as we stay within the size to-be-written. >>>> >>>> I think in RHEL THP on shmem/tmpfs are disabled as default (e.g., >>>> shmem_enabled=never). Maybe because of some rather undesired >>>> side-effects (maybe some are historical?): I recall issues with VMs with >>>> THP+ memory ballooning, as we cannot reclaim pages of folios if >>>> splitting fails). I assume most of these problematic use cases don't use >>>> tmpfs as an ordinary file system (write()/read()), but mmap() the whole >>>> thing. >>>> >>>> Sadly, I don't find any information about shmem/tmpfs + THP in the RHEL >>>> documentation; most documentation is only concerned about anon THP. >>>> Which makes me conclude that they are not suggested as of now. >>>> >>>> I see more issues with allocating them on the page fault path and not >>>> having a way to disable it -- compared to allocating them on the write() >>>> path. >>> >>> I may not understand your issues. IIUC, you can disable allocating huge >>> pages on the page fault path by using the 'huge=never' mount option or >>> setting shmem_enabled=deny. No? >> >> That's what I am saying: if there is some way to disable it that will >> keep working, great. > > I agree. That aligns with what I recall Hugh requested. However, I > believe if that is the way to go, we shouldn't limit it to tmpfs. > Otherwise, why should tmpfs be prevented from allocating large folios if > other filesystems in the system are allowed to allocate them? See above. On systems without/little swap you might not want them for shmem/tmpfs, but would happily use them elsewhere. The "write() won't waste memory" case is really interesting, the "fallocate cannot free the memory" still exists. A shrinker might help. -- Cheers, David / dhildenb