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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75015C4332F for ; Tue, 31 Oct 2023 11:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F6kvFSg3mfav67+6C2fJMgamuficm+qpL3T/FL0FYR8=; b=V9piUzBRQB9hkT 6eBi5t/HsyYESofArQKIhAGKC8rfwYfjt9QTHRomYspNGRvZj8MC25PFydRQrPocevsJCst8iQqzx Y0iMh4xG/9SbGkes0fEMiyqROJTXYKHq/pw27EvhT9DJ0iQJMlLj6z3v+/GTkHwYyqC96ToxqKxNU X10hERKVFPuPMpA6FQ3xh/LqUBQuiZK5gtXpSq2c0HuSqOBeuPKUt1gVFmX95ajbf4/JFiPNNaFm4 YY7GyZ+mh8iCXVINXqBbgFpRoqF6HOOWDEXkCzx8fr8yCQkd8ThpS7dJOuUwsTgOS617dvv1Eo97X RWRblA3ZSDt8dy1NnRaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qxnOh-005EIW-0m; Tue, 31 Oct 2023 11:59:03 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qxnOe-005EHH-0x for linux-arm-kernel@lists.infradead.org; Tue, 31 Oct 2023 11:59:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698753538; 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=9TY9BTlqFgLhZbIpjJcIPfstT96f2DSA0CuHLc5kNN4=; b=J5gNIkBlMCCYwOg15Yxwgr8EvlQSU1vLcQ8XbqfAqqreO9ez9/xeLVajpAscS+hgqsSMMR on7VZ69xCaVeZ5U0UnatABOGDmq8ZQNWTwAv8MmIpCjMiYeX9QQsokUkCQRaZ31LJRsGCm Xqa0gY4p6Z3H1rnxjj4mVNP+0CtPPow= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-190-GZgeGtftNf-U9NV5uJML8g-1; Tue, 31 Oct 2023 07:58:55 -0400 X-MC-Unique: GZgeGtftNf-U9NV5uJML8g-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-5af592fed43so46410167b3.2 for ; Tue, 31 Oct 2023 04:58:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698753535; x=1699358335; 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=9TY9BTlqFgLhZbIpjJcIPfstT96f2DSA0CuHLc5kNN4=; b=SUhVcj72EhCYPSwYAuruPH2WnorxcwlzUSHMj9lP/0wmco4Q2Yx9f/NkXWLWhLaVk7 DKzA0W+2jWTT0A6ouVrCkeT2EMvQO68Ff41GX4MIjG9gSdfAaBuS+4u1qCIys1AVbkPo 5pQXnE2Vudq80MvHoG5qN1MRT23OjLTcHl0idIehS+uig8MewybVOxulJ57dBo8oMs2h 280S6Wkd8VhQj1zOlftbv+uC9K9RCholBJlvWjIsbzZMQlk3mvuObMFjLSQx14Rivxq3 KhIJimBV1DhjOF7IPCjRJlZN8tDlDMIbl/8Hq7wG1YPseP4SItm8/8CJqRY5se2AZpLS Dfog== X-Gm-Message-State: AOJu0YxtIOpRIv0rFl2TY+Z5OCWhUycPlSQHVVnUWzBZ2x50oxnUl/sR lM5XQKTYCPMafvg4/Kf7jdje5M68dnPCiBzwqSYOuwBOBkoB+ToTAIhZR1Yr1XVx5ZvYny/skWs VEGE032r/OcKR9gFWkze/FVdXl3UV6L/7hPc= X-Received: by 2002:a81:d206:0:b0:59c:a7f:ca7b with SMTP id x6-20020a81d206000000b0059c0a7fca7bmr8332262ywi.51.1698753534868; Tue, 31 Oct 2023 04:58:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELCEpiLOVQnaJQz27k7IYUw0zZaIBb05+G3bRfzR/pHZOZDHVZfXfQXdZ+PRJSBB5J0q/kAA== X-Received: by 2002:a81:d206:0:b0:59c:a7f:ca7b with SMTP id x6-20020a81d206000000b0059c0a7fca7bmr8332242ywi.51.1698753534456; Tue, 31 Oct 2023 04:58:54 -0700 (PDT) Received: from ?IPV6:2003:cb:c707:8f00:43b0:1107:57d2:28ee? (p200300cbc7078f0043b0110757d228ee.dip0.t-ipconnect.de. [2003:cb:c707:8f00:43b0:1107:57d2:28ee]) by smtp.gmail.com with ESMTPSA id n18-20020ad444b2000000b0067169e210b3sm458681qvt.70.2023.10.31.04.58.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 Oct 2023 04:58:54 -0700 (PDT) Message-ID: Date: Tue, 31 Oct 2023 12:58:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 0/9] variable-order, large folios for anonymous memory To: 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" , John Hubbard , David Rientjes , Vlastimil Babka , Hugh Dickins Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20230929114421.3761121-1-ryan.roberts@arm.com> <6d89fdc9-ef55-d44e-bf12-fafff318aef8@redhat.com> <7a3a2d49-528d-4297-ae19-56aa9e6c59c6@arm.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 B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREY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KGluZO0awwTIMgVEzmTyBphDg/Gx7dZU1Xf8HFuE+UZ5UDHDTnwgv7E th6RC9+WrhDNspZ9fJjKWRbveQgUFCpe1sa77LAw+XFrKmBHXp9ZVIe90RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <7a3a2d49-528d-4297-ae19-56aa9e6c59c6@arm.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231031_045900_404913_1DFF0FCE X-CRM114-Status: GOOD ( 19.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 31.10.23 12:50, Ryan Roberts wrote: > On 06/10/2023 21:06, David Hildenbrand wrote: > [...] >> >> Change 2: sysfs interface. >> >> If we call it THP, it shall go under "/sys/kernel/mm/transparent_hugepage/", I >> agree. >> >> What we expose there and how, is TBD. Again, not a friend of "orders" and >> bitmaps at all. We can do better if we want to go down that path. >> >> Maybe we should take a look at hugetlb, and how they added support for multiple >> sizes. What *might* make sense could be (depending on which values we actually >> support!) >> >> >> /sys/kernel/mm/transparent_hugepage/hugepages-64kB/ >> /sys/kernel/mm/transparent_hugepage/hugepages-128kB/ >> /sys/kernel/mm/transparent_hugepage/hugepages-256kB/ >> /sys/kernel/mm/transparent_hugepage/hugepages-512kB/ >> /sys/kernel/mm/transparent_hugepage/hugepages-1024kB/ >> /sys/kernel/mm/transparent_hugepage/hugepages-2048kB/ >> >> Each one would contain an "enabled" and "defrag" file. We want something minimal >> first? Start with the "enabled" option. >> >> >> enabled: always [global] madvise never >> >> Initially, we would set it for PMD-sized THP to "global" and for everything else >> to "never". > > Hi David, Hi! > > I've just started coding this, and it occurs to me that I might need a small > clarification here; the existing global "enabled" control is used to drive > decisions for both anonymous memory and (non-shmem) file-backed memory. But the > proposed new per-size "enabled" is implicitly only controlling anon memory (for > now). Anon was (way) first, and pagecache later decided to reuse that one as an indication whether larger folios are desired. For the pagecache, it's just a way to enable/disable it globally. As there is no memory waste, nobody currently really cares about the exact sized the pagecache is allocating (maybe that will change at some point, maybe not, who knows). > > 1) Is this potentially confusing for the user? Should we rename the per-size > controls to "anon_enabled"? Or is it preferable to jsut keep it vague for now so > we can reuse the same control for file-backed memory in future? The latter would be my take. Just like we did with the global toggle. > > 2) The global control will continue to drive the file-backed memory decision > (for now), even when hugepages-2048kB/enabled != "global"; agreed? That would be my take; it will allocate other sizes already, so just glue it to the global toggle and document for the other toggles that they only control anonymous THP for now. -- Cheers, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel