mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 14:04:54 +02:00
FROMLIST: mm/migrate: Pass vm_fault pointer to migrate_misplaced_page()
migrate_misplaced_page() is only called during the page fault handling so it's better to pass the pointer to the struct vm_fault instead of the vma. This way during the speculative page fault path the saved vma->vm_flags could be used. Change-Id: I254a7c9d91dca9ee8a9afd5eccd6de9af5dc8bc0 Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com> Link: https://lore.kernel.org/lkml/1523975611-15978-14-git-send-email-ldufour@linux.vnet.ibm.com/ Bug: 161210518 Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
This commit is contained in:
parent
32507b6ff2
commit
320b684750
|
|
@ -102,14 +102,14 @@ static inline void __ClearPageMovable(struct page *page)
|
|||
#ifdef CONFIG_NUMA_BALANCING
|
||||
extern bool pmd_trans_migrating(pmd_t pmd);
|
||||
extern int migrate_misplaced_page(struct page *page,
|
||||
struct vm_area_struct *vma, int node);
|
||||
struct vm_fault *vmf, int node);
|
||||
#else
|
||||
static inline bool pmd_trans_migrating(pmd_t pmd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
static inline int migrate_misplaced_page(struct page *page,
|
||||
struct vm_area_struct *vma, int node)
|
||||
struct vm_fault *vmf, int node)
|
||||
{
|
||||
return -EAGAIN; /* can't migrate now */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4320,7 +4320,7 @@ static vm_fault_t do_numa_page(struct vm_fault *vmf)
|
|||
}
|
||||
|
||||
/* Migrate to the requested node */
|
||||
migrated = migrate_misplaced_page(page, vma, target_nid);
|
||||
migrated = migrate_misplaced_page(page, vmf, target_nid);
|
||||
if (migrated) {
|
||||
page_nid = target_nid;
|
||||
flags |= TNF_MIGRATED;
|
||||
|
|
|
|||
|
|
@ -2068,7 +2068,7 @@ bool pmd_trans_migrating(pmd_t pmd)
|
|||
* node. Caller is expected to have an elevated reference count on
|
||||
* the page that will be dropped by this function before returning.
|
||||
*/
|
||||
int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
|
||||
int migrate_misplaced_page(struct page *page, struct vm_fault *vmf,
|
||||
int node)
|
||||
{
|
||||
pg_data_t *pgdat = NODE_DATA(node);
|
||||
|
|
@ -2081,7 +2081,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
|
|||
* with execute permissions as they are probably shared libraries.
|
||||
*/
|
||||
if (page_mapcount(page) != 1 && page_is_file_lru(page) &&
|
||||
(vma->vm_flags & VM_EXEC))
|
||||
(vmf->vma_flags & VM_EXEC))
|
||||
goto out;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user