lkml.org 
[lkml]   [2020]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: linux-next: build failure after merge of the akpm tree
Hi Mike,

On Sun, 15 Nov 2020 11:01:05 +0200 Mike Rapoport <rppt@kernel.org> wrote:
>
> My preference would be to put the entire function body in '#ifdef
> CONFIG_MEMCG' here.

OK, so today I used this:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 16 Nov 2020 16:55:10 +1100
Subject: [PATCH] secretmem-add-memcg-accounting-fix2

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
mm/secretmem.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/mm/secretmem.c b/mm/secretmem.c
index 5ed6b2070136..c7a37b2d01ed 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -59,6 +59,7 @@ bool secretmem_active(void)

static int secretmem_memcg_charge(struct page *page, gfp_t gfp, int order)
{
+#ifdef CONFIG_MEMCG
unsigned long nr_pages = (1 << order);
int i, err;

@@ -72,11 +73,13 @@ static int secretmem_memcg_charge(struct page *page, gfp_t gfp, int order)
p->memcg_data = page->memcg_data;
}

+#endif
return 0;
}

static void secretmem_memcg_uncharge(struct page *page, int order)
{
+#ifdef CONFIG_MEMCG
unsigned long nr_pages = (1 << order);
int i;

@@ -87,6 +90,7 @@ static void secretmem_memcg_uncharge(struct page *page, int order)
}

memcg_kmem_uncharge_page(page, PMD_PAGE_ORDER);
+#endif
}

static int secretmem_pool_increase(struct secretmem_ctx *ctx, gfp_t gfp)
--
2.29.2
--
Cheers,
Stephen Rothwell
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-11-16 07:18    [W:0.056 / U:0.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site