Re: [PATCH 4/5] khugepaged: remove unnecessary mem_cgroup_uncharge() in collapse_[file|huge_page]

2021-03-05 Thread Miaohe Lin
On 2021/3/6 1:38, Kirill A. Shutemov wrote: > On Thu, Mar 04, 2021 at 07:30:12AM -0500, Miaohe Lin wrote: >> Since commit 7ae88534cdd9 ("mm: move mem_cgroup_uncharge out of >> __page_cache_release()"), the mem_cgroup will be uncharged when hpage is >> freed. Uncharge mem_cgroup here is harmless

Re: [PATCH 4/5] khugepaged: remove unnecessary mem_cgroup_uncharge() in collapse_[file|huge_page]

2021-03-05 Thread Kirill A. Shutemov
On Thu, Mar 04, 2021 at 07:30:12AM -0500, Miaohe Lin wrote: > Since commit 7ae88534cdd9 ("mm: move mem_cgroup_uncharge out of > __page_cache_release()"), the mem_cgroup will be uncharged when hpage is > freed. Uncharge mem_cgroup here is harmless but it looks confusing and > buggy: if mem_cgroup

[PATCH 4/5] khugepaged: remove unnecessary mem_cgroup_uncharge() in collapse_[file|huge_page]

2021-03-04 Thread Miaohe Lin
Since commit 7ae88534cdd9 ("mm: move mem_cgroup_uncharge out of __page_cache_release()"), the mem_cgroup will be uncharged when hpage is freed. Uncharge mem_cgroup here is harmless but it looks confusing and buggy: if mem_cgroup charge failed, we will call mem_cgroup_uncharge() uncorrectly in