[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1558428877.12672.8.camel@suse.com>
Date: Tue, 21 May 2019 10:54:37 +0200
From: Oliver Neukum <oneukum@...e.com>
To: Christoph Hellwig <hch@...radead.org>,
Alan Stern <stern@...land.harvard.edu>
Cc: 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 Mo, 2019-05-20 at 07:23 -0700, Christoph Hellwig wrote:
> 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.
OK, but this leaves a question open. Will the GFP_NOIO actually
hurt, if it is used after memalloc_noio_save()?
Regards
Oliver
Powered by blists - more mailing lists