[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 8 Aug 2019 11:13:50 -0400 (EDT)
From: Mikulas Patocka <mpatocka@...hat.com>
To: Matthew Wilcox <willy@...radead.org>
cc: Alexander Viro <viro@...iv.linux.org.uk>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Mike Snitzer <msnitzer@...hat.com>, junxiao.bi@...cle.com,
dm-devel@...hat.com, Alasdair Kergon <agk@...hat.com>,
honglei.wang@...cle.com, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-xfs@...r.kernel.org
Subject: Re: [PATCH] direct-io: use GFP_NOIO to avoid deadlock
On Thu, 8 Aug 2019, Matthew Wilcox wrote:
> On Thu, Aug 08, 2019 at 05:50:10AM -0400, Mikulas Patocka wrote:
> > A deadlock with this stacktrace was observed.
> >
> > The obvious problem here is that in the call chain
> > xfs_vm_direct_IO->__blockdev_direct_IO->do_blockdev_direct_IO->kmem_cache_alloc
> > we do a GFP_KERNEL allocation while we are in a filesystem driver and in a
> > block device driver.
>
> But that's not the problem. The problem is the loop driver calls into the
> filesystem without calling memalloc_noio_save() / memalloc_noio_restore().
> There are dozens of places in XFS which use GFP_KERNEL allocations and
> all can trigger this same problem if called from the loop driver.
OK. I'll send a new patch that sets PF_MEMALLOC_NOIO in the loop driver.
Mikulas
Powered by blists - more mailing lists