Re: [PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-21 Thread Christoph Hellwig
On Fri, Oct 20, 2017 at 10:27:22AM -0700, Dan Williams wrote: > I'll take a look at hooking this up through a page-idle callback. Can > I get some breadcrumbs to grep for from XFS folks on how to set/clear > the busy state of extents? As Brian pointed out it's the xfs_extent_busy.c file (and I poi

Re: [PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-20 Thread Brian Foster
On Fri, Oct 20, 2017 at 10:27:22AM -0700, Dan Williams wrote: > On Fri, Oct 20, 2017 at 9:32 AM, Christoph Hellwig wrote: > > On Fri, Oct 20, 2017 at 08:42:00AM -0700, Dan Williams wrote: > >> I agree, but it needs quite a bit more thought and restructuring of > >> the truncate path. I also wonder

Re: [PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-20 Thread Dan Williams
On Fri, Oct 20, 2017 at 9:32 AM, Christoph Hellwig wrote: > On Fri, Oct 20, 2017 at 08:42:00AM -0700, Dan Williams wrote: >> I agree, but it needs quite a bit more thought and restructuring of >> the truncate path. I also wonder how we reclaim those stranded >> filesystem blocks, but a first appro

Re: [PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-20 Thread Christoph Hellwig
On Fri, Oct 20, 2017 at 08:42:00AM -0700, Dan Williams wrote: > I agree, but it needs quite a bit more thought and restructuring of > the truncate path. I also wonder how we reclaim those stranded > filesystem blocks, but a first approximation is wait for the > administrator to delete them or auto-

Re: [PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-20 Thread Dan Williams
On Fri, Oct 20, 2017 at 6:05 AM, Jeff Layton wrote: > On Thu, 2017-10-19 at 19:40 -0700, Dan Williams wrote: >> get_user_pages() pins file backed memory pages for access by dma >> devices. However, it only pins the memory pages not the page-to-file >> offset association. If a file is truncated the

Re: [PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-20 Thread Jeff Layton
On Thu, 2017-10-19 at 19:40 -0700, Dan Williams wrote: > get_user_pages() pins file backed memory pages for access by dma > devices. However, it only pins the memory pages not the page-to-file > offset association. If a file is truncated the pages are mapped out of > the file and dma may continue i

[PATCH v3 12/13] dax: handle truncate of dma-busy pages

2017-10-19 Thread Dan Williams
get_user_pages() pins file backed memory pages for access by dma devices. However, it only pins the memory pages not the page-to-file offset association. If a file is truncated the pages are mapped out of the file and dma may continue indefinitely into a page that is owned by a device driver. This