gup.c (38c5ce936a0862a6ce2c8d1c72689a3aba301425) gup.c (33692f27597fcab536d7cbbcc8f52905133e4aa7)
1#include <linux/kernel.h>
2#include <linux/errno.h>
3#include <linux/err.h>
4#include <linux/spinlock.h>
5
6#include <linux/mm.h>
7#include <linux/pagemap.h>
8#include <linux/rmap.h>

--- 282 unchanged lines hidden (view full) ---

291 }
292
293 ret = handle_mm_fault(mm, vma, address, fault_flags);
294 if (ret & VM_FAULT_ERROR) {
295 if (ret & VM_FAULT_OOM)
296 return -ENOMEM;
297 if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
298 return *flags & FOLL_HWPOISON ? -EHWPOISON : -EFAULT;
1#include <linux/kernel.h>
2#include <linux/errno.h>
3#include <linux/err.h>
4#include <linux/spinlock.h>
5
6#include <linux/mm.h>
7#include <linux/pagemap.h>
8#include <linux/rmap.h>

--- 282 unchanged lines hidden (view full) ---

291 }
292
293 ret = handle_mm_fault(mm, vma, address, fault_flags);
294 if (ret & VM_FAULT_ERROR) {
295 if (ret & VM_FAULT_OOM)
296 return -ENOMEM;
297 if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
298 return *flags & FOLL_HWPOISON ? -EHWPOISON : -EFAULT;
299 if (ret & VM_FAULT_SIGBUS)
299 if (ret & (VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV))
300 return -EFAULT;
301 BUG();
302 }
303
304 if (tsk) {
305 if (ret & VM_FAULT_MAJOR)
306 tsk->maj_flt++;
307 else

--- 258 unchanged lines hidden (view full) ---

566 return -EFAULT;
567
568 ret = handle_mm_fault(mm, vma, address, fault_flags);
569 if (ret & VM_FAULT_ERROR) {
570 if (ret & VM_FAULT_OOM)
571 return -ENOMEM;
572 if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
573 return -EHWPOISON;
300 return -EFAULT;
301 BUG();
302 }
303
304 if (tsk) {
305 if (ret & VM_FAULT_MAJOR)
306 tsk->maj_flt++;
307 else

--- 258 unchanged lines hidden (view full) ---

566 return -EFAULT;
567
568 ret = handle_mm_fault(mm, vma, address, fault_flags);
569 if (ret & VM_FAULT_ERROR) {
570 if (ret & VM_FAULT_OOM)
571 return -ENOMEM;
572 if (ret & (VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_LARGE))
573 return -EHWPOISON;
574 if (ret & VM_FAULT_SIGBUS)
574 if (ret & (VM_FAULT_SIGBUS | VM_FAULT_SIGSEGV))
575 return -EFAULT;
576 BUG();
577 }
578 if (tsk) {
579 if (ret & VM_FAULT_MAJOR)
580 tsk->maj_flt++;
581 else
582 tsk->min_flt++;

--- 338 unchanged lines hidden (view full) ---

921static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
922 int write, struct page **pages, int *nr)
923{
924 unsigned long next;
925 pmd_t *pmdp;
926
927 pmdp = pmd_offset(&pud, addr);
928 do {
575 return -EFAULT;
576 BUG();
577 }
578 if (tsk) {
579 if (ret & VM_FAULT_MAJOR)
580 tsk->maj_flt++;
581 else
582 tsk->min_flt++;

--- 338 unchanged lines hidden (view full) ---

921static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
922 int write, struct page **pages, int *nr)
923{
924 unsigned long next;
925 pmd_t *pmdp;
926
927 pmdp = pmd_offset(&pud, addr);
928 do {
929 pmd_t pmd = READ_ONCE(*pmdp);
929 pmd_t pmd = ACCESS_ONCE(*pmdp);
930
931 next = pmd_addr_end(addr, end);
932 if (pmd_none(pmd) || pmd_trans_splitting(pmd))
933 return 0;
934
935 if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd))) {
936 /*
937 * NUMA hinting faults need to be handled in the GUP

--- 160 unchanged lines hidden ---
930
931 next = pmd_addr_end(addr, end);
932 if (pmd_none(pmd) || pmd_trans_splitting(pmd))
933 return 0;
934
935 if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd))) {
936 /*
937 * NUMA hinting faults need to be handled in the GUP

--- 160 unchanged lines hidden ---