Re: [PATCH v2 0/9] deferred_probe_timeout logic clean up

2022-06-07 Thread Saravana Kannan via iommu
On Tue, Jun 7, 2022 at 5:55 PM Saravana Kannan wrote: > > -Hideaki -- their email keeps bouncing. > > On Tue, Jun 7, 2022 at 11:13 AM Geert Uytterhoeven > wrote: > > > > Hi Saravana, > > > > On Wed, Jun 1, 2022 at 12:46 PM Saravana Kannan > > wrote: > > > This series is based on linux-next +

[PATCH v2] iommu: Directly use ida_alloc()/free()

2022-06-07 Thread Ke Liu via iommu
Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove(). Signed-off-by: Ke Liu Reviewed-by: Jason Gunthorpe Signed-off-by: Michael S. Tsirkin --- v2 subject change to iommu --- drivers/iommu/iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

Re: [PATCH v2 0/9] deferred_probe_timeout logic clean up

2022-06-07 Thread Saravana Kannan via iommu
-Hideaki -- their email keeps bouncing. On Tue, Jun 7, 2022 at 11:13 AM Geert Uytterhoeven wrote: > > Hi Saravana, > > On Wed, Jun 1, 2022 at 12:46 PM Saravana Kannan wrote: > > This series is based on linux-next + these 2 small patches applies on top: > >

Re: [PATCH v3 0/4] DMA mapping changes for SCSI core

2022-06-07 Thread Bart Van Assche
On 6/6/22 02:30, John Garry wrote: As reported in [0], DMA mappings whose size exceeds the IOMMU IOVA caching limit may see a big performance hit. This series introduces a new DMA mapping API, dma_opt_mapping_size(), so that drivers may know this limit when performance is a factor in the

[PATCH v6 11/11] dmapool: improve scalability of dma_pool_free

2022-06-07 Thread Tony Battersby
dma_pool_free() scales poorly when the pool contains many pages because pool_find_page() does a linear scan of all allocated pages. Improve its scalability by replacing the linear scan with a red-black tree lookup. In big O notation, this improves the algorithm from O(n) to O(log n).

[PATCH v6 10/11] dmapool: improve scalability of dma_pool_alloc

2022-06-07 Thread Tony Battersby
dma_pool_alloc() scales poorly when allocating a large number of pages because it does a linear scan of all previously-allocated pages before allocating a new one. Improve its scalability by maintaining a separate list of pages that have free blocks ready to (re)allocate. In big O notation, this

[PATCH v6 09/11] dmapool: cleanup dma_pool_destroy

2022-06-07 Thread Tony Battersby
pool_free_page() is called only from dma_pool_destroy(), so inline it and make it less generic since we know that the pool is being destroyed. Signed-off-by: Tony Battersby --- Changes since v5: Take the opposite approach and inline pool_free_page() into dma_pool_destroy() instead of moving the

[PATCH v6 08/11] dmapool: speedup DMAPOOL_DEBUG with init_on_alloc

2022-06-07 Thread Tony Battersby
Avoid double-memset of the same allocated memory in dma_pool_alloc() when both DMAPOOL_DEBUG is enabled and init_on_alloc=1. Signed-off-by: Tony Battersby --- mm/dmapool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index

[PATCH v6 07/11] dmapool: ignore init_on_free when DMAPOOL_DEBUG enabled

2022-06-07 Thread Tony Battersby
There are two cases: 1) In the normal case that the memory is being freed correctly, then DMAPOOL_DEBUG will memset the memory anyway, so speed thing up by avoiding a double-memset of the same memory. 2) In the abnormal case that DMAPOOL_DEBUG detects that a driver passes incorrect parameters to

[PATCH v6 06/11] dmapool: debug: prevent endless loop in case of corruption

2022-06-07 Thread Tony Battersby
Prevent a possible endless loop with DMAPOOL_DEBUG enabled if a buggy driver corrupts DMA pool memory. Signed-off-by: Tony Battersby --- mm/dmapool.c | 37 ++--- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index

[PATCH v6 05/11] dmapool: improve accuracy of debug statistics

2022-06-07 Thread Tony Battersby
The "total number of blocks in pool" debug statistic currently does not take the boundary value into account, so it diverges from the "total number of blocks in use" statistic when a boundary is in effect. Add a calculation for the number of blocks per allocation that takes the boundary into

[PATCH v6 04/11] dmapool: fix boundary comparison

2022-06-07 Thread Tony Battersby
Fix the boundary comparison when constructing the list of free blocks for the case that 'size' is a power of two. Since 'boundary' is also a power of two, that would make 'boundary' a multiple of 'size', in which case a single block would never cross the boundary. This bug would cause some of

[PATCH v6 03/11] dmapool: cleanup integer types

2022-06-07 Thread Tony Battersby
To represent the size of a single allocation, dmapool currently uses 'unsigned int' in some places and 'size_t' in other places. Standardize on 'unsigned int' to reduce overhead, but use 'size_t' when counting all the blocks in the entire pool. Signed-off-by: Tony Battersby --- Changes since

[PATCH v6 02/11] dmapool: use sysfs_emit() instead of scnprintf()

2022-06-07 Thread Tony Battersby
Use sysfs_emit instead of scnprintf, snprintf or sprintf. Signed-off-by: Tony Battersby --- Changes since v5: This patch was not in v5. mm/dmapool.c | 23 +++ 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/mm/dmapool.c b/mm/dmapool.c index

[PATCH v6 01/11] dmapool: remove checks for dev == NULL

2022-06-07 Thread Tony Battersby
dmapool originally tried to support pools without a device because dma_alloc_coherent() supports allocations without a device. But nobody ended up using dma pools without a device, and trying to do so will result in an oops. So remove the checks for pool->dev == NULL since they are unneeded

[PATCH v6 00/11] mpt3sas and dmapool scalability

2022-06-07 Thread Tony Battersby
This patch series improves dmapool scalability by replacing linear scans with red-black trees. Note that Keith Busch is also working on improving dmapool scalability, so for now I would recommend not merging my scalability patches until Keith's approach can be evaluated. In the meantime, my

Re: [PATCH v2 0/9] deferred_probe_timeout logic clean up

2022-06-07 Thread Geert Uytterhoeven
Hi Saravana, On Wed, Jun 1, 2022 at 12:46 PM Saravana Kannan wrote: > This series is based on linux-next + these 2 small patches applies on top: > https://lore.kernel.org/lkml/20220526034609.480766-1-sarava...@google.com/ > > A lot of the deferred_probe_timeout logic is redundant with >

Re: [PATCH 0/6] phase out CONFIG_VIRT_TO_BUS

2022-06-07 Thread Martyn Welch
On Mon, 6 Jun 2022 at 10:25, Greg Kroah-Hartman wrote: > > On Mon, Jun 06, 2022 at 10:41:03AM +0200, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > The virt_to_bus/bus_to_virt interface has been deprecated for > > decades. After Jakub Kicinski put a lot of work into cleaning out the > >

Re: [PATCH 0/5] Simplify vfio_iommu_type1 attach/detach routine

2022-06-07 Thread Baolu Lu
On 2022/6/7 19:58, Jason Gunthorpe wrote: On Tue, Jun 07, 2022 at 03:44:43PM +0800, Baolu Lu wrote: On 2022/6/6 14:19, Nicolin Chen wrote: Worths mentioning the exact match for enforce_cache_coherency is removed with this series, since there's very less value in doing that since KVM won't be

Re: [RFC PATCH v1 8/9] net: ipconfig: Force fw_devlink to unblock any devices that might probe

2022-06-07 Thread Geert Uytterhoeven
Hi Saravana, On Thu, May 26, 2022 at 10:16 AM Saravana Kannan wrote: > If there are network devices that could probe without some of their > suppliers probing and those network devices are needed for IP auto > config to work, then fw_devlink=on might break that usecase by blocking > the network

Re: [PATCH 6/6] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-07 Thread Michael Ellerman
Arnd Bergmann writes: > diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig > index be68c1f02b79..48e1aa0536b6 100644 > --- a/arch/powerpc/Kconfig > +++ b/arch/powerpc/Kconfig > @@ -277,7 +277,6 @@ config PPC > select SYSCTL_EXCEPTION_TRACE > select THREAD_INFO_IN_TASK >

Re: [PATCH 0/5] Simplify vfio_iommu_type1 attach/detach routine

2022-06-07 Thread Jason Gunthorpe via iommu
On Tue, Jun 07, 2022 at 03:44:43PM +0800, Baolu Lu wrote: > On 2022/6/6 14:19, Nicolin Chen wrote: > > Worths mentioning the exact match for enforce_cache_coherency is removed > > with this series, since there's very less value in doing that since KVM > > won't be able to take advantage of it --

Re: [PATCH v3 00/35] iommu/amd: Add multiple PCI segments support

2022-06-07 Thread Vasant Hegde via iommu
Hello Joerg, On 5/20/2022 5:42 PM, Vasant Hegde wrote: > Joerg, > > > On 5/20/2022 3:33 PM, Joerg Roedel wrote: >> Hi Vasant, >> >> On Fri, May 20, 2022 at 03:25:38PM +0530, Vasant Hegde wrote: >>> Ping. Did you get a chance to look into this series? >> >> Sorry, too late for this round. The

Re: [PATCH] drivers: iommu: Directly use ida_alloc()/free()

2022-06-07 Thread Joerg Roedel
On Fri, May 27, 2022 at 07:03:07AM +, keliu wrote: > Use ida_alloc()/ida_free() instead of deprecated > ida_simple_get()/ida_simple_remove() . > > Signed-off-by: keliu Please change the subject to: "iommu: Directly use ida_alloc()/free()" to match the IOMMU tree conventions. Also include

Re: [PATCH v2] iommu/amd: Set translation valid bit only when IO page tables are in used

2022-06-07 Thread Joerg Roedel
On Thu, May 26, 2022 at 10:29:09AM +0700, Suravee Suthikulpanit wrote: > Actually, I am referring to when user uses the IOMMU v2 table for shared > virtual address > in current iommu_v2 driver (e.g. amd_iommu_init_device(), > amd_iommu_bind_pasid). >From what I can see this is not handled yet

Re: [PATCH 0/5] Simplify vfio_iommu_type1 attach/detach routine

2022-06-07 Thread Baolu Lu
On 2022/6/6 14:19, Nicolin Chen wrote: Worths mentioning the exact match for enforce_cache_coherency is removed with this series, since there's very less value in doing that since KVM won't be able to take advantage of it -- this just wastes domain memory. Instead, we rely on Intel IOMMU driver

Re: [PATCH 6/6] arch/*/: remove CONFIG_VIRT_TO_BUS

2022-06-07 Thread Geert Uytterhoeven
On Mon, Jun 6, 2022 at 11:10 AM Arnd Bergmann wrote: > From: Arnd Bergmann > > All architecture-independent users of virt_to_bus() and bus_to_virt() > have been fixed to use the dma mapping interfaces or have been > removed now. This means the definitions on most architectures, and the >