Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-05 Thread Will Deacon
On Wed, Dec 05, 2018 at 10:04:00AM +0800, Nicolas Boichat wrote: > On Tue, Dec 4, 2018 at 10:35 PM Vlastimil Babka wrote: > > > > On 12/4/18 10:37 AM, Nicolas Boichat wrote: > > > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat > > > wrote: > > >> > > >> This is a follow-up to the discussion in

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
On Wed, Dec 5, 2018 at 10:04 AM Nicolas Boichat wrote: > > On Tue, Dec 4, 2018 at 10:35 PM Vlastimil Babka wrote: > > > > On 12/4/18 10:37 AM, Nicolas Boichat wrote: > > > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat > > > wrote: > > >> > > >> This is a follow-up to the discussion in [1], to

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
On Tue, Dec 4, 2018 at 10:35 PM Vlastimil Babka wrote: > > On 12/4/18 10:37 AM, Nicolas Boichat wrote: > > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat > > wrote: > >> > >> This is a follow-up to the discussion in [1], to make sure that the page > >> tables allocated by iommu/io-pgtable-arm-v

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Will Deacon
On Tue, Dec 04, 2018 at 05:37:13PM +0800, Nicolas Boichat wrote: > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat wrote: > > > > This is a follow-up to the discussion in [1], to make sure that the page > > tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit > > physical addre

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Vlastimil Babka
On 12/4/18 10:37 AM, Nicolas Boichat wrote: > On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat wrote: >> >> This is a follow-up to the discussion in [1], to make sure that the page >> tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit >> physical address space. >> >> [1] >> h

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-12-04 Thread Nicolas Boichat
On Sun, Nov 11, 2018 at 5:04 PM Nicolas Boichat wrote: > > This is a follow-up to the discussion in [1], to make sure that the page > tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit > physical address space. > > [1] > https://lists.linuxfoundation.org/pipermail/iommu/2018

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-28 Thread Nicolas Boichat
On Mon, Nov 26, 2018 at 4:02 PM Christoph Hellwig wrote: > > On Fri, Nov 23, 2018 at 01:23:41PM +0100, Vlastimil Babka wrote: > > Is this also true for caches created by kmem_cache_create(), that > > debugging options can result in not respecting the alignment passed to > > kmem_cache_create()? Th

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-26 Thread Christoph Hellwig
On Fri, Nov 23, 2018 at 01:23:41PM +0100, Vlastimil Babka wrote: > Is this also true for caches created by kmem_cache_create(), that > debugging options can result in not respecting the alignment passed to > kmem_cache_create()? That would be rather bad, IMHO. That's what I understood in the discu

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-23 Thread Michal Hocko
On Fri 23-11-18 13:23:41, Vlastimil Babka wrote: > On 11/22/18 9:23 AM, Christoph Hellwig wrote: [...] > > But I do agree with the sentiment of not wanting to spread GFP_DMA32 > > futher into the slab allocator. > > I don't see a problem with GFP_DMA32 for custom caches. Generic > kmalloc() would

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-23 Thread Vlastimil Babka
On 11/22/18 9:23 AM, Christoph Hellwig wrote: > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: >> TBH, if this DMA32 stuff is going to be contentious we could possibly just >> rip out the offending kmem_cache - it seemed like good practice for the >> use-case, but provided kzalloc(SZ

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Nicolas Boichat
On Fri, Nov 23, 2018 at 11:04 AM Nicolas Boichat wrote: > > On Thu, Nov 22, 2018 at 4:23 PM Christoph Hellwig wrote: > > > > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > > > TBH, if this DMA32 stuff is going to be contentious we could possibly just > > > rip out the offending k

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 4:23 PM Christoph Hellwig wrote: > > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > > TBH, if this DMA32 stuff is going to be contentious we could possibly just > > rip out the offending kmem_cache - it seemed like good practice for the > > use-case, but pr

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Christoph Hellwig
On Thu, Nov 22, 2018 at 07:16:32AM -0800, Matthew Wilcox wrote: > Yes, your allocations from the page_frag allocator have to have similar > lifetimes. I thought that would be ideal for XFS though; as I understood > the problem, these were per-IO allocations, and IOs to the same filesystem > tend t

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Matthew Wilcox
On Thu, Nov 22, 2018 at 12:26:02AM -0800, Christoph Hellwig wrote: > On Wed, Nov 21, 2018 at 06:35:58PM -0800, Matthew Wilcox wrote: > > I think you should look at using the page_frag allocator here. You can > > use whatever GFP_DMA flags you like. > > So I actually tries to use page_frag to solv

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Christoph Hellwig
On Wed, Nov 21, 2018 at 06:35:58PM -0800, Matthew Wilcox wrote: > I think you should look at using the page_frag allocator here. You can > use whatever GFP_DMA flags you like. So I actually tries to use page_frag to solve the XFS unaligned kmalloc allocations problem, and I don't think it is the

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-22 Thread Christoph Hellwig
On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > TBH, if this DMA32 stuff is going to be contentious we could possibly just > rip out the offending kmem_cache - it seemed like good practice for the > use-case, but provided kzalloc(SZ_1K, gfp | GFP_DMA32) can be relied upon to > give

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 10:36 AM Matthew Wilcox wrote: > > On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > > These are IOMMU page tables, rather than CPU ones, so we're already well > > outside arch code - indeed the original motivation of io-pgtable was to be > > entirely independ

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Matthew Wilcox
On Wed, Nov 21, 2018 at 10:26:26PM +, Robin Murphy wrote: > These are IOMMU page tables, rather than CPU ones, so we're already well > outside arch code - indeed the original motivation of io-pgtable was to be > entirely independent of the p*d types and arch-specific MM code (this Armv7 > short

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Nicolas Boichat
On Thu, Nov 22, 2018 at 6:27 AM Robin Murphy wrote: > > On 2018-11-21 9:38 pm, Matthew Wilcox wrote: > > On Wed, Nov 21, 2018 at 06:20:02PM +, Christopher Lameter wrote: > >> On Sun, 11 Nov 2018, Nicolas Boichat wrote: > >> > >>> This is a follow-up to the discussion in [1], to make sure that

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Robin Murphy
On 2018-11-21 9:38 pm, Matthew Wilcox wrote: On Wed, Nov 21, 2018 at 06:20:02PM +, Christopher Lameter wrote: On Sun, 11 Nov 2018, Nicolas Boichat wrote: This is a follow-up to the discussion in [1], to make sure that the page tables allocated by iommu/io-pgtable-arm-v7s are contained with

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Matthew Wilcox
On Wed, Nov 21, 2018 at 06:20:02PM +, Christopher Lameter wrote: > On Sun, 11 Nov 2018, Nicolas Boichat wrote: > > > This is a follow-up to the discussion in [1], to make sure that the page > > tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit > > physical address space.

Re: [PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-21 Thread Christopher Lameter
On Sun, 11 Nov 2018, Nicolas Boichat wrote: > This is a follow-up to the discussion in [1], to make sure that the page > tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit > physical address space. Page tables? This means you need a page frame? Why go through the slab alloca

[PATCH v2 0/3] iommu/io-pgtable-arm-v7s: Use DMA32 zone for page tables

2018-11-11 Thread Nicolas Boichat
This is a follow-up to the discussion in [1], to make sure that the page tables allocated by iommu/io-pgtable-arm-v7s are contained within 32-bit physical address space. [1] https://lists.linuxfoundation.org/pipermail/iommu/2018-November/030876.html Fixes since v1: - Add support for SLAB_CACHE_D