Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3692567rdh; Tue, 28 Nov 2023 00:47:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEt9FQS3aPwv1ZiSwFHXv/EATroyGnYT3EV3d2rtndDPiraJYEWgkQr0S9EIqGVBkK8W8sX X-Received: by 2002:a05:6808:8c2:b0:3b2:c242:aaee with SMTP id k2-20020a05680808c200b003b2c242aaeemr17193775oij.42.1701161242062; Tue, 28 Nov 2023 00:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701161242; cv=none; d=google.com; s=arc-20160816; b=yx5h3tNAnhvp2fv4EpMP8/mSctjH075sxKxzDTQ/BBsCuEhRehetcUo+xvhMy9GNwS AZsHxBoVkLKz3C2oIrZKcZO9sZ7eBzp8ds31epgYohQAA/s71/iNAmHA5tauEIe15NZX AExcAnYdUTCxXVRtQGfnbZUzBmXhhu1GZ95QVyX6f/MYs6YVFz4KDoLeol0zMspHMa0C ISpKNXSPP10yChD6HoJ3Tp929Kn70eK1r09aU0UZzyKJuyrsaLGeXz8jXf/KmD6O5E9x 0EK1GT2mc+0gpAChlrpFIl7lOgYeruLDAfBpvJRlomR/YrAiYFh7bTgqdTQhg65S7kw/ LbOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:autocrypt:from:references:cc:to:content-language :subject:user-agent:mime-version:date:message-id:dkim-signature; bh=osJ0BsPiS2MajaEF5z6aOOQVSjzxwGZnSLvMkecVT6Q=; fh=q+RJ4bqjVni8HnG3cTe5ls3bMRvRllT/9bLO8PufJP8=; b=s+TI79/MQBbhTebQR0dIei7YDFlnjAuOaGVjgs+JIb0PjirUQIp5SwzQEeZo48P3N8 x914yu1a+mWtvKE+JCUr+icbNG0QLPyWAsZIEfVpgAgOBC29+zirvRTgpBu14yBMjS2P NLN9CMmMG+gzp4vGAMKJJiTdx2aZxcNL01spbXdGWp20OsOH+JEaLdFyytmgzdYhm1C1 07jincHkqim22cAu5hXKeuWOoT/FanQNDgyMg/1LCYvL/pL4JdGoLHdP6onJIhz5NYtk jvrXkHo6gKskgp+RLt5HPPC8TEuqLHGIIOB5E5Lp6PBsiHx+AEEXMyRQwFRJFUuvofWt qHuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i429nDXa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s18-20020a056a00195200b006cbbd597aa1si11891721pfk.242.2023.11.28.00.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:47:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i429nDXa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 7C98380AC5A5; Tue, 28 Nov 2023 00:47:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344224AbjK1IrG (ORCPT + 99 others); Tue, 28 Nov 2023 03:47:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344242AbjK1IrC (ORCPT ); Tue, 28 Nov 2023 03:47:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C2EFD4C for ; Tue, 28 Nov 2023 00:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701161227; 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=osJ0BsPiS2MajaEF5z6aOOQVSjzxwGZnSLvMkecVT6Q=; b=i429nDXarOrps4PBxsfrScvcqDZQmDK7YY+Uwv4QDyf4Mk7rm8e8nzhooh2AK39Vrp0fYk 6P22ItxMljRHaG+4vDv52esrBUQUFVx+FLAPO+cHwGNJE+kwuXoDjDn7VJZG3Nsif7rHi2 R41sBR0gDyiryVmzuJNlW+ndnRW55s4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-290-2Wi91mStMjelMH_qly1baw-1; Tue, 28 Nov 2023 03:47:06 -0500 X-MC-Unique: 2Wi91mStMjelMH_qly1baw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-40b4c9c3cffso2577185e9.2 for ; Tue, 28 Nov 2023 00:47:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701161225; x=1701766025; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=osJ0BsPiS2MajaEF5z6aOOQVSjzxwGZnSLvMkecVT6Q=; b=HsN2ruKD6iR9mc/2Y1e4UwwfdPnaf+6vfRc9/sRqPzK2TCaoRKEPH4VdkF9rfDTOwK TbG1MfbIF1ItoRVIxLROCAWCWtjhJP7qMjtSn9be2RXvwF9SUY+i7NJku1xpTRbwXby3 4ThU4bzCfwY5qZgBeiPWc0ZzFghanVtfGGG+SrH2lqobdp+HX+cfx7kBctaJU7NjwhSE 1sOcTAZ9iT4i25LhK98HH6xR0XpWfWuO2WgjMpuGbJOHFtGGO/c6QItvHQ9K2X7V9lMA BhLfjM6eMRAVlhB/TDYR8ae9VGHD9IjAlOtPnwZA8yzwKvVgPi5VoqFvP2qUapioSoVL a4ZA== X-Gm-Message-State: AOJu0YxLuWfgMJ8wOAQ9mpNW/Wmq06JyGOTxrdEVEqUhEQ0MkjVxezJ1 o013BzDO/I2SHErGUHYy0DHNNNevG07BG+rjJiISAkSpbh82q7soq5SugogSRHfz/tz83B9Q1Sk y9DOKbY3EmetfICvdP3zNctVh X-Received: by 2002:a05:600c:1d20:b0:406:52e4:cd23 with SMTP id l32-20020a05600c1d2000b0040652e4cd23mr11223202wms.0.1701161224831; Tue, 28 Nov 2023 00:47:04 -0800 (PST) X-Received: by 2002:a05:600c:1d20:b0:406:52e4:cd23 with SMTP id l32-20020a05600c1d2000b0040652e4cd23mr11223177wms.0.1701161224360; Tue, 28 Nov 2023 00:47:04 -0800 (PST) Received: from ?IPV6:2003:cb:c708:1d00:99ec:9656:7475:678d? (p200300cbc7081d0099ec96567475678d.dip0.t-ipconnect.de. [2003:cb:c708:1d00:99ec:9656:7475:678d]) by smtp.gmail.com with ESMTPSA id p18-20020a05600c359200b0040b360cc65csm16657823wmq.0.2023.11.28.00.47.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Nov 2023 00:47:03 -0800 (PST) Message-ID: Date: Tue, 28 Nov 2023 09:47:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND PATCH v7 00/10] Small-sized THP for anonymous memory Content-Language: en-US To: Matthew Wilcox Cc: Ryan Roberts , Andrew Morton , Yin Fengwei , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins , Kefeng Wang , linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231122162950.3854897-1-ryan.roberts@arm.com> <9c8f6d2a-7ed8-45d2-9684-d77489bd99b8@redhat.com> <26c361bc-6d87-4a57-9fae-ef635c9039c7@redhat.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+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWw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MVQDDfJjqY0VVqSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:47:20 -0800 (PST) On 28.11.23 05:05, Matthew Wilcox wrote: > On Fri, Nov 24, 2023 at 06:34:10PM +0100, David Hildenbrand wrote: >> On 24.11.23 16:53, Matthew Wilcox wrote: >>>> * we already have PMD-sized "large anon folios" in THP >>> >>> Right, those are already accounted as THP, and that's what users expect. >>> If we're allocating 1024 x 64kB chunks of memory, the user won't be able >>> to distinguish that from 32 x 2MB chunks of memory, and yet the >>> performance profile for some applications will be very different. >> >> Very right, and because there will be a difference between 1024 x 64kB, 2048 >> x 32 kB and so forth, we need new memory stats either way. >> >> Ryan had some ideas on that, but currently, that's considered future work, >> just like it likely is for the pagecache as well and needs much more >> thoughts. >> >> Initially, the admin will have to enable all that for anon either way. It >> all boils down to one memory statistic for anon memory (AnonHugePages) . >> that's messed-up already. > > So we have FileHugePages which is very carefully only PMD-sized large > folios. If people start making AnonHugePages count non-PMD-sized > large folios, that's going to be inconsistent. Right, and that's why we decided to leave these counters alone for now and rather document that they only apply to PMD-sized THP for historical reasons. We'll want new stats either way. Hopefully we'll make it more future-proof this time. > >>> am objecting to the use of the term "small THP" on the grounds of >>> confusion and linguistic nonsense. >> >> Maybe that's the reason why FreeBSD calls them "medium-sized superpages", >> because "Medium-sized" seems to be more appropriate to express something "in >> between". > > I don't mind "medium" in the name. > >> So far I thought the reason was because they focused on 64k only. >> >> Never trust a German guy on naming suggestions. John has so far been my >> naming expert, so I'm hoping he can help. >> >> "Sub-pmd-sized THP" is just mouthful. But then, again, this is would just be >> a temporary name, and in the future THP will just naturally come in multiple >> sizes (and others here seem to agree on that). > > I do not. If we'd come to this fifteen years ago, maybe, but people now > have an understanding that THPs are necessarily PMD sized. Well, I still find people being confused about THP vs. hugetlb, so likely some confusion is unavoidable. :) In your other mail you write "Perhaps the problem is that people have turned "THP" into a thing in its own right." I think that's exactly the case, and I see how that can be confusing when spelling out THP and reading "small-huge: does it cancel out?". -- Cheers, David / dhildenb