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=-6.1 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 532D8C433ED for ; Tue, 18 May 2021 18:59:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 389F261285 for ; Tue, 18 May 2021 18:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351861AbhERTAr (ORCPT ); Tue, 18 May 2021 15:00:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58033 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351733AbhERTA0 (ORCPT ); Tue, 18 May 2021 15:00:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621364348; 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=KnsitSUYNYIrkYp5/4jTUdGYLDO+k29G3HMJTBbuxHc=; b=PR8yCb6KefxGUnh5IvzYQO4efBfyKvd7bJ7XrhTMtZzhzIpMqV2pRbXQeoZRWNK/XxtBzE 1b0Lq7XDhiQ/lB/m+aP3EoCmbwajpjlY4ek0mGiofEYymwVUt3ROTJtBS9bvbtU/B6r9Yq yZ5LbNQrNsjxxevkFstM0gW024i/ZCU= 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-209-vS--UL1LNZqF1pGSTXmJPQ-1; Tue, 18 May 2021 14:59:04 -0400 X-MC-Unique: vS--UL1LNZqF1pGSTXmJPQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DDEE11012D9A; Tue, 18 May 2021 18:59:01 +0000 (UTC) Received: from redhat.com (ovpn-113-225.phx2.redhat.com [10.3.113.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2345B100F49F; Tue, 18 May 2021 18:59:01 +0000 (UTC) Date: Tue, 18 May 2021 12:58:26 -0600 From: Alex Williamson To: Shenming Lu Cc: Cornelia Huck , Will Deacon , Robin Murphy , Joerg Roedel , Jean-Philippe Brucker , Eric Auger , , , , , , Kevin Tian , Lu Baolu , , Christoph Hellwig , Jonathan Cameron , Barry Song , , Subject: Re: [RFC PATCH v3 4/8] vfio/type1: Pre-map more pages than requested in the IOPF handling Message-ID: <20210518125826.7ba38b78.alex.williamson@redhat.com> In-Reply-To: <20210409034420.1799-5-lushenming@huawei.com> References: <20210409034420.1799-1-lushenming@huawei.com> <20210409034420.1799-5-lushenming@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Apr 2021 11:44:16 +0800 Shenming Lu wrote: > To optimize for fewer page fault handlings, we can pre-map more pages > than requested at once. > > Note that IOPF_PREMAP_LEN is just an arbitrary value for now, which we > could try further tuning. I'd prefer that the series introduced full end-to-end functionality before trying to improve performance. The pre-map value seems arbitrary here and as noted in the previous patch, the IOMMU API does not guarantee unmaps of ranges smaller than the original mapping. This would need to map with single page granularity in order to guarantee page granularity at the mmu notifier when the IOMMU supports superpages. Thanks, Alex