Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp195159imw; Wed, 13 Jul 2022 22:59:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u++qwAJqrgKjV6Lck8woMm8DHbIDCruFQkaAKWtOoIsnswU2rZsqwgZ0dZSXKQtPFU0olQ X-Received: by 2002:a17:903:26d2:b0:16c:1684:4124 with SMTP id jg18-20020a17090326d200b0016c16844124mr6873501plb.9.1657778370638; Wed, 13 Jul 2022 22:59:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657778370; cv=pass; d=google.com; s=arc-20160816; b=LigK7DfBPV99zezXjpalYpFsTTCvJbYKaoE4d79z6181rNzJFsmCyAKSPVm3QebwoC 4HAEiYZp2OV8E6/9om6JA0QTRSJmOpmRTF+NFphVQvjSvS1UYa2G5/PkHlXZQUReYPZo P6bGzq0NcWuDjDw7wFibY3t6MoPXw5DBU/Z1lop/xG/4rehjetC2IOBdn3/d10M12/vJ l9SoDdlgAI6GrzntGa7C1zjacELMro0vznJCAOzseq5Z/ttV8ZpqMPOX2A7zqAp4NHmw NhqmAHFTFB+tciDtToWd2K8xRfI0rQr1ORGzy1nHbw5KnhkSiaNcEMi8Li9aO2/jta87 m8lA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=hD6U9IBmIvIpZco/ZjWYvMR6AW/yL3LBjjbeei/n1Fg=; b=lMAl5Ro3RtfhDNQXrKzNdgMJYu7+dtINh59jcE+P+fE2j0Nkaj8QUfdPFZsqhEgY0H I0BtFOZVTup43KPJNYQRxl+zppeIrYH9UF6cxsFi47Yr8yxbZ9jIv9Veo/JB9pg8z/pa AdJ8/otA6uTKpS+SvKhNJVRUDohRlGXq0IZpYlqvzR3CmgDENvwRFnC7W0vQ23DAtk2b C1LBTudqwcVg9NH7CmruLtxCtg9CadYX9VNf7BkH3D5U8I6Szl+kS0UJR1pczePpF2pu CImzn7PP2TC07NkPNqceDTonusiaj2cCuYUhJHPzj07afKJshxgPRc9/i5pF6nKgLOa2 pZfw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Nj4tza8y; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a630401000000b0040d20139d09si771174pge.243.2022.07.13.22.59.19; Wed, 13 Jul 2022 22:59:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Nj4tza8y; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233972AbiGNFOF (ORCPT + 99 others); Thu, 14 Jul 2022 01:14:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233478AbiGNFOD (ORCPT ); Thu, 14 Jul 2022 01:14:03 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2077.outbound.protection.outlook.com [40.107.92.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E521AF39; Wed, 13 Jul 2022 22:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=konCyrcv1WTttlX98x1x4ibySLYZ9wQSiW28Wm9Wvgtym2DKnikFoYLRpNCE3ajZdlaMbHwlH18XnMlHKhqReiRNeP4gpwIieOXQ6C7M8yos1TbXLrzj0GKp3EVUf8j55NjC5o9YaCC1RERwuOpTiAGD37RWwyAwvTrBiw92o5N1l9lMw0V+NtmrRsBBX1RJmO95l/0lgDNqaaGmwslCwmlrho9X5P2g8V2hus2bOU/r1W9sWM95hSzrCILZWDLiOgpIIw7ay43lZAaJ6VowhXwHcedznlEDTc8sQ5B2a9FLGiKTDPBaedVyaBVHsFE/BSjakc1NgjIT8+qV9TrLpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hD6U9IBmIvIpZco/ZjWYvMR6AW/yL3LBjjbeei/n1Fg=; b=YOWWOO0aLtPmACS0HhXe7Xw7k9NpQjF5wT9ol3xgY9n5KRB2erqQeQary01l0fRipxLFCOs7OkifHp3euF/2G7U7lO2qBJ0iXcUsXbUSYVzyrax0RaKv0Ept5/df2jpr8DNad8POvSJogexnbLF85/QpTgHq1yRa2NS7uefdkGs0zFcg52NQNTQgGHPoXM0OBu71kWMWbYnodiR8w6k2zrD03yLtJUgUz7UENsaOETLiiJeRrmcmQ+9L+YvkbV0HIApPksY5HwfUZm9sLG4vx8u3ajJSNNhT0/NI8BOCu4TKZksoUyFJm7Cj2/0J6+GHSNYpKTFD+56E1B43kkJjjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hD6U9IBmIvIpZco/ZjWYvMR6AW/yL3LBjjbeei/n1Fg=; b=Nj4tza8y8R+6LS9mn6xgNUM9+y+xAdj/FmdxMHvRKvb9kN/22XlyTzzrEKoU3MrE87/ZWzeuQhl6DNf8bDvV+j+ahpOb4/d3AuL831sRFc8tZjl0DqaqpU2slofBToDEwYIy6LV+ME6V1c9tBqYMT2AzrSuz2v7RPo21P1LABKk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CY4PR1201MB0181.namprd12.prod.outlook.com (2603:10b6:910:1f::11) by MWHPR1201MB0125.namprd12.prod.outlook.com (2603:10b6:301:55::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5417.23; Thu, 14 Jul 2022 05:13:58 +0000 Received: from CY4PR1201MB0181.namprd12.prod.outlook.com ([fe80::1001:3c79:9504:8d6a]) by CY4PR1201MB0181.namprd12.prod.outlook.com ([fe80::1001:3c79:9504:8d6a%10]) with mapi id 15.20.5417.026; Thu, 14 Jul 2022 05:13:58 +0000 Message-ID: <1ea62889-1919-bee9-2314-68ead1e72f06@amd.com> Date: Thu, 14 Jul 2022 07:13:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Content-Language: en-US To: Andy Lutomirski , Chao Peng Cc: kvm list , Linux Kernel Mailing List , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linux API , linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , the arch/x86 maintainers , "H. Peter Anvin" , Hugh Dickins , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , "Kirill A. Shutemov" , "Nakajima, Jun" , Dave Hansen , Andi Kleen , David Hildenbrand , aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , Michal Hocko , Muchun Song References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220713075738.GC2831541@chaop.bj.intel.com> <13d25d2e-ff79-5762-ddb8-87df56f5cbcf@amd.com> From: "Gupta, Pankaj" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0141.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::14) To CY4PR1201MB0181.namprd12.prod.outlook.com (2603:10b6:910:1f::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 645cd842-6567-4380-cfb1-08da6557a7d2 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0125:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4csyfLAYsd6P4UUfpRKifEt1TIWtD3v12UD4IJ3SdU8AwvR2XzNYjsDI931SmvAwrZXZBI9/W0ub4/9gctqYfM4mEHt0IM2V4Oumjhn4jHRmgNvv8OAnopZBYE7YsteXSBy/Nl9/yIft60mZ1nYkzuvS03l1As8/+KtmT4d2P0ohYAUQ99I4BsZoNTgCq37mHA4YOijYjT0hQgfgWP/0b+DZMtWGwTUC4XIIPFBee2YIiL1m+re+ylTo2sn93CxjWSa1AWkYbCDlrmabpXa2pOkabB5RzjYShaAAAFckBSHCz2pg+N2Ce8lIonEMKjT8s1yfa/x2WM6iR/auQWeko97YRsHxtj8uV+xff5qNkCOw7O5hUUizSv94vDYvUtpEhh+ITO0euzv6751dpB0yAsAZZ41otgktcn+XkxSQd3nCve6KB/44e8IeT7fkqEQ3YiaaQgv5MJFqgKGv8cXw3ds+1M/qYAgbHrLRQ9pM5nQECmLD0C4SW3YiugeT7U0cKvF7cwwIYDFdOHKKdf42WdxCgViguJjQn0TcnGPADG7CsFD5otrqT9pPeyHbYT3zNiQXZkpF2ChVjf5DZEtRdnc1ALYSMom3mHhCGyK1ZRJy1f4tkdhPClG8S+gOphetRjf2Fsp2oWx/XWrn3auNew0cMSP0Fo+Lj2PUQ8WHoI2V7V0tVwPOuolESuSk9++bodaZ3FPILPcuBGztQCq93QxoAFnE04gkzp98UOrj7G/Hur9rBXL5hHs5RhxhTNV10HaOeXuW8LZYyWPRESnqmjGRGlYe9cn9EVW7C8O0rBR1XoXhfNDSI0yCeGL7jhEobVpVywvwBStaNCOXu1DxEA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1201MB0181.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(136003)(39860400002)(396003)(366004)(376002)(5660300002)(54906003)(6486002)(6506007)(478600001)(2906002)(316002)(6666004)(31686004)(26005)(41300700001)(6512007)(110136005)(36756003)(31696002)(2616005)(38100700002)(4326008)(66556008)(7416002)(8676002)(7406005)(86362001)(8936002)(186003)(66476007)(66946007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M0hFMkN6QmdCS2JtZ0hVTUdWSStrMTBqcWloTFJCeHVaLzk0dS81bzlNUzVl?= =?utf-8?B?SE9LSTNtMjBnQ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yRUoy?= =?utf-8?B?ck9xRjhvaklUcWVRZmhUNFBXZ3dtUGFldDdLcDdzTCs2UkZ4aTNjdzBINlI1?= =?utf-8?B?ZnJLYTFlZHFKMkFLWmRIQURJYWNVTjB5cHhhM0l0cTRrVGR3QjJkZjJ6cjFz?= =?utf-8?B?dlZVczdlU2MwSVYySU41eEVURDc5bTV6eE1MbmI5TFl1VWNydzRIOEp5clZM?= =?utf-8?B?S1FXdURLL1d2OUF6U1ZWVXdVaE95UU1xS1YzaTlsVS9hcmpjc1h2WUd6aUkv?= =?utf-8?Q?NGB60gtRlVuHbAiAMW47wt3k2?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 645cd842-6567-4380-cfb1-08da6557a7d2 X-MS-Exchange-CrossTenant-AuthSource: CY4PR1201MB0181.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2022 05:13:58.1954 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jSo8tyoFrdbO1GSnn4cUz3L7p2d30PquK8O3PuhfZPdd7P3wQiUugSGJUn/F4Vnl7sMjVcB+4krFhCFhVQwOYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0125 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 >>>>> This is the v7 of this series which tries to implement the fd-based KVM >>>>> guest private memory. The patches are based on latest kvm/queue branch >>>>> commit: >>>>> >>>>> b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU >>>>> split_desc_cache only by default capacity >>>>> >>>>> Introduction >>>>> ------------ >>>>> In general this patch series introduce fd-based memslot which provides >>>>> guest memory through memory file descriptor fd[offset,size] instead of >>>>> hva/size. The fd can be created from a supported memory filesystem >>>>> like tmpfs/hugetlbfs etc. which we refer as memory backing store. KVM >>>> >>>> Thinking a bit, As host side fd on tmpfs or shmem will store memory on host >>>> page cache instead of mapping pages into userspace address space. Can we hit >>>> double (un-coordinated) page cache problem with this when guest page cache >>>> is also used? >>> >>> This is my understanding: in host it will be indeed in page cache (in >>> current shmem implementation) but that's just the way it allocates and >>> provides the physical memory for the guest. In guest, guest OS will not >>> see this fd (absolutely), it only sees guest memory, on top of which it >>> can build its own page cache system for its own file-mapped content but >>> that is unrelated to host page cache. >> >> yes. If guest fills its page cache with file backed memory, this at host >> side(on shmem fd backend) will also fill the host page cache fast. This >> can have an impact on performance of guest VM's if host goes to memory >> pressure situation sooner. Or else we end up utilizing way less System >> RAM. > > Is this in any meaningful way different from a regular VM? After thinking a bit, Seems 'No'. Except the reclaim decisions system would take under memory pressure and also will have to see how well this gets stitched with memory tiers in future. But all these are future topics. Sorry! for the noise. Thanks, Pankaj