FROMLIST: mm: introduce __lru_cache_add_active_or_unevictable

The speculative page fault handler which is run without holding the
mmap_sem is calling lru_cache_add_active_or_unevictable() but the vm_flags
is not guaranteed to remain constant.
Introducing __lru_cache_add_active_or_unevictable() which has the vma flags
value parameter instead of the vma pointer.

Change-Id: I68decbe0f80847403127c45c97565e47512532e9
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-15-git-send-email-ldufour@linux.vnet.ibm.com/
Bug: 161210518
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
This commit is contained in:
Laurent Dufour
2018-04-17 16:33:20 +02:00
committed by Suren Baghdasaryan
parent 320b684750
commit cbff8f3907
3 changed files with 15 additions and 9 deletions

View File

@@ -351,8 +351,14 @@ extern void deactivate_page(struct page *page);
extern void mark_page_lazyfree(struct page *page);
extern void swap_setup(void);
extern void lru_cache_add_inactive_or_unevictable(struct page *page,
struct vm_area_struct *vma);
extern void __lru_cache_add_inactive_or_unevictable(struct page *page,
unsigned long vma_flags);
static inline void lru_cache_add_inactive_or_unevictable(struct page *page,
struct vm_area_struct *vma)
{
return __lru_cache_add_inactive_or_unevictable(page, vma->vm_flags);
}
/* linux/mm/vmscan.c */
extern unsigned long zone_reclaimable_pages(struct zone *zone);