From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 480FE290C for ; Wed, 13 Apr 2022 15:36:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649864209; x=1681400209; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=oIiCjJKpo00HkSNcMJpuGaaA17RzsSWMzH4oj7iHyy8=; b=iaZGa5Of1F9NtoV2k2W3QwpWRV9g0fb5vvkCvsyZcRW2hdPqewsEt4yg 1XeEIDz0WR0Uyur+ZSLbC3Lj0TN+HHyrSMDu9+gSj5Un1e8V4a7uIyh0E LYH0zbdfDeZmS13BtfLZ8JqSvfCWMXfum1JE9Wr5I4FIpsX04nqjbixF1 245pH+eCxW/0Ocn0w2Owr5T2iSSXZkSXK5flAeoqfiCR/V74QrQmAs7i7 4psv28IIxBey5Tp6YeEu1WFKMzbs4EPHho8DS8s4CiT5enxamLRYCyaG1 Ljw7vNoaM/jkfITCs7/ChYyJDOXF/CjTxH+BRph2Q3PrqvHvHvg5z/hAU A==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="243286233" X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="243286233" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 08:36:48 -0700 X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="559791794" Received: from jmsepko-mobl.amr.corp.intel.com (HELO [10.212.61.150]) ([10.212.61.150]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 08:36:45 -0700 Message-ID: Date: Wed, 13 Apr 2022 08:36:52 -0700 Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: "Kirill A. Shutemov" , David Hildenbrand Cc: "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , Brijesh Singh , Mike Rapoport , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Mike Rapoport References: <20220405234343.74045-1-kirill.shutemov@linux.intel.com> <20220405234343.74045-2-kirill.shutemov@linux.intel.com> <93a7cfdf-02e6-6880-c563-76b01c9f41f5@intel.com> <20220413113024.ycvocn6ynerl3b7m@box.shutemov.name> From: Dave Hansen Subject: Re: [PATCHv4 1/8] mm: Add support for unaccepted memory In-Reply-To: <20220413113024.ycvocn6ynerl3b7m@box.shutemov.name> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/13/22 04:30, Kirill A. Shutemov wrote: >> 2) Fast boot; after boot, all memory will slowly but steadily get >> accepted in the background. After a while, all memory is accepted and >> can be signaled to user space. ... > Frankly, I think option 2 is the worst one. You still CPU cycles from the > workload after boot to do the job that may or may not be needed. It is an > half-measure that helps nobody. Let's not be too hyperbolic here. "Worst" is entirely subjective and it totally depends on your perspective and what you care about. There are basically four options: * Accept everything in early boot * Accept with deferred page free * Accept with kthread after boot * Accept on demand and four things that matter: * Code complexity * Time to a shell prompt * CPU/Memory waste * Deterministic overhead Did I miss any? News flash: none of the options wins on all the things that matter. We're going to have to pick one (or maybe two). I'm also not horribly convinced that there's a problem here worth solving, especially one that requires surgery in the core of the buddy allocator. This is essentially making a performance argument: it takes too long to boot if we go with a simpler solution. Yet, I haven't seen any data. I think we need to go with the simplest approach(es) until there's some actual data to guide us here. Here's another way to look at it: > https://docs.google.com/spreadsheets/d/1Fpv0Yp0CTF5_JXHR2pywvNtImTwUVGTxDMlJ5t8qiis/edit?usp=sharing