[lkml]   [2019]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH] usb: host: xhci: allow __GFP_FS in dma allocation
On Mon, May 20, 2019 at 10:16:57AM -0400, Alan Stern wrote:
> What if the allocation requires the kernel to swap some old pages out
> to the backing store, but the backing store is on the device that the
> driver is managing? The swap can't take place until the current I/O
> operation is complete (assuming the driver can handle only one I/O
> operation at a time), and the current operation can't complete until
> the old pages are swapped out. Result: deadlock.
> Isn't that the whole reason for using GFP_NOIO in the first place?

It is, or rather was. As it has been incredibly painful to wire
up the gfp_t argument through some callstacks, most notably the
vmalloc allocator which is used by a lot of the DMA allocators on
non-coherent platforms, we now have the memalloc_noio_save and
memalloc_nofs_save functions that mark a thread as not beeing to
go into I/O / FS reclaim. So even if you use GFP_KERNEL you will
not dip into reclaim with those flags set on the thread.

 \ /
  Last update: 2019-05-20 16:24    [W:0.109 / U:22.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site