Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3905071pxt; Tue, 10 Aug 2021 14:22:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGz+zV2pHI9kMuaKzFubgxsC0ro88RILXmS2bcAv+wj8d1cNqaTMIhFg5bDGEveHoYiCly X-Received: by 2002:a05:6602:2003:: with SMTP id y3mr235882iod.95.1628630571507; Tue, 10 Aug 2021 14:22:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628630571; cv=none; d=google.com; s=arc-20160816; b=J7dv3rWctCwViEuzSMe3Au0J0nMzXL1AnsBHawuVnhh0IvHSp7SkKc5mV9R+RN/NCa dFRvnHQ4wPBBTHPKGHmg9Mv1HYZxWm6uaYzwoiAKBpjwOd9eRAWkQBpO6xTu6SxczmSV k3Wl3Ni6KONpiSnAK0E1/kx5YhtJHXR5UoU1dzpjzJPS1liAseS20E2pKcB6JPLrcD7/ 5dfunW7dPvg+ao6Q3/TTud/woNd233n54OoZmSh2Bzlj43yRXYLB9wRKmMzgdpBe1RTn 7zzaihvUxT7KCarNou9W58uRskjvwMIFlwgN+sIHIrp7rGC4P0psu/XOhZ4kLH20tJG7 BdGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=n/1n9vwhCuYr7Gvq9W3sV0JY0l/qMYYOpwd/i71p5/4=; b=ojWyOrg2gHzOb9tbhSyMAXn/IxJWqdJttS4S1+pBL0Wz9Gu5P7F6SEW8TpvYA5eWFF nkG4rTRW+R+Bjfau361uS1iu3z71PzewcJ9tG36JJQh0jB1ntWhMLlVi2G9g3wa4DJht LzP+d0ZHPFIE8TUOceszBfU+pFNNPE1xosym4eilvPBpXU85RATulTaYUXnMP+aRe61w w4NZtfOi/WoQ1Ht/TyUkf6zjvtoUEKlEIAJgk4SpGoNXpZAC0SEqTvvVq9h8jLYRH1fz juMk3zVls01SjGXLdLGc8p661+ysDuR/5/SVTQA+60i9GrXvO+flIC3IANoUULPzJ2m3 /Y1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i20si24449905jaj.74.2021.08.10.14.22.35; Tue, 10 Aug 2021 14:22:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234347AbhHJVUi (ORCPT + 99 others); Tue, 10 Aug 2021 17:20:38 -0400 Received: from mga05.intel.com ([192.55.52.43]:38958 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233962AbhHJVUc (ORCPT ); Tue, 10 Aug 2021 17:20:32 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10072"; a="300584855" X-IronPort-AV: E=Sophos;i="5.84,310,1620716400"; d="scan'208";a="300584855" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2021 14:20:10 -0700 X-IronPort-AV: E=Sophos;i="5.84,310,1620716400"; d="scan'208";a="515987352" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.69.62]) ([10.209.69.62]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2021 14:20:09 -0700 Subject: Re: [PATCH 1/5] mm: Add support for unaccepted memory To: Dave Hansen , "Kirill A. Shutemov" , Borislav Petkov , Andy Lutomirski , Sean Christopherson , Andrew Morton , Joerg Roedel Cc: Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Varad Gautam , Dario Faggioli , x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" References: <20210810062626.1012-1-kirill.shutemov@linux.intel.com> <20210810062626.1012-2-kirill.shutemov@linux.intel.com> <9748c07c-4e59-89d0-f425-c57f778d1b42@linux.intel.com> <17b6a3a3-bd7d-f57e-8762-96258b16247a@intel.com> <796a4b20-7fa3-3086-efa0-2f728f35ae06@linux.intel.com> From: Andi Kleen Message-ID: <3caf5e73-c104-0057-680c-7851476e67ac@linux.intel.com> Date: Tue, 10 Aug 2021 14:20:08 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > These boot blips are not the biggest issue in the world. But, it is > fully under the guest's control and I think the guest has some > responsibility to provide *some* mitigation for it. It sounds more like an exercise in preliminary optimization at this point. If it's a real problem we can still worry about it later. > 1. Do background acceptance, as opposed to relying 100% on demand-driven > acceptance. Guarantees a limited window in which blips can occur. Like Kirill wrote this was abandoned because it always allocates all memory on the host even if the guest doesn't need it. > 2. Do acceptance based on user input, like from sysfs. You can easily do that by running "memhog" at boot. No need for anything in the kernel. BTW I believe this is also configurable at the guest BIOS level. > 3. Add a command-line argument to accept everything up front, or at > least before userspace runs. Same. > 4. Add some statistic for how much unaccepted memory remains. Yes that makes sense. We should have statistic counters for all of this. Also I agree with your suggestion that we should get the slow path out of the zone locks/interrupt disable region. That should be easy enough and is an obvious improvement. -Andi