Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3464240ybb; Mon, 13 Apr 2020 08:35:36 -0700 (PDT) X-Google-Smtp-Source: APiQypLNF0pQJNVEoPUyIB8K/WX9AkuiIvpDR3x9vSjQqH8Yr+CrE3LCWDT//gewSLZS/2CqPI6f X-Received: by 2002:a50:a68a:: with SMTP id e10mr17039988edc.317.1586792135883; Mon, 13 Apr 2020 08:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586792135; cv=none; d=google.com; s=arc-20160816; b=dONTEs8SgQaFcHNeE8uZU10G+KS2gLa87TTUBOTA6siI6ANPWub2pACvM6Urj1aQFs kgiRBsvY+NyRzQhiGtbyQQtD/8h9+UUsvix2N27A3V9FmCSu6nSd97O4ORI3AnZEM/7Q QlGyAZKCtB+ueaXsi9ROPDrsOHdL2mraisMKqdu5k7+586nwmaiI3oBWQBFv/5QbXF6c WffX8xGmv6NsgYFE7o3tQFQfUI0tbwu80HcUgbPmgqFLO9hfOc+PS8Nbm8aCgCPzCfY4 /W/D71SaTYunfRgB35nl8qVO/P7jbO/sZNb84xDPy75w/c16Df42t+x2W8Mpiqru9D9N K5KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=uWFIUTP14rr06BBJf7/lRX/qB9hDoGM3irEGOnU8QDY=; b=E4Dy27MaiKTyiHiyqTqyQ8/2pxiDfZwzX72h0Ih2jh+x4CAqugKh3Qp6/EA60QvkXj Sj1dORn+6kIeltiP4v1hYq4s9gwvZnqOilDvEO+pkkwqcE/X3JTWuTx1zuaIbUtNX5Ki GPXpdaATTF0L7Sy2LQnErZGNOJ59L/swtA+JsWo5boKgGPmo2NUTyRF9/icgHlzr0hNl 2IDU2a14uwCcdPNfd/xFeUi5U96PiLV1lWaF6Vdc+YgK/46BgF3N3mQVAvc3Cah574Ub M7fvlzwglXVny6MH2OhQfp4wo0lb7adhdBH3VfEPr3mUwWj+RxRmLwOMLpSEcRofxE9v a/fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H6YfiAIi; spf=pass (google.com: best guess record for 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v25si3846346edx.49.2020.04.13.08.35.12; Mon, 13 Apr 2020 08:35:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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=@redhat.com header.s=mimecast20190719 header.b=H6YfiAIi; spf=pass (google.com: best guess record for 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730859AbgDMOtb (ORCPT + 99 others); Mon, 13 Apr 2020 10:49:31 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:37339 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728185AbgDMOta (ORCPT ); Mon, 13 Apr 2020 10:49:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586789369; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uWFIUTP14rr06BBJf7/lRX/qB9hDoGM3irEGOnU8QDY=; b=H6YfiAIiJrlwxl3OhnlAnqjlK17V3IuiwjWK5EJQxjeJbk0WWsQ72sh6TGeFiV2IpsaSrV Fwba6VhOtuSErSK4mKKbJWCYVUY/My/A48uoZEkc6ggwwehJDibhgMPX/qYlUJefO4HZmP LR0v6gk4ITVzMDeLWpV0ne4eKjuHFMc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-ucynfrusNL-k6vaR3IKi2Q-1; Mon, 13 Apr 2020 10:49:21 -0400 X-MC-Unique: ucynfrusNL-k6vaR3IKi2Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6592DB63; Mon, 13 Apr 2020 14:49:19 +0000 (UTC) Received: from w520.home (ovpn-112-162.phx2.redhat.com [10.3.112.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id 968A05C1B2; Mon, 13 Apr 2020 14:49:15 +0000 (UTC) Date: Mon, 13 Apr 2020 08:49:15 -0600 From: Alex Williamson To: Dave Hansen Cc: Alexander Duyck , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrea Arcangeli , Dan Williams , David Hildenbrand , Michal Hocko , Andrew Morton Subject: Re: [RFC PATCH 0/4] mm: Add PG_zero support Message-ID: <20200413084915.1bae0007@w520.home> In-Reply-To: References: <20200412090728.GA19572@open-light-1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 12 Apr 2020 18:43:07 -0700 Dave Hansen wrote: > On 4/12/20 2:07 AM, liliangleo wrote: > > Zero out the page content usually happens when allocating pages, > > this is a time consuming operation, it makes pin and mlock > > operation very slowly, especially for a large batch of memory. > > > > This patch introduce a new feature for zero out pages before page > > allocation, it can help to speed up page allocation. > > I think the bar for getting something like this merged is going to be > pretty high. We have a long history of zeroing close to page use for > cache warmth reasons. Starting up big VMs which won't soon touch the > memory they are allocating is basically the most pathological case > against our approach since they don't *care* about cache warmth. > > I'm also not sure it's something we _want_ to optimize for. > > VFIO's unconditional page pinning is the real problem here IMNHO. They > don't *really* need to pin the memory. We just don't have good > paravirtualized IOMMU support or want to pay the runtime cost for > pin/unpin operations. You *could* totally have speedy VM startup if > only the pages being accessed or having DMA performed to them were > allocated. But, the hacks that are in place mean that everything must > be pinned. Maybe in an SEV or Secure Boot environment we can assume the VM guest OS uses the IOMMU exclusively for DMA, but otherwise the IOMMU is optional (at least for x86, other archs do require IOMMU support afaik). Therefore, how would we know which pages to pin when there are only limited configs where we might be able to lean on the vIOMMU to this extent? Thanks, Alex