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 506F5C433F5 for ; Tue, 12 Apr 2022 16:20:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6F1916B0071; Tue, 12 Apr 2022 12:20:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6A04A6B0073; Tue, 12 Apr 2022 12:20:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 568056B0074; Tue, 12 Apr 2022 12:20:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 47C206B0071 for ; Tue, 12 Apr 2022 12:20:23 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 12AD51224D1 for ; Tue, 12 Apr 2022 16:20:23 +0000 (UTC) X-FDA: 79348739526.10.30F7BF8 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by imf11.hostedemail.com (Postfix) with ESMTP id 1516240009 for ; Tue, 12 Apr 2022 16:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649780422; x=1681316422; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=0rhW/syVVmAH9bt4RVUxl07dFxjacizqjOlvBoRg8/g=; b=Y9zonUVJkBddzTe+tpVjx1Qbcqjq1qdjj0pNU7qbSsaIcUjhVYI/gnzq a7VeeQ/ALLB2PRbCh6tT/3TpfXyvgUP5tpA0KEqTOH3sxuNe0wPCc2r9i V0zuiML30Lx56oEjrLP/K081bzFApbOv6TgwkxEurirWsigzHxPLq4I3c aY3AmYr3L2J7srcKwnp52r+0cR72MbaOEbxaTs9VGxuPW3k6/67hbOWGq cA5f3NM6QpFFc+yvfTW851sbL537phSpX1s1fzGx8XY0CXYrDIEd5RhP2 d0UJF/UIfjqpx71thNjR1ZCvPf3bCqaaUmSN6XrTbaGQkP/+nVH864pyo w==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="260014240" X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="260014240" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 09:08:39 -0700 X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="551773930" Received: from vtelkarx-mobl.amr.corp.intel.com (HELO [10.209.191.73]) ([10.209.191.73]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2022 09:08:37 -0700 Message-ID: Date: Tue, 12 Apr 2022 09:08:43 -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: David Hildenbrand , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel Cc: 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> From: Dave Hansen Subject: Re: [PATCHv4 1/8] mm: Add support for unaccepted memory In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1516240009 X-Stat-Signature: x5kbs81cstmzopymj1ewp9nybgpanz7o X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=Y9zonUVJ; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf11.hostedemail.com: domain of dave.hansen@intel.com has no SPF policy when checking 192.55.52.93) smtp.mailfrom=dave.hansen@intel.com X-HE-Tag: 1649780421-46485 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 4/12/22 01:15, David Hildenbrand wrote: > Can we simply automate this using a kthread or smth like that, which > just traverses the free page lists and accepts pages (similar, but > different to free page reporting)? That's definitely doable. The downside is that this will force premature consumption of physical memory resources that the guest may never use. That's a particular problem on TDX systems since there is no way for a VMM to reclaim guest memory short of killing the guest. In other words, I can see a good argument either way: 1. The kernel should accept everything to avoid the perf nastiness 2. The kernel should accept only what it needs in order to reduce memory use I'm kinda partial to #1 though, if I had to pick only one. The other option might be to tie this all to DEFERRED_STRUCT_PAGE_INIT. Have the rule that everything that gets a 'struct page' must be accepted. If you want to do delayed acceptance, you do it via DEFERRED_STRUCT_PAGE_INIT.