On 2021-12-01 19:07, Matthew Wilcox wrote:
On Wed, Dec 01, 2021 at 07:15:06PM +0100, Vlastimil Babka wrote:
From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>
page->freelist is for the use of slab. We already have the ability
to free a list of pages in the core mm, but it requires the use of a
list_head and for the pages to be chained together through page->lru.
Switch the iommu code over to using put_pages_list().
FYI, this is going to have conflicts with
https://lore.kernel.org/lkml/cover.1637671820.git.robin.murphy@xxxxxxx/
I'm not sure what the appropriate resolution is going to be here;
maybe hold back part of this patch series to the following merge
window to give the iommu people time to merge their own patches?
More than that, this version is subtly but catastrophically broken - we
can't simply pass &gather->freelist through the current IOVA entry_dtor
machinery, since gather is a stack variable from a few call frames up so
the actual list head will be long gone by the time
iommu_dma_entry_dtor() tries to dereference it. It took until I was
elbow-deep in refactoring the RFC to notice that one :)
Thanks,
Robin.