All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel@daenzer.net>
To: Christoph Hellwig <hch@lst.de>
Cc: "Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	iommu@lists.linux-foundation.org,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test
Date: Wed, 2 May 2018 18:59:42 +0200	[thread overview]
Message-ID: <ba310210-6f3c-f4e6-29e5-5ae6e791ebeb@daenzer.net> (raw)
In-Reply-To: <20180502162145.GA26787@lst.de>

On 2018-05-02 06:21 PM, Christoph Hellwig wrote:
> On Wed, May 02, 2018 at 04:31:09PM +0200, Michel Dänzer wrote:
>>> No.  __GFP_NOWARN (and gfp_t flags in general) are the wrong interface
>>> for dma allocations and just cause problems.  I actually plan to
>>> get rid of the gfp_t argument in dma_alloc_attrs sooner, and only
>>> allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent.
>>
>> How about GFP_TRANSHUGE_LIGHT? TTM uses that to opportunistically
>> allocate huge pages (GFP_TRANSHUGE can result in unacceptably long
>> delays with memory pressure).
> 
> Well, that is exactly what I don't want drivers to do - same for
> __GFP_COMP in some drm code.  This very much assumes the page allocator
> is used to back dma allocations, which very often it actually isn't, and
> any use of magic gfp flags creates a tight coupling of consumers with a
> specific implementation.
> 
> In general I can't think of a good reason not to actually use
> GFP_TRANSHUGE_LIGHT by default in the dma allocator unless
> DMA_ATTR_ALLOC_SINGLE_PAGES is set.  Can you prepare a patch for that?

I'm afraid I'll have to leave that to somebody else.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

WARNING: multiple messages have this Message-ID (diff)
From: "Michel Dänzer" <michel@daenzer.net>
To: Christoph Hellwig <hch@lst.de>
Cc: iommu@lists.linux-foundation.org,
	"Christian König" <christian.koenig@amd.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>
Subject: Re: [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test
Date: Wed, 2 May 2018 18:59:42 +0200	[thread overview]
Message-ID: <ba310210-6f3c-f4e6-29e5-5ae6e791ebeb@daenzer.net> (raw)
In-Reply-To: <20180502162145.GA26787@lst.de>

On 2018-05-02 06:21 PM, Christoph Hellwig wrote:
> On Wed, May 02, 2018 at 04:31:09PM +0200, Michel Dänzer wrote:
>>> No.  __GFP_NOWARN (and gfp_t flags in general) are the wrong interface
>>> for dma allocations and just cause problems.  I actually plan to
>>> get rid of the gfp_t argument in dma_alloc_attrs sooner, and only
>>> allow either GFP_KERNEL or GFP_DMA passed in dma_alloc_coherent.
>>
>> How about GFP_TRANSHUGE_LIGHT? TTM uses that to opportunistically
>> allocate huge pages (GFP_TRANSHUGE can result in unacceptably long
>> delays with memory pressure).
> 
> Well, that is exactly what I don't want drivers to do - same for
> __GFP_COMP in some drm code.  This very much assumes the page allocator
> is used to back dma allocations, which very often it actually isn't, and
> any use of magic gfp flags creates a tight coupling of consumers with a
> specific implementation.
> 
> In general I can't think of a good reason not to actually use
> GFP_TRANSHUGE_LIGHT by default in the dma allocator unless
> DMA_ATTR_ALLOC_SINGLE_PAGES is set.  Can you prepare a patch for that?

I'm afraid I'll have to leave that to somebody else.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-05-02 16:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01 13:24 [PATCH] swiotlb: Fix inversed DMA_ATTR_NO_WARN test Michel Dänzer
2018-05-01 13:24 ` Michel Dänzer
2018-05-02  9:49 ` Christian König
2018-05-02  9:49   ` Christian König
2018-05-02 12:18   ` Daniel Vetter
2018-05-02 12:18     ` Daniel Vetter
2018-05-02 12:41     ` Christoph Hellwig
2018-05-02 12:41       ` Christoph Hellwig
2018-05-02 14:31       ` Michel Dänzer
2018-05-02 16:21         ` Christoph Hellwig
2018-05-02 16:59           ` Michel Dänzer [this message]
2018-05-02 16:59             ` Michel Dänzer
2018-05-22 13:13             ` Christian König
2018-05-25  8:41               ` Christoph Hellwig
2018-05-25  8:41                 ` Christoph Hellwig
2018-05-25  8:41                 ` Michel Dänzer
2018-05-25  8:41                   ` Michel Dänzer
2018-05-02 12:42 ` Christoph Hellwig
2018-05-02 12:42   ` Christoph Hellwig
2018-05-10  0:49 [PATCH] swiotlb: fix " Prasanthi Chellakumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ba310210-6f3c-f4e6-29e5-5ae6e791ebeb@daenzer.net \
    --to=michel@daenzer.net \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.