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=-8.0 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,URIBL_BLOCKED,USER_AGENT_SANE_2 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 AD06DC4320A for ; Tue, 10 Aug 2021 21:51:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B3656056B for ; Tue, 10 Aug 2021 21:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234966AbhHJVv0 (ORCPT ); Tue, 10 Aug 2021 17:51:26 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23049 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234852AbhHJVvZ (ORCPT ); Tue, 10 Aug 2021 17:51:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628632261; 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=oH36/9wH82mNkALKpSBwfhqJr/0cHRA60oHpFS8duTI=; b=DAp0ugyrAOwGImwkGYC7NThWgRlljVL68YYInh+fZhUMU4CmSeM4ttc2Ap9Y5roMbJSd/f 6pxyVPXYKnUYuqEf05rYygTeVCaTOrfcC5Cn+UE4vKGnI4ucLofwTMV8EgI4tggPmIy53O tZMCZYAA5GAiARH8pN1pxz5kFkCgcNU= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-309-aBPDBkatN2K37mphjgpN_w-1; Tue, 10 Aug 2021 17:51:00 -0400 X-MC-Unique: aBPDBkatN2K37mphjgpN_w-1 Received: by mail-ot1-f70.google.com with SMTP id s44-20020a05683043acb02904f41dddb2beso259164otv.7 for ; Tue, 10 Aug 2021 14:51:00 -0700 (PDT) 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=oH36/9wH82mNkALKpSBwfhqJr/0cHRA60oHpFS8duTI=; b=TzTlWAKr+Oplnj0xH1vy1gvsinEYcV98w+eC15l0kFq54665/RfO5vYNVQXbSa0drT 0Y/K0+QHwVaIFiw8cbz0qi8XNN1DQOROw1utZx889uO5zLJjAe5LWRo+gYiVWEBzFk4O uw7zTuNBtbLYlUIsCBuO9OGbroVAAWC4528wW1PUFa4C5x2C3XE77KTnmUcebjKVa7+w uNK4F66BJ65IjyF87wxgVUiDSl9OrNx7B/sQhT8qAzBRqT8cBA4U0OIo5xT/QpHKECfu pbY3yEQcUIL4I+rU0qAlPIuVi8lo8kg7CL3ntUDEHXXRz2RUQey6c3QilKOR1Jh5QJ4h LWUQ== X-Gm-Message-State: AOAM530sl01sQSbGU6gU+iCOruqXA0QoUHZrqcGDD0foEQ4IE9CXz+G9 ZpSOsU/3pmvqAnI0kKXWYBdpvoUZwVadzJtECIZvZDfgPmdBQQGkf47d1ODJPKSkpncL65f0K7a ZKpO3XNdIiCxfEf2iqA9KnW3W X-Received: by 2002:aca:1911:: with SMTP id l17mr7944507oii.160.1628632260033; Tue, 10 Aug 2021 14:51:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0YdnMUdm+pqFd5LmIbRWI/f3AmnZFLtHNMH7iPqJDMGpCMBi118Y1XtZ+GSFLbmgWeFotoA== X-Received: by 2002:aca:1911:: with SMTP id l17mr7944498oii.160.1628632259915; Tue, 10 Aug 2021 14:50:59 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id e20sm655457otj.4.2021.08.10.14.50.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 14:50:59 -0700 (PDT) Date: Tue, 10 Aug 2021 15:50:58 -0600 From: Alex Williamson To: Christoph Hellwig Cc: Jason Gunthorpe , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, peterx@redhat.com Subject: Re: [PATCH 3/7] vfio/pci: Use vfio_device_unmap_mapping_range() Message-ID: <20210810155058.4199a86b.alex.williamson@redhat.com> In-Reply-To: References: <162818167535.1511194.6614962507750594786.stgit@omen> <162818325518.1511194.1243290800645603609.stgit@omen> <20210806010418.GF1672295@nvidia.com> <20210806141745.1d8c3e0a.alex.williamson@redhat.com> <20210810115722.GA5158@nvidia.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 10 Aug 2021 13:55:00 +0100 Christoph Hellwig wrote: > On Tue, Aug 10, 2021 at 08:57:22AM -0300, Jason Gunthorpe wrote: > > I'm not sure there is a real performance win to chase here? Doesn't > > this only protect mmap against reset? The mmap isn't performance > > sensitive, right? > > > > If this really needs extra optimization adding a rwsem to the devset > > and using that across the whole set would surely be sufficient. > > Every mmio read or write takes memory_lock. Exactly. Ideally we're not using that path often, but I don't think that's a good excuse to introduce memory access serialization, or even dependencies between devices. Thanks, Alex