Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp84139pxu; Wed, 14 Oct 2020 21:07:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJnfcocHc0S3R1LzU/02ephDNpb7BL7QhYJe3TVG8qmk57Rdm5RLw3Fc/qhxa0hFRnkigx X-Received: by 2002:a50:d751:: with SMTP id i17mr2320772edj.337.1602734844810; Wed, 14 Oct 2020 21:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602734844; cv=none; d=google.com; s=arc-20160816; b=GpDrdJQfDLZOyFgu9jFXDtP3K28HIaTXUbYhc1tfIL/SEhBh+WIteNxWD6KOBMnXtv wiVANBGvDeHjTxzxpdzl+V0FsND4GSh9rCZDwOYLuMCGXCJJwydZVjthi1Od/GiJE7JD ysv7PL/Jr2O+sIYbqjZ61y6oJrOyPIjVNMWzodKA+OHDiS02GcghbBKCciPzlko3l+t2 Y7X5FDkIul3stRD9QAwfLCnlY6rbWMdp9gBIKrynQrMcHBqIaGaGVfcua5WLY6E4vvEz pzvLWjlKrGKHUa8eaPitQhMPDptMFOM39Z4VC4lQIsYE3gT0tutvC1+4h0W4bvV8lF/y OeZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=u6oCs/9cz9zpdxxwRUYUm1kSBmkyW+u+MezXxhay8qc=; b=tWIJ95Z/Tv0xrHEcEISLTyH+IZ/zxVM7up/UaxUdhWHABnfoN3gfuNeM7c33ruEKE4 YdIUUQp7sEQCdkfbJBXN2sq6kcrSRXiur7gOnPfMnTzMUv310qXoEhIUEHNy0Zt6wEhB NMdwqMfVMusQuJwYFaAU/XkZOUtECdRZix/PDcx3wP6V2FsTMKyH6UBtlANUgUZL6uVf MFYDhi1PFj0sgxLL5OR/KkzR9wvPvpCxWTKSjwZpoRPtuy/kESIYX0k5Cko/HC1oVjsK u0BFh+YMHEElNbXmEUFNTo/8YyujYW4VkotTzmrj/ltRpSpQ6Y3XQIQ/XPMFqGDwF19E pQWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=gW7j1C0V; 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 v11si1271604ejw.321.2020.10.14.21.07.02; Wed, 14 Oct 2020 21:07:24 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=gW7j1C0V; 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 S1732502AbgJOCEl (ORCPT + 99 others); Wed, 14 Oct 2020 22:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726934AbgJOCEj (ORCPT ); Wed, 14 Oct 2020 22:04:39 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0749FC0610D1 for ; Wed, 14 Oct 2020 15:25:38 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id x1so1111224eds.1 for ; Wed, 14 Oct 2020 15:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=u6oCs/9cz9zpdxxwRUYUm1kSBmkyW+u+MezXxhay8qc=; b=gW7j1C0VbGjDq2pb7kmXH0xuHfgsrcWmVnw7BNVz/Tby5/EWLlBSYuBTYmw17rDAqg lylbJ+o7UaR1mbiUY/egwQXmpuAYlVsKg/KEJAFHM0AKmH7VjwvYUAavAORKxt4CGi8g M7gYE3jmVYpGvmVyGdCJ066k4QR6/4VTZrtzhL0Kf6EH0ce9c1QIYuPlcrPZ7dtjJu8/ Gh+8T2NmhdI6B3Pen0YfzFvoYdbu/Dy9QpcRvzpe6AxR+rchzzx5vGlJywIP/1UBe2bk 66kkB2VI1PTPWeg7Iqud8PKlE0vqJ5bVtOtFWTOAktts6jlF64c/PpMGGLMcl86iJ4mY vmCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=u6oCs/9cz9zpdxxwRUYUm1kSBmkyW+u+MezXxhay8qc=; b=LWE8alOmUp9IirvQ8yobwyH7rLAu38oISxqtrEVihVcyxF+WR2ibotDiEIBm3ug94I 8ag5nIpFerBILSNlRRsGBWwo6Mqedvlbf+QZBaRSktTKsqbpkt5vFVxjuWa8nKREspnf ckyW/v74ul+bVoeNASFwvag1zj99qo+tm6nd7CwAgyR3AJsGDPAjUfyklAwquz17V/4J ehEnwivFzdheFDjzJ9EogTdnSGnrFRlNIA45vJUuxTVzJ+DlHCEFFtVPuX6q67Y3udk9 r1UVkotHwpFM/RRhU0IR74TB5Iww4oipYLA/kxi0rDk/9zx88cRqYpZil1E0q0/S3x/n Cm7g== X-Gm-Message-State: AOAM530Tug3W47cIWKG4qpuNVW5Mi8RPHgnOsENvW8P36iQadqaM9Y8a 12InhM7jzxIWIQRsWRrPQVHuielW1bNfPHuT3JCkmA== X-Received: by 2002:a50:8e1e:: with SMTP id 30mr1288139edw.354.1602714336584; Wed, 14 Oct 2020 15:25:36 -0700 (PDT) MIME-Version: 1.0 References: <98be093d-c869-941a-6dd9-fb16356f763b@oracle.com> In-Reply-To: <98be093d-c869-941a-6dd9-fb16356f763b@oracle.com> From: Dan Williams Date: Wed, 14 Oct 2020 15:25:25 -0700 Message-ID: Subject: Re: [PATCH 00/35] Enhance memory utilization with DMEMFS To: Joao Martins Cc: yulei zhang , linux-fsdevel , kvm , LKML , Xiao Guangrong , Wanpeng Li , Haiwei Li , Yulei Zhang , Andrew Morton , Naoya Horiguchi , Al Viro , Paolo Bonzini , Matthew Wilcox , Mike Kravetz , Jane Y Chu , Muchun Song , Konrad Rzeszutek Wilk Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 12, 2020 at 4:00 AM Joao Martins wrote: [..] > On 10/10/20 9:15 AM, yulei zhang wrote: > > On Fri, Oct 9, 2020 at 7:53 PM Joao Martins wrote: > >> On 10/9/20 12:39 PM, yulei zhang wrote: > >>> Joao, thanks a lot for the feedback. One more thing needs to mention > >>> is that dmemfs also support fine-grained > >>> memory management which makes it more flexible for tenants with > >>> different requirements. > >>> > >> So as DAX when it allows to partition a region (starting 5.10). Meaning you have a region > >> which you dedicated to userspace. That region can then be partitioning into devices which > >> give you access to multiple (possibly discontinuous) extents with at a given page > >> granularity (selectable when you create the device), accessed through mmap(). > >> You can then give that device to a cgroup. Or you can return that memory back to the > >> kernel (should you run into OOM situation), or you recreate the same mappings across > >> reboot/kexec. > >> > >> I probably need to read your patches again, but can you extend on the 'dmemfs also support > >> fine-grained memory management' to understand what is the gap that you mention? > >> > > sure, dmemfs uses bitmap to track the memory usage in the reserved > > memory region in > > a given page size granularity. And for each user the memory can be > > discrete as well. > > > That same functionality of tracking reserved region usage across different users at any > page granularity is covered the DAX series I mentioned below. The discrete part -- IIUC > what you meant -- is then reduced using DAX ABI/tools to create a device file vs a filesystem. Put another way. Linux already has a fine grained memory management system, the page allocator. Now, with recent device-dax extensions, it also has a coarse grained memory management system for physical address-space partitioning and a path for struct-page-less backing for VMs. What feature gaps remain vs dmemfs, and can those gaps be closed with incremental improvements to the 2 existing memory-management systems?