Skip to content

Commit

Permalink
Changes representative of linux-3.10.0-327.36.3.el7.tar.xz
Browse files Browse the repository at this point in the history
  • Loading branch information
da-x committed Oct 20, 2016
1 parent f8b1d35 commit 93c0a44
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXTRAVERSION =
NAME = Unicycling Gorilla
RHEL_MAJOR = 7
RHEL_MINOR = 2
RHEL_RELEASE = 327.36.2
RHEL_RELEASE = 327.36.3
RHEL_DRM_VERSION = 4
RHEL_DRM_PATCHLEVEL = 1
RHEL_DRM_SUBLEVEL = 0
Expand Down
1 change: 1 addition & 0 deletions include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma,
#define FOLL_NUMA 0x200 /* force NUMA hinting page fault */
#define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */
#define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */
#define FOLL_COW 0x4000 /* internal GUP flag */

typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
void *data);
Expand Down
13 changes: 11 additions & 2 deletions mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ static int __init init_zero_pfn(void)
}
core_initcall(init_zero_pfn);

/*
* FOLL_FORCE can write to even unwritable pte's, but only
* after we've gone through a COW cycle and they are dirty.
*/
static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
{
return pte_write(pte) ||
((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
}

#if defined(SPLIT_RSS_COUNTING)

Expand Down Expand Up @@ -1588,7 +1597,7 @@ struct page *follow_page_mask(struct vm_area_struct *vma,
}
if ((flags & FOLL_NUMA) && pte_numa(pte))
goto no_page;
if ((flags & FOLL_WRITE) && !pte_write(pte))
if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags))
goto unlock;

page = vm_normal_page(vma, address, pte);
Expand Down Expand Up @@ -1900,7 +1909,7 @@ long __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
*/
if ((ret & VM_FAULT_WRITE) &&
!(vma->vm_flags & VM_WRITE))
foll_flags &= ~FOLL_WRITE;
foll_flags |= FOLL_COW;

cond_resched();
}
Expand Down

0 comments on commit 93c0a44

Please sign in to comment.