lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 5 Jan 2022 21:13:06 -0400 From: Jason Gunthorpe <jgg@...dia.com> To: Daniel Jordan <daniel.m.jordan@...cle.com> Cc: Alexander Duyck <alexanderduyck@...com>, Alex Williamson <alex.williamson@...hat.com>, Andrew Morton <akpm@...ux-foundation.org>, Ben Segall <bsegall@...gle.com>, Cornelia Huck <cohuck@...hat.com>, Dan Williams <dan.j.williams@...el.com>, Dave Hansen <dave.hansen@...ux.intel.com>, Dietmar Eggemann <dietmar.eggemann@....com>, Herbert Xu <herbert@...dor.apana.org.au>, Ingo Molnar <mingo@...hat.com>, Johannes Weiner <hannes@...xchg.org>, Josh Triplett <josh@...htriplett.org>, Michal Hocko <mhocko@...e.com>, Nico Pache <npache@...hat.com>, Pasha Tatashin <pasha.tatashin@...een.com>, Peter Zijlstra <peterz@...radead.org>, Steffen Klassert <steffen.klassert@...unet.com>, Steve Sistare <steven.sistare@...cle.com>, Tejun Heo <tj@...nel.org>, Tim Chen <tim.c.chen@...ux.intel.com>, Vincent Guittot <vincent.guittot@...aro.org>, linux-mm@...ck.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org Subject: Re: [RFC 00/16] padata, vfio, sched: Multithreaded VFIO page pinning On Wed, Jan 05, 2022 at 07:46:40PM -0500, Daniel Jordan wrote: > Get ready to parallelize. In particular, pinning can fail, so make jobs > undo-able. > > 5 vfio/type1: Pass mm to vfio_pin_pages_remote() > 6 vfio/type1: Refactor dma map removal > 7 vfio/type1: Parallelize vfio_pin_map_dma() > 8 vfio/type1: Cache locked_vm to ease mmap_lock contention In some ways this kind of seems like overkill, why not just have userspace break the guest VA into chunks and call map in parallel? Similar to how it already does the prealloc in parallel? This is a simpler kernel job of optimizing locking to allow concurrency. It is also not good that this inserts arbitary cuts in the IOVA address space, that will cause iommu_map() to be called with smaller npages, and could result in a long term inefficiency in the iommu. I don't know how the kernel can combat this without prior knowledge of the likely physical memory layout (eg is the VM using 1G huge pages or something).. Personally I'd rather see the results from Matthew's work to allow GUP to work on folios efficiently before reaching to this extreme. The results you got of only 1.2x improvement don't seem so compelling. Based on the unpin work I fully expect that folio optimized GUP will do much better than that with single threaded.. Jason
Powered by blists - more mailing lists