[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e7849fb1-e333-6210-6c92-b00ecb52ccd4@redhat.com>
Date: Thu, 11 May 2023 09:32:06 +0200
From: Cédric Le Goater <clg@...hat.com>
To: Jason Gunthorpe <jgg@...dia.com>,
Alex Williamson <alex.williamson@...hat.com>
Cc: Yan Zhao <yan.y.zhao@...el.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, kevin.tian@...el.com,
yishaih@...dia.com, shameerali.kolothum.thodi@...wei.com
Subject: Re: [PATCH] vfio/pci: take mmap write lock for io_remap_pfn_range
On 5/10/23 22:41, Jason Gunthorpe wrote:
> On Mon, May 08, 2023 at 02:57:15PM -0600, Alex Williamson wrote:
>
>> We already try to set the flags in advance, but there are some
>> architectural flags like VM_PAT that make that tricky. Cedric has been
>> looking at inserting individual pages with vmf_insert_pfn(), but that
>> incurs a lot more faults and therefore latency vs remapping the entire
>> vma on fault. I'm not convinced that we shouldn't just attempt to
>> remove the fault handler entirely, but I haven't tried it yet to know
>> what gotchas are down that path. Thanks,
OTOH I didn't see any noticeable slowdowns in the tests I did with
NICs, IGD and NVIDIA GPU pass-through. I lack devices with large
BARs though. If anyone has some time for it, here are commits :
https://github.com/legoater/linux/commits/vfio
First does a one page insert and fixes the lockdep issues we are
seeing with the recent series:
https://lore.kernel.org/all/20230126193752.297968-1-surenb@google.com/
Second adds some statistics. For the NVIDIA GPU, faults reach 800k.
Thanks,
C.
> I thought we did it like this because there were races otherwise with
> PTE insertion and zapping? I don't remember well anymore.
>
> I vaugely remember the address_space conversion might help remove the
> fault handler?
>
> Jason
>
Powered by blists - more mailing lists