Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp13495lfv; Tue, 12 Apr 2022 15:17:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCm2SdE4oPSs9dUQ3v6zZPqDTJlU474SMvw8J7wuraGNrU8P5hnoB05xdoooHy0kQxGzDF X-Received: by 2002:a17:902:7247:b0:156:9d3d:756d with SMTP id c7-20020a170902724700b001569d3d756dmr39841643pll.6.1649801824034; Tue, 12 Apr 2022 15:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649801824; cv=none; d=google.com; s=arc-20160816; b=IITKRxVPdbKcLxR41qMwY1iUcAA6JUsHpqm0VOWN/ejUSCm5FfTz2p2TYwWMQkeGaL 1E+rFi/urmDeeJMTqjxILn8Uwkp/4ldbl/5S2buj6yY5R9Lrmrkk0qjADAW/yS7/ek6b 7T3aBrHCnK1yfNEGQbQ++Mfluza1p6jvqDEQjqlFKvw9Ar+vzcRKg0kUG+Y6HeLalAdS A/srgDgBpHRKaIJFjjRU8oaxzNasR6KbwAyrB1se5afSBByUANNgKAqTl7Ja6UOiN9bL kbIc9z9cwSTjdSmVuC8SLifG8ZZh9vJohnXo8V92xP5g6+NSMpFP76iwEkZPKRIQowQO KpoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=Ld/fE8An6yso8TRMs+1faR22b08KWFvi8OSuyt239sY=; b=LDG/6TJIy9YQ63hObLPSPoCq3vQaqxH0PQpYuVC+lK/TTIPe/vF0bBAzF9TSt6jLUx ZSonRsflLETAn8mJHhJZFJNqRsUxcmkUxuOqfCA/0xPR09o2hlamdHaN0qEzAf3vju7k Sy/Vl/0dZMTDHfRznPz4bY1eAUi/yQu89EPYFndMBb98+vmiBlnc+1Q2j1dBiFK8ixWT eVRHj1vGUDNYr4qs3ba0eZpx2xgiZzl7iEBmJi2mhryiRbBrv65JDAyLXe+ALM7YAK2A zBFIFZm/DJpcZ8TRpHZzzsON+GVDY84fCUJul0+xjx3TDC5YsTVvKsx51kcKl4nkB95A QqVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="k/FZyHUk"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k123-20020a636f81000000b0039958d09337si3934865pgc.280.2022.04.12.15.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 15:17:04 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="k/FZyHUk"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A551CD658; Tue, 12 Apr 2022 13:58:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353850AbiDLQWM (ORCPT + 99 others); Tue, 12 Apr 2022 12:22:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244084AbiDLQWK (ORCPT ); Tue, 12 Apr 2022 12:22:10 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F9FA4F460; Tue, 12 Apr 2022 09:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649780392; x=1681316392; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=0rhW/syVVmAH9bt4RVUxl07dFxjacizqjOlvBoRg8/g=; b=k/FZyHUkaiChIUHg/bzf4Mm5gO0zGiYb4XR9p/zFJokYmHYOhGrBPIcn eLs8moWv7Yc6ujoiaEobel8kdBn5dkjxvpOcAMU96qbIQnMXGQZyQ10Sm J8rbnWYmwfYILNjRY+MAKIXfaw5sfayMF6knLWz9plKviIAKKjwVVSJL6 sCLE0ongEsosooaOdfkbqwv7p29usbZ/aSfEQdGf1NGZntXI1tqgIiW5x taKUk1YD179gdTg27A+CmHWHMyTbN0BfChA17DDkZoMJVdWo+16070RbN PFIIi4jxJWgCkpRjfXKZ0YfVxj1F6wpJDlTb4Wg2Uqu3etC/9ZhD4mn5k g==; X-IronPort-AV: E=McAfee;i="6400,9594,10315"; a="287438118" X-IronPort-AV: E=Sophos;i="5.90,254,1643702400"; d="scan'208";a="287438118" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.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-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.