Re: [PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone

2020-08-06 Thread Christoph Hellwig
On Thu, Aug 06, 2020 at 01:50:29PM +0200, Nicolas Saenz Julienne wrote: > > The latter is pretty much what I expect, as we only support the default and > > per-device DMA CMAs. > > Fair enough, should I send a v3 with everything cleaned-up/rebased, or you'd > rather pick it up from your version?

Re: [PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone

2020-08-06 Thread Nicolas Saenz Julienne
On Thu, 2020-08-06 at 07:18 +0200, Christoph Hellwig wrote: > On Tue, Aug 04, 2020 at 11:43:15AM +0200, Nicolas Saenz Julienne wrote: > > > Second I don't see the need (and actually some harm) in preventing > > > GFP_KERNEL > > > allocations from dipping into lower CMA areas - something that we

Re: [PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone

2020-08-05 Thread Christoph Hellwig
On Tue, Aug 04, 2020 at 11:43:15AM +0200, Nicolas Saenz Julienne wrote: > > Second I don't see the need (and actually some harm) in preventing > > GFP_KERNEL > > allocations from dipping into lower CMA areas - something that we did > > support > > before 5.8 with the single pool. > > My

Re: [PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone

2020-08-04 Thread Nicolas Saenz Julienne
On Tue, 2020-08-04 at 08:06 +0200, Christoph Hellwig wrote: > On Mon, Aug 03, 2020 at 06:09:56PM +0200, Nicolas Saenz Julienne wrote: > > + if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA)) > > + return end <= DMA_BIT_MASK(zone_dma_bits); > > + if (IS_ENABLED(CONFIG_ZONE_DMA32) &&

Re: [PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone

2020-08-04 Thread Christoph Hellwig
On Mon, Aug 03, 2020 at 06:09:56PM +0200, Nicolas Saenz Julienne wrote: > + if (IS_ENABLED(CONFIG_ZONE_DMA) && (gfp & GFP_DMA)) > + return end <= DMA_BIT_MASK(zone_dma_bits); > + if (IS_ENABLED(CONFIG_ZONE_DMA32) && (gfp & GFP_DMA32)) > + return end <=

[PATCH v2 2/2] dma-pool: Only allocate from CMA when in same memory zone

2020-08-03 Thread Nicolas Saenz Julienne
There is no guarantee to CMA's placement, so allocating a zone specific atomic pool from CMA might return memory from a completely different memory zone. To get around this double check CMA's placement before allocating from it. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: -