[Xen-devel] [PATCH] mm/pgtable: Drop pgtable_t variable from pte_fn_t functions

2019-05-02 Thread Anshuman Khandual
Drop the pgtable_t variable from all implementation for pte_fn_t as none of them use it. apply_to_pte_range() should stop computing it as well. Should help us save some cycles. Signed-off-by: Anshuman Khandual Cc: Ard Biesheuvel Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas

Re: [Xen-devel] [PATCH] mm/pgtable: Drop pgtable_t variable from pte_fn_t functions

2019-05-02 Thread Anshuman Khandual
On 05/02/2019 07:16 PM, Matthew Wilcox wrote: > On Thu, May 02, 2019 at 06:48:46PM +0530, Anshuman Khandual wrote: >> Drop the pgtable_t variable from all implementation for pte_fn_t as none of >> them use it. apply_to_pte_range() should stop computing it as well. Should >&

Re: [Xen-devel] [PATCH RFC v1 01/12] mm/memory_hotplug: Don't allow to online/offline memory blocks with holes

2019-10-23 Thread Anshuman Khandual
On 10/22/2019 10:42 PM, David Hildenbrand wrote: > Our onlining/offlining code is unnecessarily complicated. Only memory > blocks added during boot can have holes. Hotplugged memory never has > holes. That memory is already online. Why hot plugged memory at runtime cannot have holes (e.g a semi b

Re: [PATCH 10/11] swiotlb: merge swiotlb-xen initialization into swiotlb

2022-02-24 Thread Anshuman Khandual
On 2/22/22 9:05 PM, Christoph Hellwig wrote: > Allow to pass a remap argument to the swiotlb initialization functions > to handle the Xen/x86 remap case. ARM/ARM64 never did any remapping > from xen_swiotlb_fixup, so we don't even need that quirk. > > Signed-off-by: Christoph Hellwig > --- > ar

Re: [PATCH 07/11] x86: remove the IOMMU table infrastructure

2022-02-24 Thread Anshuman Khandual
On 2/22/22 9:05 PM, Christoph Hellwig wrote: > The IOMMU table tries to separate the different IOMMUs into different > backends, but actually requires various cross calls. > > Rewrite the code to do the generic swiotlb/swiotlb-xen setup directly > in pci-dma.c and then just call into the IOMMU d

Re: [PATCH 01/11] dma-direct: use is_swiotlb_active in dma_direct_map_page

2022-02-24 Thread Anshuman Khandual
eturn swiotlb_map(dev, phys, size, dir, attrs); > > if (unlikely(!dma_capable(dev, dma_addr, size, true))) { > - if (swiotlb_force != SWIOTLB_NO_FORCE) > + if (is_swiotlb_active(dev)) > return swiotlb_map(dev, phys, size, dir, attrs); >

Re: [PATCH 02/11] swiotlb: make swiotlb_exit a no-op if SWIOTLB_FORCE is set

2022-02-24 Thread Anshuman Khandual
size_t tbl_size, slots_size; > > + if (swiotlb_force == SWIOTLB_FORCE) > + return; > + > if (!mem->nslabs) > return; > > Reviewed-by: Anshuman Khandual

Re: [PATCH 03/11] swiotlb: simplify swiotlb_max_segment

2022-02-24 Thread Anshuman Khandual
swiotlb_init_with_tbl(char *tlb, unsigned long > nslabs, int verbose) > > if (verbose) > swiotlb_print_info(); > - swiotlb_set_max_segment(mem->nslabs << IO_TLB_SHIFT); > return 0; > } > > @@ -368,7 +355,6 @@ swiotlb_late_init_with_tbl(char *tlb, unsigned long > nslabs) > swiotlb_init_io_tlb_mem(mem, virt_to_phys(tlb), nslabs, true); > > swiotlb_print_info(); > - swiotlb_set_max_segment(mem->nslabs << IO_TLB_SHIFT); > return 0; > } > Reviewed-by: Anshuman Khandual

Re: [PATCH 04/11] swiotlb: rename swiotlb_late_init_with_default_size

2022-02-24 Thread Anshuman Khandual
like above, but with some error catching. > */ > -int > -swiotlb_late_init_with_default_size(size_t default_size) > +int swiotlb_init_late(size_t size) > { > - unsigned long nslabs = > - ALIGN(default_size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE); > + unsigned long nslabs = ALIGN(size >> IO_TLB_SHIFT, IO_TLB_SEGSIZE); > unsigned long bytes; > unsigned char *vstart = NULL; > unsigned int order; > Reviewed-by: Anshuman Khandual

Re: [PATCH 05/11] swiotlb: pass a gfp_mask argument to swiotlb_init_late

2022-02-24 Thread Anshuman Khandual
; - vstart = (void *)__get_free_pages(GFP_DMA | __GFP_NOWARN, > + vstart = (void *)__get_free_pages(gfp_mask | __GFP_NOWARN, > order); > if (vstart) > break; > Reviewed-by: Anshuman Khandual