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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3F9FC433F5 for ; Wed, 13 Apr 2022 15:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231842AbiDMPjK (ORCPT ); Wed, 13 Apr 2022 11:39:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236509AbiDMPjJ (ORCPT ); Wed, 13 Apr 2022 11:39:09 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25C156514D; Wed, 13 Apr 2022 08:36:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649864207; x=1681400207; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=oIiCjJKpo00HkSNcMJpuGaaA17RzsSWMzH4oj7iHyy8=; b=Je7G3kM5dmQj2cX90v9DuZIfXtlqKgiCycMZhsSsTj3PBq/gOYmA0eP8 NfLFM9AcJHGOOVLbU+c5L3XyiimGpqxDTU6JcaTXRFK+HHecKMW/abYE+ g564/YAIwu2r4yuzuwGjoNQYFMsmFwwA5VUSd9jmnopl/MCnZ5YxKsGGq 018wHC9CJrtDsDGdBPYbfH/+BctdekU2tvyquKOrFbssA0krokhNBH3Ss rkGWB2yrCnBQq+ExQzt/eOUxBieTEfL0mhsbaHSX3tZDPk/nDwKCEmF5V zRggL7X+zUUx6La0Mx6zPIQjjWJrYKmKHGbvtJdaesFHodZWx23N0uRI9 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10316"; a="262879943" X-IronPort-AV: E=Sophos;i="5.90,257,1643702400"; d="scan'208";a="262879943" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2022 08:36:46 -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 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 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org 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