mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
mm/hmm/mirror: device page fault handler
This handles page fault on behalf of device driver, unlike handle_mm_fault() it does not trigger migration back to system memory for device memory. Link: http://lkml.kernel.org/r/20170817000548.32038-6-jglisse@redhat.com Signed-off-by: Jérôme Glisse <jglisse@redhat.com> Signed-off-by: Evgeny Baskakov <ebaskakov@nvidia.com> Signed-off-by: John Hubbard <jhubbard@nvidia.com> Signed-off-by: Mark Hairgrove <mhairgrove@nvidia.com> Signed-off-by: Sherry Cheung <SCheung@nvidia.com> Signed-off-by: Subhash Gutti <sgutti@nvidia.com> Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com> Cc: Balbir Singh <bsingharora@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Dan Williams <dan.j.williams@intel.com> Cc: David Nellans <dnellans@nvidia.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Michal Hocko <mhocko@kernel.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Vladimir Davydov <vdavydov.dev@gmail.com> Cc: Bob Liu <liubo95@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
da4c3c735e
commit
74eee180b9
2 changed files with 271 additions and 12 deletions
|
@ -292,6 +292,33 @@ int hmm_vma_get_pfns(struct vm_area_struct *vma,
|
|||
unsigned long end,
|
||||
hmm_pfn_t *pfns);
|
||||
bool hmm_vma_range_done(struct vm_area_struct *vma, struct hmm_range *range);
|
||||
|
||||
|
||||
/*
|
||||
* Fault memory on behalf of device driver. Unlike handle_mm_fault(), this will
|
||||
* not migrate any device memory back to system memory. The hmm_pfn_t array will
|
||||
* be updated with the fault result and current snapshot of the CPU page table
|
||||
* for the range.
|
||||
*
|
||||
* The mmap_sem must be taken in read mode before entering and it might be
|
||||
* dropped by the function if the block argument is false. In that case, the
|
||||
* function returns -EAGAIN.
|
||||
*
|
||||
* Return value does not reflect if the fault was successful for every single
|
||||
* address or not. Therefore, the caller must to inspect the hmm_pfn_t array to
|
||||
* determine fault status for each address.
|
||||
*
|
||||
* Trying to fault inside an invalid vma will result in -EINVAL.
|
||||
*
|
||||
* See the function description in mm/hmm.c for further documentation.
|
||||
*/
|
||||
int hmm_vma_fault(struct vm_area_struct *vma,
|
||||
struct hmm_range *range,
|
||||
unsigned long start,
|
||||
unsigned long end,
|
||||
hmm_pfn_t *pfns,
|
||||
bool write,
|
||||
bool block);
|
||||
#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue