Re: [PATCH 09/15] mm/hmm/devmem: device memory hotplug using ZONE_DEVICE v6

From: Evgeny Baskakov
Date: Tue Jul 18 2017 - 17:41:08 EST


On 6/28/17 11:00 AM, JÃrÃme Glisse wrote:

+/*
+ * struct hmm_devmem_ops - callback for ZONE_DEVICE memory events
+ *
+ * @free: call when refcount on page reach 1 and thus is no longer use
+ * @fault: call when there is a page fault to unaddressable memory
+ */
+struct hmm_devmem_ops {
+ void (*free)(struct hmm_devmem *devmem, struct page *page);
+ int (*fault)(struct hmm_devmem *devmem,
+ struct vm_area_struct *vma,
+ unsigned long addr,
+ struct page *page,
+ unsigned int flags,
+ pmd_t *pmdp);
+};


Hi Jerome,

As discussed, could you please add detailed documentation for these callbacks?

Specifically, for the 'fault' callback it is important to clarify the meaning of each of its parameters and the return value (which error codes are expected to be returned from it).

Thanks!

--
Evgeny Baskakov
NVIDIA