Re: [PATCH v8 6/9] secretmem: add memcg accounting

Andrew Morton
2020-11-13T01:35:19Z

On Tue, 10 Nov 2020 17:14:41 +0200 Mike Rapoport <rppt@kernel.org> wrote:

> Account memory consumed by secretmem to memcg. The accounting is updated
> when the memory is actually allocated and freed.

From: Andrew Morton <akpm@linux-foundation.org>
Subject: secretmem-add-memcg-accounting-fix

fix CONFIG_MEMCG=n build

Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

mm/filemap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/filemap.c~secretmem-add-memcg-accounting-fix
+++ a/mm/filemap.c
@@ -844,7 +844,7 @@ static noinline int __add_to_page_cache_
page->mapping = mapping;
page->index = offset;

- if (!huge && !page->memcg_data) {
+ if (!huge && !page_memcg(page)) {
error = mem_cgroup_charge(page, current->mm, gfp);
if (error)
goto error;
_