[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190520142331.GA12108@infradead.org>
Date: Mon, 20 May 2019 07:23:31 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Christoph Hellwig <hch@...radead.org>,
Oliver Neukum <oneukum@...e.com>,
Jaewon Kim <jaewon31.kim@...il.com>, linux-mm@...ck.org,
gregkh@...uxfoundation.org, Jaewon Kim <jaewon31.kim@...sung.com>,
m.szyprowski@...sung.com, ytk.lee@...sung.com,
linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org
Subject: Re: [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.
Powered by blists - more mailing lists