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 109B3C3ABAA for ; Fri, 2 May 2025 13:04:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A327E6B0089; Fri, 2 May 2025 09:04:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9BFC06B008A; Fri, 2 May 2025 09:04:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E8386B008C; Fri, 2 May 2025 09:04:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 571CC6B0089 for ; Fri, 2 May 2025 09:04:19 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E577A801D4 for ; Fri, 2 May 2025 13:04:20 +0000 (UTC) X-FDA: 83397986280.25.1F0705E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id 24EE110000C for ; Fri, 2 May 2025 13:04:18 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="NM/fbgtN"; dmarc=pass (policy=quarantine) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of david@redhat.com designates 170.10.129.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=1746191058; 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=b8vA7ufv7rxozbMaS0DZrNFTmwM1zLtlrnDHq+jM2h4=; b=2aCBmbPsQIUH9LReXgNhlgrA2gVbOHKuAnSY7B0QdziD5U7PUmc9PapKKMTzr7A9uPQyAD c3lww4bNdnAhvr/I3CakX858gP2VdPfPoQM8rKkj/oMFHX26oi+aEFa+g+zV2TzeU4wp5T mA8B5VZjJ1+PeXcCjt80wH/u5mCWRNs= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="NM/fbgtN"; dmarc=pass (policy=quarantine) header.from=redhat.com; spf=pass (imf14.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1746191058; a=rsa-sha256; cv=none; b=mlz1Zf0q3hQclOrc3lFiwMHbxVBAVx4gIeE3osZ2z0PeTLAxbPVMJNLyY1x76XvpUypKid 17E+aJgEU3Ww7r3uQJ+Ntd2ooAB2e217EZXV/Nm8b+754ITwwwa1+kFjw0slB1AVjiGQTo Ci/Nr1PXCGYPZDBgW3OJNHA/YyBQHO8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746191057; 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=b8vA7ufv7rxozbMaS0DZrNFTmwM1zLtlrnDHq+jM2h4=; b=NM/fbgtNEz5p1t2PiaDexQn/mRWlcFZIJQNvbglHvA5zVkxd1J6YcADJ+V4bYvieJsbpj4 +/6G3MLsXrIBIJFooSVtksVkAeVy2DV5097mXQQ/9RwXMtGqnPD+O7qIj1msiKSccupj9u 3gfE0LCn/5E67ULoj+RAPnYV07Tu06M= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-349-nrFTxZPjNp2DGMeoN0UpqQ-1; Fri, 02 May 2025 09:04:16 -0400 X-MC-Unique: nrFTxZPjNp2DGMeoN0UpqQ-1 X-Mimecast-MFC-AGG-ID: nrFTxZPjNp2DGMeoN0UpqQ_1746191055 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-3913aea90b4so780150f8f.2 for ; Fri, 02 May 2025 06:04:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746191055; x=1746795855; 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=b8vA7ufv7rxozbMaS0DZrNFTmwM1zLtlrnDHq+jM2h4=; b=L7O/WyNk7oNq9c2ntXioh6+oJ8MWbW1BoFhnSpowjxW+jwroMYeUQP/sWPiNhnLusP TdzUuc/Yl4VvCYdsqyFVXrn/su7Lb3nQed5nevgutcnTjdm4pYtrjsImWNzWyWoQn72d gw+0FGmgP0yMn/yhodZ/SvIRNyST21Kdh2dbEkwKtzTf9t6xij7YkxW7xphJtVGtsngI yWPLZUqza46GDSXqaW2/cjhOSYJMn7BjfMMVRa/YCvQnDarOt/kJ1T43u1NbVFAKJ2n8 PzbLu4QWf2J7PlTcoHSRwQr1JOMNXDOKdlVxasbH55l3/gSC6pw+LgmgG/5sZEmbBNAl JG+w== X-Forwarded-Encrypted: i=1; AJvYcCVzsCJtlHCruqYzD6EFIv10P8tEPKCCTnbVns4Ni2IMaq2CBErIL9rkeg1pUjAiytn8a3ccB7Dpcg==@kvack.org X-Gm-Message-State: AOJu0YxglT8gESZuiLPmgGCM2IxtlXYwPukL34XBbuh5nY+talkHh9PZ 1RxjMmvv/k9quQ6THzTOTEVVl2d6TvGFAfYsfVPF9jAlRNOrakZ2vObFa2q7Q0RwkF3aeLD2uyu 5iLIBnbmTa62BqyKo1zV3T7vXNprhWLb/XBc7szuCo/Igpynt X-Gm-Gg: ASbGncvN1iP6XVHlFC5rQsiK5vsgzGgEo33GNAjScHNkVklxYC9UbfQhqZ1Iw5lX6ZW Z86QxWlyD703hX42B0kN5OYjka5okA2/T3NwEyYMQJFmxFMiB02qS+X6MDw+PTkLjp1nw0eWaNr 7et/6ofhk5q7SfbDqKOaeK7sD+MN18j6to+sAjNKAmvZptDiZYwCxYYNhi6IaL8CfovgmdtchNW vmHYxgX7QQ+eaOUiuhV5TITwTmoL76RDaprz0Zd+91dXyyX8jDJtCxAW4qYbXp0TRUQDlC6g632 J16ACuCW6j6aMRqlFc2ND/zQ2o/33CCorhUZeG7Ugkq1zBVgIC3ieSgI2aP8ZVk7IhcI+Rjni5E brFgzvJ0Y3ARSgsh7ai1J2oFP5Y7sOhEPpTevy7E= X-Received: by 2002:a05:6000:144d:b0:3a0:7a90:23a9 with SMTP id ffacd0b85a97d-3a099ad4749mr1993927f8f.6.1746191055220; Fri, 02 May 2025 06:04:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8jpbSSJEe8gtGnqL+2yrcAlYrtSegOPp0Ofhi+j5di9OzaCw4P4w2wfI1df6wE73kvrTHgg== X-Received: by 2002:a05:6000:144d:b0:3a0:7a90:23a9 with SMTP id ffacd0b85a97d-3a099ad4749mr1993851f8f.6.1746191054546; Fri, 02 May 2025 06:04:14 -0700 (PDT) Received: from ?IPV6:2003:cb:c713:d600:afc5:4312:176f:3fb0? (p200300cbc713d600afc54312176f3fb0.dip0.t-ipconnect.de. [2003:cb:c713:d600:afc5:4312:176f:3fb0]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a099ae3528sm2157932f8f.30.2025.05.02.06.04.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 02 May 2025 06:04:14 -0700 (PDT) Message-ID: <4883bdec-f7f2-4350-bf72-f0fa75c9ddd5@redhat.com> Date: Fri, 2 May 2025 15:04:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/4] mm, bpf: BPF based THP adjustment To: Yafang Shao , Zi Yan Cc: Gutierrez Asier , Johannes Weiner , "Liam R. Howlett" , akpm@linux-foundation.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, Baolin Wang , Lorenzo Stoakes , Nico Pache , Ryan Roberts , Dev Jain , bpf@vger.kernel.org, linux-mm@kvack.org, Michal Hocko References: <20250429024139.34365-1-laoar.shao@gmail.com> <42ECBC51-E695-4480-A055-36D08FE61C12@nvidia.com> <8F000270-A724-4536-B69E-C22701522B89@nvidia.com> <20250430174521.GC2020@cmpxchg.org> <84DE7C0C-DA49-4E4F-9F66-E07567665A53@nvidia.com> <6850ac3f-af96-4cc6-9dd0-926dd3a022c9@huawei-partners.com> <3006EA5B-3E02-4D82-8626-90735FE8F656@nvidia.com> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9F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SxUEADIPQTPNvBewdeI80yeOCrN+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-MFC-PROC-ID: qc5i8nGJ34i3qyI0EwvPsKHxG24CYo1Vi_AYKAD70R4_1746191055 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Stat-Signature: b56t9qmqcqdnuacerxhr14h5fcbank98 X-Rspamd-Queue-Id: 24EE110000C X-Rspam-User: X-Rspamd-Server: rspam05 X-HE-Tag: 1746191058-555305 X-HE-Meta: U2FsdGVkX19Lt1c0Se13TqjMqfpkAN3vJaMbYnU5+CRCHEdlXCgJUdmOTPTxxA+v9X/iXE1UduqK5bPkaFGoxPSh7Tut8IizLjfZnyvz44X4ttc+ZWuiTw+gUM2KpQwGRtHPMemdoAF8iiPv/DvcD41lJkpHEabJ9GwZwfyH20Dr+ikSXhUW9/w5ldIxeAWROoSq0xLZSCr//55eD2K7UFzQEOl158M7z33rUbTkL0opNF7HmFWqZAS0c14zKF4pGTLV9PwbrNM1v7gwRWCuK8Qe/C+/Eidfp2yDGWwQnRlX7VTapCzX7rNYg1FXAyHCEWbgoWl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7AwXhcgzIH7icpx+raZ/qa0oenMtwJrk74zrHQduqfQTb7bwWwAHR+RRDpSfPsIbfXnyOIVo+qQKDO3WpxkxI7yvGt+JlG+UYKO65XbW/xUoq4GuOtrG4Y8PNeOfF/daRflcg1nBa2aXec4cgaLcj7442VyAGzptQnm2cOFGGkbEbmkLwI6PHBJyKVo7gnIH8tbveFmgTO5AHiAnOhAky1mwFJSqkYqGQk3t 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 02.05.25 14:18, Yafang Shao wrote: > On Fri, May 2, 2025 at 8:00 PM Zi Yan wrote: >> >> On 2 May 2025, at 1:48, Yafang Shao wrote: >> >>> On Fri, May 2, 2025 at 3:36 AM Gutierrez Asier >>> wrote: >>>> >>>> >>>> On 4/30/2025 8:53 PM, Zi Yan wrote: >>>>> On 30 Apr 2025, at 13:45, Johannes Weiner wrote: >>>>> >>>>>> On Thu, May 01, 2025 at 12:06:31AM +0800, Yafang Shao wrote: >>>>>>>>>> If it isn't, can you state why? >>>>>>>>>> >>>>>>>>>> The main difference is that you are saying it's in a container that you >>>>>>>>>> don't control. Your plan is to violate the control the internal >>>>>>>>>> applications have over THP because you know better. I'm not sure how >>>>>>>>>> people might feel about you messing with workloads, >>>>>>>>> >>>>>>>>> It’s not a mess. They have the option to deploy their services on >>>>>>>>> dedicated servers, but they would need to pay more for that choice. >>>>>>>>> This is a two-way decision. >>>>>>>> >>>>>>>> This implies you want a container-level way of controlling the setting >>>>>>>> and not a system service-level? >>>>>>> >>>>>>> Right. We want to control the THP per container. >>>>>> >>>>>> This does strike me as a reasonable usecase. >>>>>> >>>>>> I think there is consensus that in the long-term we want this stuff to >>>>>> just work and truly be transparent to userspace. >>>>>> >>>>>> In the short-to-medium term, however, there are still quite a few >>>>>> caveats. thp=always can significantly increase the memory footprint of >>>>>> sparse virtual regions. Huge allocations are not as cheap and reliable >>>>>> as we would like them to be, which for real production systems means >>>>>> having to make workload-specifcic choices and tradeoffs. >>>>>> >>>>>> There is ongoing work in these areas, but we do have a bit of a >>>>>> chicken-and-egg problem: on the one hand, huge page adoption is slow >>>>>> due to limitations in how they can be deployed. For example, we can't >>>>>> do thp=always on a DC node that runs arbitary combinations of jobs >>>>>> from a wide array of services. Some might benefit, some might hurt. >>>>>> >>>>>> Yet, it's much easier to improve the kernel based on exactly such >>>>>> production experience and data from real-world usecases. We can't >>>>>> improve the THP shrinker if we can't run THP. >>>>>> >>>>>> So I don't see it as overriding whoever wrote the software running >>>>>> inside the container. They don't know, and they shouldn't have to care >>>>>> about page sizes. It's about letting admins and kernel teams get >>>>>> started on using and experimenting with this stuff, given the very >>>>>> real constraints right now, so we can get the feedback necessary to >>>>>> improve the situation. >>>>> >>>>> Since you think it is reasonable to control THP at container-level, >>>>> namely per-cgroup. Should we reconsider cgroup-based THP control[1]? >>>>> (Asier cc'd) >>>>> >>>>> In this patchset, Yafang uses BPF to adjust THP global configs based >>>>> on VMA, which does not look a good approach to me. WDYT? >>>>> >>>>> >>>>> [1] https://lore.kernel.org/linux-mm/20241030083311.965933-1-gutierrez.asier@huawei-partners.com/ >>>>> >>>>> -- >>>>> Best Regards, >>>>> Yan, Zi >>>> >>>> Hi, >>>> >>>> I believe cgroup is a better approach for containers, since this >>>> approach can be easily integrated with the user space stack like >>>> containerd and kubernets, which use cgroup to control system resources. >>> >>> The integration of BPF with containerd and Kubernetes is emerging as a >>> clear trend. >>> >>>> >>>> However, I pointed out earlier, the approach I suggested has some >>>> flaws: >>>> 1. Potential polution of cgroup with a big number of knobs >>> >>> Right, the memcg maintainers once told me that introducing a new >>> cgroup file means committing to maintaining it indefinitely, as these >>> interface files are treated as part of the ABI. >>> In contrast, BPF kfuncs are considered an unstable API, giving you the >>> flexibility to modify them later if needed. >>> >>>> 2. Requires configuration by the admin >>>> >>>> Ideally, as Matthew W. mentioned, there should be an automatic system. >>> >>> Take Matthew’s XFS large folio feature as an example—it was enabled >>> automatically. A few years ago, when we upgraded to the 6.1.y stable >>> kernel, we noticed this new feature. Since it was enabled by default, >>> we assumed the author was confident in its stability. Unfortunately, >>> it led to severe issues in our production environment: servers crashed >>> randomly, and in some cases, we experienced data loss without >>> understanding the root cause. >>> >>> We began disabling various kernel configurations in an attempt to >>> isolate the issue, and eventually, the problem disappeared after >>> disabling CONFIG_TRANSPARENT_HUGEPAGE. As a result, we released a new >>> kernel version with THP disabled and had to restart hundreds of >>> thousands of production servers. It was a nightmare for both us and >>> our sysadmins. >>> >>> Last year, we discovered that the initial issue had been resolved by this patch: >>> https://lore.kernel.org/stable/20241001210625.95825-1-ryncsn@gmail.com/. >>> We backported the fix and re-enabled XFS large folios—only to face a >>> new nightmare. One of our services began crashing sporadically with >>> core dumps. It took us several months to trace the issue back to the >>> re-enabled XFS large folio feature. Fortunately, we were able to >>> disable it using livepatch, avoiding another round of mass server >>> restarts. To this day, the root cause remains unknown. The good news >>> is that the issue appears to be resolved in the 6.12.y stable kernel. >>> We're still trying to bisect which commit fixed it, though progress is >>> slow because the issue is not reliably reproducible. >> >> This is a very wrong attitude towards open source projects. You sounded >> like, whether intended or not, Linux community should provide issue-free >> kernels and is responsible for fixing all issues. But that is wrong. >> Since you are using the kernel, you could help improve it like Kairong >> is doing instead of waiting for others to fix the issue. >> >>> >>> In theory, new features should be enabled automatically. But in >>> practice, every new feature should come with a tunable knob. That’s a >>> lesson we learned the hard way from this experience—and perhaps >>> Matthew did too. >> >> That means new features will not get enough testing. People like you >> will just simply disable all new features and wait for they are stable. >> It would never come without testing and bug fixes. We do have the concept of EXPERIMENTAL kernel configs, that are either expected get removed completely ("always enabled") or get turned into actual long-term kernel options. But yeah, it's always tricky what we actually want to put behind such options. I mean, READ_ONLY_THP_FOR_FS is still around and still EXPERIMENTAL ... Distro kernels are usually very careful about what to backport and what to support. Once we (working for a distro) do backport + test, we usually find some additional things that upstream hasn't spotted yet: in particular, because some workloads are only run in that form on distro kernels. We also ran into some issues with large folios (e.g., me personally with s390x KVM guests) and trying our best to fix them. It can be quite time consuming, so I can understand that not everybody has the time to invest into heavy debugging, especially if it's extremely hard to reproduce (or even corrupts data :( ). I agree that adding a toggle after the effects to work around issues is not the right approach. Introducing a EXPERIMENTAL toggle early because one suspects complicated interactions in a different story. It's absolutely not trivial to make that decision. > > Pardon me? > This discussion has taken such an unexpected turn that I don’t feel > the need to explain what I’ve contributed to the Linux community over > the past few years. I'm sure Zi Yan didn't mean to insult you. I would have phrased it as: "It's difficult to decide which toggles make sense. There is a fine line between adding a toggle and not getting people actually testing it to stabilize it vs. not adding a toggle and forcing people to test it and fix it/report issues." Ideally, we'd find most issue in the RC phase or at least shortly after. You've been active in the kernel for a long time, please don't feel like the community is not appreciating that. -- Cheers, David / dhildenb