Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp460803pxb; Wed, 11 Nov 2020 07:58:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHgWcYJvMo/DqSimBECbqkuGBEW0B09dLDk0TrlNWvIb4bNbAFH9i2/O0p6lpH5fNXzV+7 X-Received: by 2002:a50:ab07:: with SMTP id s7mr18031edc.287.1605110313884; Wed, 11 Nov 2020 07:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605110313; cv=none; d=google.com; s=arc-20160816; b=NTn33ICIYPM5TW1aVZDi/T/7xLOtsdP8cj/2iEPQDQwWOZGj72LOLhGa6BLHRV6VbV px8hHI9gKl6FzQcSVly8eUf5WbxCxc6vMdJpAdLsvF1ZeUQswS5vymT2ABnZNBxZiEee 66AOvzL4sTgJFukaz6YjpRUkwPI3ASOW1U9rL/wTSicxQc7bH0iO26wjO+DFzXT+DJqG mUY5EUv7KZfiWaUS7padzbKkgoSl+/cq09NDBt51PCbD0OcZ4poiezFo+KnIga9ZGXTZ fgv+M+f44Cxf1wDetMgzP4qmQgnOhYs+fN64lU0tZFM0pqDDToBsPKWoDWtPNt/ix8Ix 8DTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=suRdJwLnXLetr79Suk7ebRlOZN0VSf/hg9yKDNSdV0U=; b=JUz4mIhqmArwTX0M/dIWnNo++z6BzyE/S23h7PVws98wROSfTMrgGdY2NhCUQm+bjn 3VJKH6xJhe7waICMheRatrnPr2zEapS3ezPTZ1eccGkiv6ZrRk/Ye0JZjKjGwXI2wzVO M/sWAZp1OiZrxH4VGp9E+3epbVcw/XeP+fU4dxxinc1W90nas2STb2MARatl/rlfemyA J7e5aYJOBvKHFvQzH51hbehRXbatEnNqRnCeN4KN5xTx5Y0NCidSsMIIOec51Vg2HkvG IwJeZ+vU7v5gDrvk/X7AX3UEEg5lI4+qkzt9wVDHn/L1dudc9jeXFi60CGYybmhk7AEI vQ9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OCIqJe6a; 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=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 y1si1677428edm.279.2020.11.11.07.58.09; Wed, 11 Nov 2020 07:58:33 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=OCIqJe6a; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbgKKP4r (ORCPT + 99 others); Wed, 11 Nov 2020 10:56:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43864 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726830AbgKKP4r (ORCPT ); Wed, 11 Nov 2020 10:56:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605110206; 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=suRdJwLnXLetr79Suk7ebRlOZN0VSf/hg9yKDNSdV0U=; b=OCIqJe6atSb3Ongj9hh2nKIuvIDNXXlqOcyY0SnUu+nvLcUjf1ToIxSXlFsmMntR27qO9c EmTLwi19fclM9hUHd/njdl/o4LcbvBnnYx9VflDLhILyOUdyxAyY4AwYPE6oHS8g6MFu3X 859DsBnIFx9Udks5679579u+UaGObMg= 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-103-SRrrHpkwOMCtGy7yEhbCdg-1; Wed, 11 Nov 2020 10:56:42 -0500 X-MC-Unique: SRrrHpkwOMCtGy7yEhbCdg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DD8D803F41; Wed, 11 Nov 2020 15:56:40 +0000 (UTC) Received: from w520.home (ovpn-112-213.phx2.redhat.com [10.3.112.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0D2760CD0; Wed, 11 Nov 2020 15:56:39 +0000 (UTC) Date: Wed, 11 Nov 2020 08:56:39 -0700 From: Alex Williamson To: "xuxiaoyang (C)" Cc: , , , , , , , Subject: Re: [PATCH] vfio iommu type1: Improve vfio_iommu_type1_pin_pages performance Message-ID: <20201111085639.7235fb42@w520.home> In-Reply-To: <2553f102-de17-b23b-4cd8-fefaf2a04f24@huawei.com> References: <2553f102-de17-b23b-4cd8-fefaf2a04f24@huawei.com> 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.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Nov 2020 21:42:33 +0800 "xuxiaoyang (C)" wrote: > vfio_iommu_type1_pin_pages is very inefficient because > it is processed page by page when calling vfio_pin_page_external. > Added contiguous_vaddr_get_pfn to process continuous pages > to reduce the number of loops, thereby improving performance. vfio_pin_pages() accepts an array of unrelated iova pfns and processes each to return the physical pfn. AFAICT this proposal makes an unfounded and unverified assumption that the caller is asking for a range of contiguous iova pfns. That's not the semantics of the call. This is wrong. Thanks, Alex