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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 624B1C433DB for ; Thu, 18 Feb 2021 22:59:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D0BA764EB4 for ; Thu, 18 Feb 2021 22:59:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0BA764EB4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B74D6B006C; Thu, 18 Feb 2021 17:59:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 43FF16B006E; Thu, 18 Feb 2021 17:59:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BA146B0070; Thu, 18 Feb 2021 17:59:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 126866B006C for ; Thu, 18 Feb 2021 17:59:13 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C7448180AD83A for ; Thu, 18 Feb 2021 22:59:12 +0000 (UTC) X-FDA: 77832906144.17.BC9F656 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf16.hostedemail.com (Postfix) with ESMTP id 890E780192C6 for ; Thu, 18 Feb 2021 22:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613689151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PKI2EI2akMTifDNZ7stGxIBdP3HZn3yIh1zXVcGhwwI=; b=ZFnK5iwzcWYOUxXmy3dvz7NrtScQdDi0EoWm5lNBExzV/70QXXlXQKgwBMmgN1frTmXn4B vTrGLob0Aa6D20HmNt0Uu7Nn9rdLFfFpQTsbCe4Vp4obH8ai6YpDDY7ZQjxVeW7dGBJP8Z KNcBipmVmTgBVGXShrc6+dCh/MTBfBs= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-383-WGuuYrt9PiOT52jcvoQl5g-1; Thu, 18 Feb 2021 17:59:07 -0500 X-MC-Unique: WGuuYrt9PiOT52jcvoQl5g-1 Received: by mail-qv1-f69.google.com with SMTP id d26so2084527qve.7 for ; Thu, 18 Feb 2021 14:59:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PKI2EI2akMTifDNZ7stGxIBdP3HZn3yIh1zXVcGhwwI=; b=fCeDavJe+6p/j7fDUBcIW0wY+mPEdV64N2ge2Yjl8p9LMlpydlXtNHjruYlUXdux35 fC57bK9uOd3xdSWuiU+WIJrZ8H8rCthK2EU9s55xKss8Bbrg4TPxbLLDIjaJnp9yfEZD l46LN37t5I1QHXW3fZtPUK1vhOr7mgW4qg6yM5YWo+5FSUSib2V+RKNgcb+3gOX0MjPq mMoGlgsPkMFt/AIez898lx85K8OIzeuJuQOYsKRdkg4GOhjqUNiCvZ+VSvg74xyzCIU6 s6CsnWeeIilxF7IEnivs3acY3eBP07+jXk0ZGRGHtMj75GqmiEMMuss2i3byXrxxquin 5J4g== X-Gm-Message-State: AOAM532VI/CWKkQpTQklfhAiGKtjS7GOYygPxmde3pgn/i0JCCOyUvE/ 5hsnV6pNqdegIzxz64b8JgdQiaTbmZlE1noSvtE6sH+m4fW/6pip0Eveh4IZ1RDLOmkfhHt5SBL e2iGZ69cMrG0= X-Received: by 2002:a05:622a:307:: with SMTP id q7mr6527681qtw.211.1613689147179; Thu, 18 Feb 2021 14:59:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxmNDEim01hYlaOLCBph1TMgm3UzsW+W0hEZou2jGGlO0sciL3i5yzo2yWdc/gQPQKN5MZMSg== X-Received: by 2002:a05:622a:307:: with SMTP id q7mr6527629qtw.211.1613689146890; Thu, 18 Feb 2021 14:59:06 -0800 (PST) Received: from xz-x1 (bras-vprn-toroon474qw-lp130-20-174-93-89-182.dsl.bell.ca. [174.93.89.182]) by smtp.gmail.com with ESMTPSA id v75sm4944965qkb.14.2021.02.18.14.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 14:59:06 -0800 (PST) Date: Thu, 18 Feb 2021 17:59:04 -0500 From: Peter Xu To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Arnd Bergmann , Michal Hocko , Oscar Salvador , Matthew Wilcox , Andrea Arcangeli , Minchan Kim , Jann Horn , Jason Gunthorpe , Dave Hansen , Hugh Dickins , Rik van Riel , "Michael S . Tsirkin" , "Kirill A . Shutemov" , Vlastimil Babka , Richard Henderson , Ivan Kokshaysky , Matt Turner , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Chris Zankel , Max Filippov , linux-alpha@vger.kernel.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-arch@vger.kernel.org Subject: Re: [PATCH RFC] mm/madvise: introduce MADV_POPULATE to prefault/prealloc memory Message-ID: <20210218225904.GB6669@xz-x1> References: <20210217154844.12392-1-david@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210217154844.12392-1-david@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: bndf4k1n1kkerr7e89bcq83szqqu3t8h X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 890E780192C6 Received-SPF: none (redhat.com>: No applicable sender policy available) receiver=imf16; identity=mailfrom; envelope-from=""; helo=us-smtp-delivery-124.mimecast.com; client-ip=216.205.24.124 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1613689151-569518 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: Hi, David, On Wed, Feb 17, 2021 at 04:48:44PM +0100, David Hildenbrand wrote: > When we manage sparse memory mappings dynamically in user space - also > sometimes involving MADV_NORESERVE - we want to dynamically populate/ > discard memory inside such a sparse memory region. Example users are > hypervisors (especially implementing memory ballooning or similar > technologies like virtio-mem) and memory allocators. In addition, we want > to fail in a nice way if populating does not succeed because we are out of > backend memory (which can happen easily with file-based mappings, > especially tmpfs and hugetlbfs). Could you explain a bit more on how do you plan to use this new interface for the virtio-balloon scenario? Meanwhile, here you seemed to be talking about file-backed mem, however later it sounds more like for anonymous, so I'm slightly confused. Thanks, -- Peter Xu