X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=mm%2Fksm.c;h=1925ffbfb27f00ac3d3d262ce0ea1c8aaa3a117f;hb=96e80a7851b44f3decaac0625665cd64e550b71d;hp=310544a379ae9c7b886b3b50815e5f3d5a991ba8;hpb=2cbb6160b56038aad0ce0b05bed7a75d6f086171;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git diff --git a/mm/ksm.c b/mm/ksm.c index 310544a..1925ffb 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -1571,6 +1572,16 @@ struct page *ksm_does_need_to_copy(struct page *page, new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address); if (new_page) { + /* + * The memcg-specific accounting when moving + * pages around the LRU lists relies on the + * page's owner (memcg) to be valid. Usually, + * pages are assigned to a new owner before + * being put on the LRU list, but since this + * is not the case here, the stale owner from + * a previous allocation cycle must be reset. + */ + mem_cgroup_reset_owner(new_page); copy_user_highpage(new_page, page, address, vma); SetPageDirty(new_page);