Re: [RFC] respect the referenced bit of KVM guest pages?
From: KOSAKI Motohiro <hidden>
Date: 2009-08-19 12:05:22
Also in:
lkml
quoted
page_referenced_file? I think we should change page_referenced().Yeah, good catch.quoted
Instead, How about this? ============================================== Subject: [PATCH] mm: stop circulating of referenced mlocked pages Currently, mlock() systemcall doesn't gurantee to mark the page PG_Mlockedmark PG_mlockedquoted
because some race prevent page grabbing. In that case, instead vmscan move the page to unevictable lru. However, Recently Wu Fengguang pointed out current vmscan logic isn't so efficient. mlocked page can move circulatly active and inactive list because vmscan check the page is referenced _before_ cull mlocked page. Plus, vmscan should mark PG_Mlocked when cull mlocked page.PG_mlockedquoted
Otherwise vm stastics show strange number. This patch does that.Reviewed-by: Wu Fengguang <redacted>
Thanks.
quoted
Index: b/mm/rmap.c ===================================================================--- a/mm/rmap.c 2009-08-18 19:48:14.000000000 +0900 +++ b/mm/rmap.c 2009-08-18 23:47:34.000000000 +0900@@ -362,7 +362,9 @@ static int page_referenced_one(struct pa* unevictable list. */ if (vma->vm_flags & VM_LOCKED) { - *mapcount = 1; /* break early from loop */ + *mapcount = 1; /* break early from loop */ + *vm_flags |= VM_LOCKED; /* for prevent to move active list */quoted
+ try_set_page_mlocked(vma, page);That call is not absolutely necessary?
Why? I haven't catch your point. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>