xen: don't use page->lru for ZONE_DEVICE memory

Commit 9e2369c06c ("xen: add helpers to allocate unpopulated
memory") introduced usage of ZONE_DEVICE memory for foreign memory
mappings.

Unfortunately this collides with using page->lru for Xen backend
private page caches.

Fix that by using page->zone_device_data instead.

Cc: <stable@vger.kernel.org> # 5.9
Fixes: 9e2369c06c ("xen: add helpers to allocate unpopulated memory")
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovksy@oracle.com>
Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
Juergen Gross
2020-12-07 09:36:14 +01:00
parent ca33479cc7
commit ee32f32335
3 changed files with 73 additions and 16 deletions

View File

@@ -200,7 +200,11 @@ void gnttab_free_pages(int nr_pages, struct page **pages);
struct gnttab_page_cache {
spinlock_t lock;
#ifdef CONFIG_XEN_UNPOPULATED_ALLOC
struct page *pages;
#else
struct list_head pages;
#endif
unsigned int num_pages;
};