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 3596AE7E654 for ; Tue, 26 Sep 2023 18:30:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BEC936B01A2; Tue, 26 Sep 2023 14:30:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B9B426B01A3; Tue, 26 Sep 2023 14:30:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3BDC6B01A4; Tue, 26 Sep 2023 14:30:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 915F66B01A2 for ; Tue, 26 Sep 2023 14:30:02 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4F200160ADB for ; Tue, 26 Sep 2023 18:30:02 +0000 (UTC) X-FDA: 81279587844.20.5116A1C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 24BA91C001D for ; Tue, 26 Sep 2023 18:29:59 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cAK7tGHZ; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695753000; a=rsa-sha256; cv=none; b=lVC4nxgLCa2oH8gBf2/dm+GanvZNwPwR+inRzukH/XUDUwqXb+/F69fnDvJa728zdSOEwI 2ZLMn+IgeYypELMjPblm8kce1eJtZsryqgwx3sOHangqJna6P5T3PLRQtzSHPieTdur+dR PoIgBljg4SfU1WMV6vwGbLxBdfz9A38= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cAK7tGHZ; spf=pass (imf21.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695753000; 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=u2aUVKFdhOBlMZw4FhGHpmT9Z8qm4cIPm5SmAWTbCK0=; b=wUe1QWcuLYq+GynPBDaCWBW+NZnyBH+3Z9Xt7TxKXlF+Hkw3Yuw5Lpxnt7HAHnNyPpZWHN /ixwC4nz0G78otsqbVQZwfdVk5VPXRlm0iHR/1pubZ54Zpoi9oh9J3kc3/QTEJS0Kv6kGM skwwbib0TVN6p+8jk0jBb/2DsRUgt/8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695752999; 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; bh=u2aUVKFdhOBlMZw4FhGHpmT9Z8qm4cIPm5SmAWTbCK0=; b=cAK7tGHZlJg2e0Yki2KyU+7ZeQ7DDzxixOTpBAlWt17+dDMDZv0bzN7wnvUUdy+Fd+LpPT ZNjLQDf6ezFrl2pO3xsD91u+P37xHentTN/iyufAdOkRQIhP1O86ko9ACi6Bgdcs2QEgnO 0usHWqn/0sX/K2F9AYy+ZaULOnxjKrk= 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-433-bRTb5-BlPZGBH9sWCgKG0Q-1; Tue, 26 Sep 2023 14:29:57 -0400 X-MC-Unique: bRTb5-BlPZGBH9sWCgKG0Q-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-31f3eaa5c5eso6937339f8f.3 for ; Tue, 26 Sep 2023 11:29:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695752996; x=1696357796; h=content-transfer-encoding:in-reply-to:organization: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=u2aUVKFdhOBlMZw4FhGHpmT9Z8qm4cIPm5SmAWTbCK0=; b=kUNGAUDKJ2xxdU0C7hpVcrJSbywFEn23mPS/G9QfmG1sDOSB2b018aUU1NFvkSCFTX CO/YyR748hqyD0UvifAyRSeevCa7Vxg5mypOhE0wFRYzQSlLsXnxskMplIVw1uhKcplE yOOK7jNnqhPcJijgxIwpbmPrY1Iuhuo1at3r35g3HY+jM+X8SsYTFlkqpCjgIJ5QrhSH Qwo4o31Pkh3NQh2s90OAFXU3KAzc+nOzsI6wrfitWqFqlfvuIHxzev2TfyLyfbAukyj4 /n7cQU9VY00KfdEjvvtsAF2a3cc0+wsd5ROvduFofY3kmNOav40KQO0ps7ReZ+KtJuzu QOoQ== X-Gm-Message-State: AOJu0YzsWhbow4Zr2WPXnaC2ldrHjBVRGXrofzAx+EnZOwBIEFNFWRgJ KbMcAF1ptmQvDJCAocASy8ztvHJSY7BGzAf5F2g4xwkmAhkumt0b/KA5U8/PTcMlCXKZcNYAknF y4rERVWn6VoA= X-Received: by 2002:a5d:45d1:0:b0:320:38:9e14 with SMTP id b17-20020a5d45d1000000b0032000389e14mr8991018wrs.7.1695752996380; Tue, 26 Sep 2023 11:29:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHT0ZTfMTbb32mPpamU9yu6D/AbSh5Z4t+Srwe7JWW0HzoOl4DDQvvyw8IcZe4591DlpW3DGA== X-Received: by 2002:a5d:45d1:0:b0:320:38:9e14 with SMTP id b17-20020a5d45d1000000b0032000389e14mr8990995wrs.7.1695752995966; Tue, 26 Sep 2023 11:29:55 -0700 (PDT) Received: from ?IPV6:2003:cb:c73f:600:933b:ca69:5a80:230d? (p200300cbc73f0600933bca695a80230d.dip0.t-ipconnect.de. [2003:cb:c73f:600:933b:ca69:5a80:230d]) by smtp.gmail.com with ESMTPSA id z16-20020a056000111000b003176eab8868sm15187160wrw.82.2023.09.26.11.29.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Sep 2023 11:29:55 -0700 (PDT) Message-ID: <8fa8c314-3984-e600-94fd-e5a7708d8c65@redhat.com> Date: Tue, 26 Sep 2023 20:29:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: ANON_LARGE_FOLIOS meeting follow-up & refined proposal To: Ryan Roberts , Matthew Wilcox , Yang Shi , "Yin, Fengwei" , Yu Zhao , Zi Yan , David Rientjes , Andrew Morton , Vlastimil Babka , John Hubbard , "Kirill A. Shutemov" Cc: Linux-MM References: <4966f496-9f71-460c-b2ab-8661384ce626@arm.com> <4830fb3e-4a35-4842-98f4-9e7baa0e692a@arm.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <4830fb3e-4a35-4842-98f4-9e7baa0e692a@arm.com> 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: rspam08 X-Rspamd-Queue-Id: 24BA91C001D X-Stat-Signature: zqhf1dygx5w6bwye6k7gj481n8y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KPSNF000hfwGu9snb0tNDKdyd8nUAaSAeiRaMtRw851RvDx6Ig+43kyi77n6feLWSUAV4ELhyHlwU8aqBPNdeo4lZjsBLFDlxD8Ee1rjbg8aoiSYlHm5Oh8wAtV60gm5TnzY6CO9Lt+NWkXmgbxCiV0OaJpeB8KqjRujGvkEwpu0FBh2kiH2xrqPmaHTA8EQC2BWSoo8lhvptCeOvytBS2e7ART77LRlOwX5KVVnn8uDSDAR1jvpzPrZOqqMa2Unu0KsxiXJZr9jLYIbfJnjeXvhwXz5857X5q2G0MmJxQNb00raRMi350XjjtQyjA58wnMadDgxDlokRN3B9DxYgJ7qz1gkkEZzOeITrBe5H5r3i2vCg7W0RffrdZhAq0MMyTCrRUg== 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: On 22.09.23 17:48, Ryan Roberts wrote: > On 14/09/2023 09:16, Ryan Roberts wrote: >> Hi All, >> >> Thanks for participating in the discussion yesterday - it finally feels like we >> are converging on the MVP feature set. Below are my notes from the call and a >> modified proposal for controls and stats. It would be great if we can continue >> to review and refine over email. I'm also planning to post an implementation >> within the next couple of weeks, which I hope will also accelerate convergence. > > I never had any feedback on the below; I'm not sure if that means everyone is > happy or that nobody read it?? > > I've got an implementation for all of the below ready to go, with a few tweeks > to the details (the main change is that anon_orders is now a bitfield where each > set bit represents an order in the set, rather than the originally proposed > comma-separated list of orders). > > BUT I've had yet another idea on the controls front, which would enable exposing > this to user space as an extension to transparent_hugepage, while continuing to > support THP as is and also be able to control THP and ALF (anon large folio) > usage independently. On reflection, I think it is cleaner to do it this way for > a couple of reasons: > > - We don't have to introduce a whole new feature (ALF) to the user. Most of > the concepts and controls overlap a lot with THP anyway, so if we can make > it look like an extension, I think it would be easier to communicate. > > - The approach I have in mind would make it easy to extend to orders greater > than PMD_ORDER in future if that's a direction we want to eventually go. > Because >PMD_ORDER implies multiple PMD entries, it would half belong to THP > and half belong to ALF in the current proposal, which is nasty. > > I'll lay out the new proposal now, but I suspect this will ultimately warrant > another mm alignment meeting... > > > Add 2 controls to sysfs: > > /sys/kernel/mm/transparent_hugepage/anon_orders > - bitfield where set bits are orders that will be tried during allocation > - defaults to 1< - For now, 1< - To enable ALF, set the appropriate lower bits > - To disable THP, clear 1< - (In future we could add an "auto" option too) > I recall discussing that in the past -- where we also thought about adding exactly that to debugfs -- but the consensus was that we should keep THP alone. I agree at this point that we better keep THP alone. THP might be a subset of ALF (at some point, hopefully), but not the other way around IMHO. -- Cheers, David / dhildenb