Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4410338rdh; Wed, 29 Nov 2023 00:06:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNtg1se95YIue1rskAtaEKrEZ74e8nJgQ4H1Qi/vPLEBLXNqJgJObQKZxU5qCgnikF4GWy X-Received: by 2002:a17:902:e54b:b0:1cf:5c9c:7979 with SMTP id n11-20020a170902e54b00b001cf5c9c7979mr22199583plf.42.1701245171881; Wed, 29 Nov 2023 00:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701245171; cv=none; d=google.com; s=arc-20160816; b=v72JJ44UAIBz/4O9XVb+/laAsRiCIW7JqL2tLuulRpDBylBzDuXYY3EWKSIWcCxi8W Hm1xxaqaeUEAU6CIyfJRhpxafkpJ77va+pPjI6qwAWMgldnfHLJsYK019/scH3msW8JZ xiqtVPSN0N8YzkTwGvoh/lfYF2d8SWoLmPUoHSCASGb1i0C5es+MVgUrvIGeu2gMstZu 3gs5cxvPvDQmcVRSfXLu3J1b0T6pZdlJNVbQZ65Sj1agS3mYIOdQjmo6cloU0/5BRMWr HT9H0arV3aUmIgbtJZUdXCXdXvPP/ohv3J2lZHX1oYF6lSB5U4mwtQ30JeH4sOziUMLn /E6A== 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:content-language:references:cc:to :subject:user-agent:mime-version:date:message-id:dkim-signature; bh=8v095EuMzzISmu5Y1f0aoY1vTTbA82jShxtCDF/8mD4=; fh=wr0JQAS2N+AW3dqTNa2fCo17fHdfyGBvd7N5uAly8iY=; b=caQWiGvbW/35bLXej85zKuIVL+6Squ6C85wf55VAwJO3O6NEmzZe4QPuZSsmj/3hJk HCIMWK+FMSSl5K3pSwHpENoxeYl4lCuwtMRPaf1zj5WmvOakwUzoE+JAyy1BOsoobkxm 2PKM//MZ+kwKSliX0PkP4wooxuvqCiQcQ6QCYy9C6B9eHkQR1dFh6EppP94iBZeGMZyb 4bU+iqEwCDcC8sFU34wnhM2oLa5c7xU2yVYm+nm9Aw7cpCUF4iBbfnEeVo+b0eLLVvr4 9YvO9J8icABh65GcsIbJ/VAyLT3YTEkaYrHWH0QQNZQruUu7w9MLNjb7G/QmoSN6TOjW 1DYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jTOoLiRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id a5-20020a170902ee8500b001c9b172c35fsi13591656pld.40.2023.11.29.00.06.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 00:06:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jTOoLiRb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 3CF08804F47C; Wed, 29 Nov 2023 00:06:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229650AbjK2IFd (ORCPT + 99 others); Wed, 29 Nov 2023 03:05:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229513AbjK2IFb (ORCPT ); Wed, 29 Nov 2023 03:05:31 -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 6ACD2D40 for ; Wed, 29 Nov 2023 00:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701245136; 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=8v095EuMzzISmu5Y1f0aoY1vTTbA82jShxtCDF/8mD4=; b=jTOoLiRbHXxFJGL4eZQbZcrOTtkJt2jnZCUHLF4Lsus8TosaC9p+n5EJl2/P5U5Ke0qp4e qpykO1V2L3ouvSWwbQ3H92cLkCkDFn3Ys5puMnwd5atV226NHGRZblWHAJWBLjwyrkqpTS DMwvbKQXfoqENhvCegEZZSxNbKOU5jc= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-260-JddXo1B6M3KsSIAE8py5aA-1; Wed, 29 Nov 2023 03:05:35 -0500 X-MC-Unique: JddXo1B6M3KsSIAE8py5aA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-332dfa77997so4452352f8f.0 for ; Wed, 29 Nov 2023 00:05:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701245134; x=1701849934; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :content-language: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=8v095EuMzzISmu5Y1f0aoY1vTTbA82jShxtCDF/8mD4=; b=PcwdnjRcLcQZTawN5OrYpH8qJq0orERhBuu6kGpABCVMqi/kD7Mqh2iSPP36OY3k6+ 2aG+heJhmjPQmks9BCqUlmZ67lUFtNp1U2v+kvva+VL+fq6xOLF90tsGunh5TuBgXpJl 5+CGB5OH+BwAc8cj+yDKZhhcb4au0DzOveTSKZQK1qy9FIjdPgtA2faf90iAJj7sAmM3 fCf2BkTNhSDo6R6svg/stYUwwagukFloECp/ck5pOZuRHQl3/eiC46pGP6W+L9OSsN8n x3DpUrW0mKm2cIbBxc/vrX2YpgACE5pD1uD+NswT+k/9cdY6d7Gz472kF85UTW1UPgNo aYVw== X-Gm-Message-State: AOJu0YxPG1q84tvHijWzWAYqnZ+G9Us9L7o51nv5Kc6jVd93uoiEJ92Y zFZiKOU0hvs9XitdJ2GVTuhrY7lJ77ZcWHMH03WpCPUtwMyR3eaUYxcebtWqeKhiUMRHJlU3cMo wRHPJnQ7v9gZN9k2Keloi14bC X-Received: by 2002:a5d:40c8:0:b0:332:ca80:a9ea with SMTP id b8-20020a5d40c8000000b00332ca80a9eamr15317538wrq.41.1701245134059; Wed, 29 Nov 2023 00:05:34 -0800 (PST) X-Received: by 2002:a5d:40c8:0:b0:332:ca80:a9ea with SMTP id b8-20020a5d40c8000000b00332ca80a9eamr15317508wrq.41.1701245133531; Wed, 29 Nov 2023 00:05:33 -0800 (PST) Received: from ?IPV6:2003:cb:c710:f600:634b:35f:ffa8:475b? (p200300cbc710f600634b035fffa8475b.dip0.t-ipconnect.de. [2003:cb:c710:f600:634b:35f:ffa8:475b]) by smtp.gmail.com with ESMTPSA id df2-20020a5d5b82000000b0032fbe5b1e45sm16817600wrb.61.2023.11.29.00.05.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Nov 2023 00:05:33 -0800 (PST) Message-ID: Date: Wed, 29 Nov 2023 09:05:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND PATCH v7 03/10] mm: thp: Introduce per-size thp sysfs interface To: John Hubbard , Ryan Roberts , Andrew Morton , Matthew Wilcox , Yin Fengwei , Yu Zhao , Catalin Marinas , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , Itaru Kitayama , "Kirill A. Shutemov" , David Rientjes , Vlastimil Babka , Hugh Dickins , Kefeng Wang Cc: linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20231122162950.3854897-1-ryan.roberts@arm.com> <20231122162950.3854897-4-ryan.roberts@arm.com> <1a738e0a-ac11-4cd3-be2f-6b6e7cb4980a@nvidia.com> Content-Language: en-US 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 B3JfpUqcWwE7vUaYrHG1nw54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qSUwImzTDLX9S4g/8 kC4HRcclk8hpyhY2jKGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <1a738e0a-ac11-4cd3-be2f-6b6e7cb4980a@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Wed, 29 Nov 2023 00:06:08 -0800 (PST) On 29.11.23 04:42, John Hubbard wrote: > On 11/22/23 08:29, Ryan Roberts wrote: >> In preparation for adding support for anonymous small-sized THP, >> introduce new sysfs structure that will be used to control the new >> behaviours. A new directory is added under transparent_hugepage for each >> supported THP size, and contains an `enabled` file, which can be set to >> "global" (to inherrit the global setting), "always", "madvise" or >> "never". For now, the kernel still only supports PMD-sized anonymous >> THP, so only 1 directory is populated. >> >> The first half of the change converts transhuge_vma_suitable() and >> hugepage_vma_check() so that they take a bitfield of orders for which >> the user wants to determine support, and the functions filter out all >> the orders that can't be supported, given the current sysfs >> configuration and the VMA dimensions. If there is only 1 order set in >> the input then the output can continue to be treated like a boolean; >> this is the case for most call sites. >> >> The second half of the change implements the new sysfs interface. It has >> been done so that each supported THP size has a `struct thpsize`, which >> describes the relevant metadata and is itself a kobject. This is pretty >> minimal for now, but should make it easy to add new per-thpsize files to >> the interface if needed in future (e.g. per-size defrag). Rather than >> keep the `enabled` state directly in the struct thpsize, I've elected to >> directly encode it into huge_anon_orders_[always|madvise|global] >> bitfields since this reduces the amount of work required in >> transhuge_vma_suitable() which is called for every page fault. >> >> The remainder is copied from Documentation/admin-guide/mm/transhuge.rst, >> as modified by this commit. See that file for further details. >> >> Transparent Hugepage Support for anonymous memory can be entirely >> disabled (mostly for debugging purposes) or only enabled inside >> MADV_HUGEPAGE regions (to avoid the risk of consuming more memory >> resources) or enabled system wide. This can be achieved >> per-supported-THP-size with one of:: >> >> echo always >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> echo madvise >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> echo never >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> >> where is the hugepage size being addressed, the available sizes >> for which vary by system. Alternatively it is possible to specify that >> a given hugepage size will inherrit the global enabled setting:: >> >> echo global >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> >> The global (legacy) enabled setting can be set as follows:: >> >> echo always >/sys/kernel/mm/transparent_hugepage/enabled >> echo madvise >/sys/kernel/mm/transparent_hugepage/enabled >> echo never >/sys/kernel/mm/transparent_hugepage/enabled >> >> By default, PMD-sized hugepages have enabled="global" and all other >> hugepage sizes have enabled="never". If enabling multiple hugepage >> sizes, the kernel will select the most appropriate enabled size for a >> given allocation. >> >> Signed-off-by: Ryan Roberts >> --- >> Documentation/admin-guide/mm/transhuge.rst | 74 ++++-- >> Documentation/filesystems/proc.rst | 6 +- >> fs/proc/task_mmu.c | 3 +- >> include/linux/huge_mm.h | 100 +++++--- >> mm/huge_memory.c | 263 +++++++++++++++++++-- >> mm/khugepaged.c | 16 +- >> mm/memory.c | 6 +- >> mm/page_vma_mapped.c | 3 +- >> 8 files changed, 387 insertions(+), 84 deletions(-) >> >> diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst >> index b0cc8243e093..52565e0bd074 100644 >> --- a/Documentation/admin-guide/mm/transhuge.rst >> +++ b/Documentation/admin-guide/mm/transhuge.rst >> @@ -45,10 +45,23 @@ components: >> the two is using hugepages just because of the fact the TLB miss is >> going to run faster. >> >> +As well as PMD-sized THP described above, it is also possible to >> +configure the system to allocate "small-sized THP" to back anonymous > > Here's one of the places to change to the new name, which lately is > "multi-size THP", or mTHP or m_thp for short. (I've typed "multi-size" > instead of "multi-sized", because the 'd' doesn't add significantly to > the meaning, and if in doubt, shorter is better. > > >> +memory (for example 16K, 32K, 64K, etc). These THPs continue to be >> +PTE-mapped, but in many cases can still provide similar benefits to >> +those outlined above: Page faults are significantly reduced (by a >> +factor of e.g. 4, 8, 16, etc), but latency spikes are much less >> +prominent because the size of each page isn't as huge as the PMD-sized >> +variant and there is less memory to clear in each page fault. Some >> +architectures also employ TLB compression mechanisms to squeeze more >> +entries in when a set of PTEs are virtually and physically contiguous >> +and approporiately aligned. In this case, TLB misses will occur less >> +often. >> + > > OK, all of the above still seems like it can remain the same. > >> THP can be enabled system wide or restricted to certain tasks or even >> memory ranges inside task's address space. Unless THP is completely >> disabled, there is ``khugepaged`` daemon that scans memory and >> -collapses sequences of basic pages into huge pages. >> +collapses sequences of basic pages into PMD-sized huge pages. >> >> The THP behaviour is controlled via :ref:`sysfs ` >> interface and using madvise(2) and prctl(2) system calls. >> @@ -95,12 +108,29 @@ Global THP controls >> Transparent Hugepage Support for anonymous memory can be entirely disabled >> (mostly for debugging purposes) or only enabled inside MADV_HUGEPAGE >> regions (to avoid the risk of consuming more memory resources) or enabled >> -system wide. This can be achieved with one of:: >> +system wide. This can be achieved per-supported-THP-size with one of:: >> + >> + echo always >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> + echo madvise >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> + echo never >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> + >> +where is the hugepage size being addressed, the available sizes >> +for which vary by system. Alternatively it is possible to specify that >> +a given hugepage size will inherrit the global enabled setting:: > > typo: inherrit > >> + >> + echo global >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled >> + >> +The global (legacy) enabled setting can be set as follows:: >> >> echo always >/sys/kernel/mm/transparent_hugepage/enabled >> echo madvise >/sys/kernel/mm/transparent_hugepage/enabled >> echo never >/sys/kernel/mm/transparent_hugepage/enabled >> >> +By default, PMD-sized hugepages have enabled="global" and all other >> +hugepage sizes have enabled="never". If enabling multiple hugepage >> +sizes, the kernel will select the most appropriate enabled size for a >> +given allocation. >> + > > This is slightly murky. I wonder if "inherited" is a little more directly > informative than global; it certainly felt that way my first time running > this and poking at it. > > And a few trivial examples would be a nice touch. > > And so overall with a few other minor tweaks, I'd suggest this: > > ... > where is the hugepage size being addressed, the available sizes > for which vary by system. > > For example: > echo always >/sys/kernel/mm/transparent_hugepage/hugepages-2048kB/enabled > > Alternatively it is possible to specify that a given hugepage size will inherit > the top-level "enabled" value: > > echo inherited >/sys/kernel/mm/transparent_hugepage/hugepages-kB/enabled > > For example: > echo inherited >/sys/kernel/mm/transparent_hugepage/hugepages-2048kB/enabled > > The top-level setting (for use with "inherited") can be by issuing one of the > following commands:: > > echo always >/sys/kernel/mm/transparent_hugepage/enabled > echo madvise >/sys/kernel/mm/transparent_hugepage/enabled > echo never >/sys/kernel/mm/transparent_hugepage/enabled > > By default, PMD-sized hugepages have enabled="inherited" and all other > hugepage sizes have enabled="never". "inherited" works for me as well. -- Cheers, David / dhildenb